broker

broker

Enables stateless, handle-based tool interaction over the 2026-07-28 MCP protocol, supporting multi-round-trip requests, cacheable results, and an audited execution trail.

Category
访问服务器

README

Sentinel

A stateless MCP server, and the conformance harness that grades it.

ci conformance

On 28 July 2026 the Model Context Protocol shipped the largest breaking revision in its history: it converted MCP from a stateful, session-based, bidirectional protocol into a stateless request/response protocol. Sessions are gone. The initialize handshake is gone. server/discover is mandatory. Server-initiated requests were replaced wholesale by Multi Round-Trip Requests. CacheableResult became required. Sampling, Roots, Logging, HTTP+SSE transport and OAuth Dynamic Client Registration were all deprecated on a twelve-month clock.

Every MCP server in the wild was written against the old idioms.

broker/ A Go MCP server built natively on 2026-07-28 — stateless, handle-based, MRTR-only, audited.
harness/ sentinel, a conformance harness that scans any MCP server, grades it against the normative requirements with a spec citation per rule, and inventories its deprecated-feature debt.

They are coupled deliberately: the harness's credibility comes from grading a server that is not its own, and the server's credibility comes from being graded. The harness never imports server internals and runs against any endpoint URL.


The two scans

$ sentinel scan --endpoint http://localhost:9000/mcp --gate must     # an unmigrated server
MUST: 2 pass, 26 fail, 5 indeterminate, 0 n/a
exit 1

$ sentinel scan --endpoint http://localhost:8080/mcp --gate must     # broker
MUST: 28 pass, 0 fail, 5 indeterminate, 0 n/a
SHOULD: 2 pass, 0 fail, 0 n/a
exit 0

A failure names the rule, what was observed, what to change, and the clause it comes from:

FAIL  MCP/2026-07-28/MUST/header-body-mismatch-rejected
      A header disagreeing with the body is rejected with -32020
      observed:    a request whose Mcp-Method header said tools/list while its body
                   called tools/call was SERVED; a gateway routing on the header
                   authorized a different request than the one that ran
      remediation: Compare Mcp-Method and Mcp-Name against the JSON-RPC body and return
                   -32020 HeaderMismatch when they disagree. This is what makes the
                   headers BINDING…
      spec:        https://modelcontextprotocol.io/specification/2026-07-28/…

And the deprecation debt, with removal windows:

$ sentinel deprecations --endpoint http://localhost:9000/mcp
6 deprecated feature(s) in use

  IN USE  Roots  (SEP-2577)
          deprecated:  2026-07-28
          removable on or after 2027-07-28 (10 month(s) from now)
          replace with: explicit tool arguments naming the paths a tool may touch

Limitations, stated plainly

Five MUST requirements cannot be verified black-box. sentinel reports them as INDETERMINATE — never as passes — excludes them from the gate, and prints them on every scan:

Rule Why a scan cannot settle it What would
token-audience-validated The harness cannot mint a token signed by your issuer, and a forged one is rejected for its signature — which proves nothing about the audience check. Mint one with your issuer and a different audience; confirm the refusal.
no-token-passthrough What a server sends to its own dependencies is invisible from the client side. Capture the server's egress during an authenticated call.
handle-possession-is-not-authentication Needs two authenticated principals; a scan has one. Mint a handle as one, present it as the other.
mrtr-retries-are-idempotent A duplicate retry that returns the right answer is indistinguishable from one that performed the effect twice and returned the right answer. Count the effect at its source, not in the reply.
invocations-are-audited An audit log is not exposed over MCP; a server claiming to keep one would be believed on its own word. Read the log and verify its chain.

A clean scan is not a clean bill of health. A harness that scored these as passes would be lying, and a tool that implied otherwise would be worse than no tool.

The broker implements all five, and proves it with tests that do have the access a scan lacks — TestTokenForAnotherAudienceRejected, TestInboundTokenNeverForwarded, TestCrossPrincipalHandleRefused, TestDuplicateRetryIsIdempotent, TestChainDetectsTampering. That is the point of shipping both: the scan says what it can see, and the server's own suite covers what it cannot.


