Skip to content

feat(mcp): serve MCP over Streamable HTTP - #141

Open
recall704 wants to merge 1 commit into
sahenjp:mainfrom
recall704:feat/mcp-streamable-http
Open

recall704 wants to merge 1 commit into
sahenjp:mainfrom
recall704:feat/mcp-streamable-http

Conversation

@recall704

Copy link
Copy Markdown

Add rustxng mcp --http to serve the same tools at POST /mcp over the Streamable HTTP transport. stdio stays the default, so existing clients and the rustxng mcp CLI keep working unchanged.

Each Mcp-Session-Id gets its own McpServer, which keeps the read_page URL allowlist and page cache scoped to the conversation that produced the URLs.

Host headers are validated for DNS-rebinding protection: loopback is allowed by default, a concrete non-loopback bind allows its own address, and a wildcard bind refuses to start until RUSTXNG_MCP_ALLOWED_HOSTS names the public hosts.

Tests cover the HTTP session round trip through a real rmcp client, plus the host-list selection rules.

Problem and resulting behavior / 解決する問題と変更後の動作

Scope and compatibility / 範囲と互換性

Validation / 検証

  • Relevant offline tests or fixtures cover the behavior (Rust logic changes)
  • cargo fmt --all --check (Rust changes)
  • cargo test --all-targets (Rust changes)
  • cargo clippy --all-targets -- -D warnings (Rust changes)
  • Markdown lint and links (documentation changes)
  • Performance/ranking claims include reproducible before/after conditions and errors (if applicable)

Limitations / 残る制約

Contribution notes / 作成・レビューについて

Add `rustxng mcp --http` to serve the same tools at POST /mcp over the
Streamable HTTP transport. stdio stays the default, so existing clients and
the `rustxng mcp` CLI keep working unchanged.

Each Mcp-Session-Id gets its own McpServer, which keeps the `read_page` URL
allowlist and page cache scoped to the conversation that produced the URLs.

Host headers are validated for DNS-rebinding protection: loopback is allowed
by default, a concrete non-loopback bind allows its own address, and a
wildcard bind refuses to start until RUSTXNG_MCP_ALLOWED_HOSTS names the
public hosts.

Tests cover the HTTP session round trip through a real rmcp client, plus the
host-list selection rules.
@recall704
recall704 requested a review from sahenjp as a code owner November 14, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant