Prism

io.github.terradev-cloud由 GitHub 账号 terradev-cloud 发布v1.0.0更新于 Oct 28, 2026

Stateless MCP gateway and OTel span-streaming bridge for hosted MCP servers.

已验证Streamable HTTP可网页运行云端与基础设施开发者工具安全与监控

概览

AI 生成的概览

无状态 MCP 网关,把调用转发给上游 MCP 服务器,并将每次调用转换为 OpenTelemetry span 发送到指定目的地。

可以做什么
  • 查询网关身份、版本、传输方式、默认捕获级别与当前追踪的会话数
  • 通过 ping 验证网关连通性,返回时间戳并可回显参数
  • 获取接入说明:如何设置上游、无 header 客户端的查询参数配置、目的地与借用令牌模型
  • 把 JSON-RPC 原样转发给配置的上游 MCP 服务器,并按请求生成 span 发送到 OTLP、文件、标准输出或分流目的地
适用场景
适合在不改动上游服务器的前提下观测 MCP 流量:追踪工具调用、发现失败,并把 span 送入 Grafana、Honeycomb 或 Collector 等 OTLP 后端。它是网关,不提供存储或可视化界面。
运行要求
通过 streamable HTTP 连接 prism-mcp.terradev.cloud 远程端点;网关本身无需账号或开通。上游 MCP 服务器通过 X-Prism-Upstream 请求头或 upstream 查询参数指定,且须在该部署的允许列表内。目的地由服务端配置(配置文件或环境变量);托管使用可能需要目的地的 bearer 令牌。
安装前请注意
网关位于每次 MCP 调用的路径上,能看到请求参数,开启捕获时还包括结果;捕获默认关闭并声明已脱敏。上游凭据可通过 X-Prism-Upstream-Authorization 转发,目的地认证头或 API key 可能以请求头或查询参数传递,从而出现在日志或 URL 中。span 会发送到你配置的第三方目的地。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Prism,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.terradev-cloud%2Fprism/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "prism": {
      "type": "http",
      "url": "https://prism-mcp.terradev.cloud/mcp"
    }
  }
}

README

Prism

Stateless MCP gateway. Sits between an AI client and an MCP server, relays JSON-RPC verbatim, and turns every call into an OpenTelemetry span — shipped over OTLP to any endpoint you choose. No database, no accounts, no provisioning. See docs/PRISM.md for the full spec.

Fastest path to a live dashboard: get a free key at telinea.terradev.cloud, set one destination, and every span appears in Telinea within seconds.

Run

bash
pip install -r requirements.txt
# Zero-config dev: spans print to stdout.PRISM_UPSTREAM_ALLOW='*' \PRISM_ALLOW_INSECURE_HOSTS='localhost,127.0.0.1' \uvicorn prism.main:app --port 8080

Where spans go

One pipeline, one egress primitive: PrismSpan → Serializer → Dispatcher. Prism knows four destination schemes and nothing about backends:

  • https:// / http:// — POST serialized spans to any OTLP endpoint. Grafana, Honeycomb, a collector, Telinea — read the backend's own docs for its endpoint and auth header, fill in two fields, done.
  • file:// — append JSONL to a local path. No account, no network.
  • stdout:// — human-readable lines for development.
  • multi://a,b — fan-out to named destinations; failures are isolated.

Configure in ~/.prism/config.toml (or ./prism.toml, or PRISM_CONFIG):

toml
[prism]destination = "telinea"
[destinations.telinea]endpoint = "https://api.terradev.cloud/telinea/v1/ingest"format = "telinea"headers = { "Authorization" = "Bearer tl_your_key" }

Formats: otlp_json (default — the industry wire standard), otlp_proto (needs pip install opentelemetry-proto), jsonl, telinea (native envelope for Telinea ingest).

Every field has an env override — secrets never need to touch disk:

bash
PRISM_DESTINATION=telineaPRISM_DESTINATION_TELINEA_HEADERS_AUTHORIZATION="Bearer tl_..."

Hosted mode: "Authorization" = "Bearer {token}" resolves {token} to the caller's bearer per span — each user's spans land in their own account.

Delivery: buffered, flushed every 5 s or 512 spans; Retry-After honored on 429 for every backend; failed batches go to a dead-letter ring buffer (10k spans) retried on backoff; on shutdown, in-flight spans drain and the dead-letter buffer is written to ~/.prism/deadletter.jsonl and replayed on next start. Fire-and-forget — Prism never blocks a chat session on a flush.

Client config

The entire integration is a URL swap plus headers:

json
{  "mcpServers": {    "acme-prod": {      "url": "https://prism-mcp.terradev.cloud/mcp",      "headers": {        "Authorization": "Bearer tln_live_…",        "X-Prism-Upstream": "http://localhost:9000/mcp",        "X-Prism-Project": "acme-prod",        "X-Prism-Env": "development"      }    }  }}
  • X-Prism-Upstream — the real MCP server. Must match PRISM_UPSTREAM_ALLOW.
  • X-Prism-Upstream-Authorization — forwarded upstream as Authorization.
  • X-Prism-Capture — none (default) | args | args,results. Redacted.
  • X-Prism-Sample — 0.0–1.0, sampled once per session.

Header-less clients can encode the upstream in the path: POST /mcp/u/{base64url(upstream)}.

Registries (Smithery et al.)

Registry installs can't set custom headers — config arrives as query params. Every X-Prism-* option has a query-param twin:

/mcp?upstream=https://mcp.acme.dev/mcp&api_key=tln_live_…&project=acme&env=prod
  • upstream → X-Prism-Upstream (or set PRISM_DEFAULT_UPSTREAM for single-upstream deployments)
  • api_key / token → Authorization / X-Api-Key
  • upstream_authorization → X-Prism-Upstream-Authorization
  • project, env, role, capture, sample → their X-Prism-* twins

smithery.yaml in this directory is the registry manifest for the self-hosted container path; the hosted listing just points at https://prism-mcp.terradev.cloud/mcp.

What you get

One MCP session = one trace. One JSON-RPC request = one span. Tool failures surface correctly (result.isError → ERROR, not a green 200). With a Telinea destination, every Prism-fronted server also appears on the Telinea Gateway board via the endpoint attribute — p50/p95/p99, req/min, sparkline — with no backend changes.

Not built (by design)

  • No backend-specific serialization. If a backend needs a proprietary format, run an OpenTelemetry Collector and point Prism at it — that's what the Collector is for.
  • No query layer, storage, or UI. Prism emits; Telinea stores and visualizes.
  • Legacy HTTP+SSE transport (/sse + /messages, 2024-11-05 spec).
  • DNS-rebinding-safe IP pinning at the transport layer (see guard.py).

来源:README.md,提交 417fc0e

工具

3

prism_info

Prism service info

Returns Prism's service identity and runtime state: version, transport, public URL, capture default, and the number of MCP sessions currently being traced. Use this to confirm which Prism deployment you are talking to and whether it is healthy before configuring an upstream.

无需输入参数。

prism_ping

Liveness check

Returns {"pong": true, "time": <unix seconds>} plus an optional echo of the 'echo' argument. Use to verify connectivity through the gateway before pointing it at an upstream MCP server.

输入参数echo

prism_help

How to use Prism

Returns connection instructions: how to set the upstream MCP server (X-Prism-Upstream header or ?upstream= query param), the query-param config keys for header-less clients, how destinations and the borrowed-token model work, and example client configs. Start here if you are an agent discovering Prism for the first time.

无需输入参数。

版本历史

1
  1. v1.0.0最新Sep 27, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。