Skip to content

[v0.8 MCP 1/4] establish generic MCP transport foundation - #1175

Open
sethkarten wants to merge 10 commits into
mainfrom
v080/mcp
Open

[v0.8 MCP 1/4] establish generic MCP transport foundation#1175
sethkarten wants to merge 10 commits into
mainfrom
v080/mcp

Conversation

@sethkarten

@sethkarten sethkarten commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Phase 1 / 4 — MCP transport foundation

Current head: c374ca52d9eabbdcec26b3dda733b9bc35fa22c1
Branch/base: v080/mcpmain

Scope

Establishes the generic HTTP MCP transport foundation only:

  • anonymous HTTP servers are usable without credentials unless explicitly disabled;
  • authenticated bearer credentials override a static Authorization header, while anonymous servers preserve configured headers;
  • streamable HTTP uses the MCP SDK client factory and its timeout defaults;
  • enabled: false is a hard gate before URL fallback, credential resolution, imports, or transport creation;
  • disabled configuration raises McpDisabled with settings + /reload remediation, distinct from credential-only NotEnabled.

M01 commands, OAuth native secret storage, project declaration execution, and later MCP phases are intentionally excluded.

Reconciliation and fixes

  • The branch was append-only reconciled with live main in merge ef91d500010beab85e8aa4bf14ec297e439a7f81; its incremental diff against that main parent is exactly the accepted eight-path foundation delta, with no dependency-consolidation drift.
  • It was append-only reconciled again with the v0.7.2 main tip in merge bf02700b0a6c1f1caa7d42eed86dca9c6b34cad8; the incremental diff remains exactly the nine-path foundation/error-taxonomy delta with release metadata preserved.
  • Macroscope thread r3753793711 (disabled anonymous transport bypass) was fixed, replied to, and resolved.
  • Cursor Bugbot thread r3760580996 (incorrect login guidance for disabled servers) was fixed by e6071221dcaeabe562c3e882fc25a729d91923d9, replied to, and resolved.

Validation

  • Changelog-only append c374ca52d9eabbdcec26b3dda733b9bc35fa22c1: git diff --check passed. Its diff from bf02700b0a6c1f1caa7d42eed86dca9c6b34cad8 is exactly two deletions in packages/coding-agent/CHANGELOG.md; the 0.7.2-and-older release content is unchanged.
  • Current-head GitHub CI has launched and is pending (the CodeQL jobs are queued); no current-head green claim is made.
  • Foundation validation at bf02700b0a6c1f1caa7d42eed86dca9c6b34cad8: focused host regression 16/16; focused runtime disabled-anonymous, disabled-credentialed, and lazy McpDisabled export regressions 3/3; TypeScript tsgo --noEmit and git diff --check passed during reconciliation.
  • Independent read-only reviews accepted the live-main reconciliation and the McpDisabled append with no code blockers.

Review status

Ready for human review. The PR remains scoped to phase 1 and targets main; it is not a merge or readiness claim for S01/M02/M03/ACP-MCP.

Note

Establish generic MCP transport foundation with anonymous HTTP server support

  • McpManager.isAuthed now returns true for integrations with no OAuth or bearerTokenEnvVar configured, treating them as anonymous servers; the mcp.config response gains explicit enabled and requiresAuth flags.
  • Introduces McpDisabled exception (exported from rlm) to distinguish explicit host disablement from NotEnabled, raised before any network or auth activity.
  • McpIntegration._open_session in mcp_base.py skips bearer token resolution when requiresAuth is false; when auth is required, the bearer token is appended last so it overrides any static Authorization header.
  • Switches the HTTP transport client to the MCP SDK factory (create_mcp_http_client) to inherit SDK timeout defaults, fixing premature ReadTimeout errors on long SSE reads.
  • Behavioral Change: anonymous MCP integrations are now enabled by default unless explicitly disabled; hosts on older versions without requiresAuth default to requires_auth=True for backward compatibility.

Macroscope summarized c374ca5.


Note

Medium Risk
Changes MCP connection, auth gating, and HTTP client setup in the kernel; behavior is contract-tested and backward-compatible for missing requiresAuth, but misconfiguration could still affect integration connectivity.

Overview
Phase 1 MCP transport foundation so kernel McpIntegration skills can talk to remote HTTP MCP servers without new agent tools.

The host (McpManager) treats HTTP entries with neither oauth nor bearerTokenEnvVar as connectable without credentials, still honors enabled: false, and extends mcp.config with enabled and requiresAuth so the kernel gates before URL fallback or transport.

The runtime adds McpDisabled (settings + /reload vs login), resolves connection via _resolve_connection_config, skips bearer injection when requiresAuth is false (keeping static headers, including non-Bearer Authorization), and uses the MCP SDK create_mcp_http_client on the http_client transport path to avoid short read timeouts on long tool calls. Missing requiresAuth from older hosts still defaults to authenticated.

Docs/changelog describe anonymous servers, the new exception, and a phase-1 contract; focused TS/Python tests cover anonymous enablement, disabled gating, and header/timeout behavior.

Reviewed by Cursor Bugbot for commit c374ca5. Bugbot is set up for automated code reviews on this repo. Configure here.

fpdy and others added 5 commits August 10, 2026 14:30
The http_client branch built a bare httpx.AsyncClient, which uses httpx's
default 5s read timeout. Long MCP tool calls (e.g. browser-rendered
fetch_content) failed with ReadTimeout before the server replied.

Pass headers into mcp.shared._httpx_utils.create_mcp_http_client instead so
the transport gets the SDK defaults (30s / 300s SSE read) on an httpx2 client.

(cherry picked from commit 2df5cf3)
Comment thread packages/coding-agent/src/core/mcp/mcp-manager.ts
@sethkarten

Copy link
Copy Markdown
Contributor Author

v0.8 stack checkpoint — 2026-08-11 15:50 UTC

This draft PR remains the GitHub MCP stack surface and will be kept current rather than leaving the active work local-only.

  • Parent Core candidate: 41ef592f8474a1d67b25ee6e495df24be3ab804e (feat(coding-agent): finalize v0.8 Core lifecycle and project MCP hardening #1224), exact CI green.
  • Active MCP reconstruction is uncommitted while validation continues. Typecheck, changed-path Biome, OAuth 7/7, and the neutral recursion suite now pass 99/99 after restoring real dispatcher cell-source context in direct comm tests.
  • Still required before this branch advances: remaining MCP TypeScript/Python suites, broad security review, clean restack onto Core, and an append-only/non-force update of this PR branch.
  • Production secret storage remains fail-closed pending an app-bound signed native/XPC helper; JXA, /usr/bin/security, plaintext, and ambient credential fallbacks remain rejected.

This is a progress checkpoint, not a readiness claim.

@sethkarten
sethkarten marked this pull request as ready for review August 11, 2026 18:12

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ef91d50. Configure here.

Comment thread prime-agent-runtime/src/rlm/mcp_base.py Outdated
Comment thread packages/coding-agent/CHANGELOG.md Outdated
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.

3 participants