Measurements

Regenerated by make measure; see MEASUREMENTS.md for the method behind each.

Measurement Result
MUST recall against the non-conformant fixture 100% (26 of 26 seeded violations)
False positives against the conformant fixture 0
tools/list determinism 1 distinct SHA-256 across 100 calls and 5 cold rebuilds
Manifest token count 2,032 tokens across 4 tools
concise vs detailed responses up to 49.3% fewer tokens
Scan wall-clock p50 ~50 ms, p95 ~125 ms

Recall's denominator comes from the fixture's own SEEDED_VIOLATIONS list, not from anything in the harness — a scanner supplying its own denominator would be grading its own homework — and a test asserts that list matches the violations tagged in the fixture's source, so it cannot quietly shrink.


Quick start

make up                      # postgres + broker + envoy + smokescreen + otel-collector
make check                   # golangci-lint, go test -race, ruff, mypy, pytest
make scan-broker             # grade the broker against its own harness
make scan-fixture            # grade an unmigrated server; expected to exit 1
make demo                    # the nine-step demo

Requires Go 1.23+, Python 3.12, uv ≥ 0.5 and Docker. No model API key is required anywhere — the broker serves tools, it does not call models, which is why CI is fast, free, and never flaky for a reason outside this repository.

Scanning your own server

uv run sentinel scan --endpoint https://your-server.example/mcp --gate must \
  --token "$TOKEN" --format sarif --out scan.sarif
uv run sentinel deprecations --endpoint https://your-server.example/mcp

Exit codes are a contract: 0 passed, 1 the target failed the gate, 2 the scanner could not run. CI needs to tell "the server is wrong" from "the scanner broke", so those are never conflated.

The SARIF renders natively in GitHub code scanning. Because a conformance finding is about a service rather than a file, pass --sarif-anchor <path> to choose the repo file annotations attach to; a scan of a third-party server has no such file and should use --format json.


What the broker demonstrates

  • Stateless. No session, nothing keyed by connection. Cross-call state is a server-minted handle bound to its principal, re-verified on every resolution — handles/resolve.go is the only place a handle becomes usable, and it returns one indistinguishable error for "does not exist", "not yours", "expired" and "revoked".
  • MRTR with exactly-once effects. requestState is AEAD-sealed with the tool name as additional authenticated data; the effect and its recorded result commit in one transaction; a duplicate retry replays the recorded result verbatim and performs zero further effects.
  • Deterministic manifest. Built once, sorted byte-wise, served as precomputed bytes.
  • The header contract, demonstrated rather than asserted. Envoy routes and authorizes on Mcp-Method / Mcp-Name with no body-parsing filter anywhere — a test parses the config and checks — and the broker rejects a body that disagrees with the headers. Routed by header, rejected by body check.
  • Audience validation. Exact-membership aud check; the inbound token is never carried onto the principal, so there is nothing to forward downstream even by accident.
  • An append-only, hash-chained audit log. Immutability is enforced by database grants rather than convention, and broker audit verify walks the chain and names the first break.

Documentation

  • docs/MIGRATION.md — what changed in 2026-07-28 and what it costs you, with the mistakes worth avoiding and a migration order that works.
  • docs/HANDOFF.md — the implementation specification (SN-HND-001).
  • docs/runbook.md — running, operating and debugging the stack.
  • docs/demo/README.md — the nine-step demo.
  • CLAUDE.md — the four rules and the single-source-file constraints.

Precedence

Where this repository and the MCP specification disagree, the specification wins and this repository is wrong.

Scope

This is the MVP tier of SN-PRD-001. Deliberately not here: OAuth beyond audience validation (CIMD, consent registry, scope step-up), subscriptions/listen, the tasks extension, MCP Apps, and rate limiting or tenant-isolation enforcement — the tenant_id columns exist throughout, the policy does not. See docs/HANDOFF.md §3.2 for why each is out and when it returns.

License

MIT — see LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选