Repository navigation
Description
Problem or use case
#841 found two URLCode-owned MCP protocol surfaces: packages/core/src/mcp.ts for local authoring, and packages/mcp/src/mcp.ts for application HTTP. Keeping both dispatch/transport implementations grows maintenance unrelated to URLCode's agent workflow. #626 addressed feature scope, not upstream SDK ownership.
Proposed behavior and alternatives
Use the official TypeScript SDK's selected published stable line for both surfaces, retaining URLCode's actual tool implementations, declared exposure and authority checks. Inspect the pinned SDK's native schema/runtime integrations before writing bridging validators or framework wrappers. SDK availability does not authorize every optional protocol capability.
Split implementation into focused PRs: local stdio authoring first, application HTTP next. Keep one shared operation descriptor/discovery source with the schema and package work; do not copy tool schemas into a second catalog. Protocol negotiation/error serialization/transport parsing should have one upstream owner after completion. No legacy protocol compatibility shim is required solely for historical URLCode clients.
Acceptance:
- A real upstream SDK client initializes, lists and invokes selected authoring tools over stdio. Both successful output and bounded input/error/cancellation cases are checked.
- Inspection cannot execute application/host modules or mutate a project unless the established explicit mode permits it. Read/write tool separation, revision approval boundaries and exact validation context ([Request]: Make installed authoring validation context executable and discoverable #834) remain visible.
- Application HTTP advertises only declared tools/resources/prompts. Verify request IDs, origin/admission, schema/output errors, cancellation/backpressure and session/stream behavior for every advertised target; do not add remote identity/token machinery as part of this replacement.
- Select and test the new supported protocol/feature set rather than attempting old-version parity. Node comes first; unsupported target combinations refuse instead of silently buffering/dropping streams.
- Test browser/HTTP authentication and MCP caller mapping separately. A browser session, a service token and a local authoring process are distinct actors; no invented user session or wholesale cookie forwarding.
- Remove replaced handwritten protocol paths in both locations and update packed examples, docs and generated guidance in the same changes. Measure dependency bytes and startup cost; source deletion alone is not the result.
Non-goals: exposing every provider as tools, an MCP gateway product, remote tool marketplace, sampling/task expansion, a custom OAuth server or a universal Express/Fastify shim. If a selected upstream transport genuinely needs framework glue, use the narrow documented host integration and record why.
Code areas: core mcp.ts/mcp-authoring.ts and existing tool handlers; packages/mcp; shared descriptors, schemas and integration tests. Follow verify/package checks and declare supported targets truthfully. Independent deployment/security assessment is not implied.
Sources: https://github.com/modelcontextprotocol/typescript-sdk ; https://ts.sdk.modelcontextprotocol.io/v2/advanced/schema-libraries . The SDK currently documents v2 as stable with v1 maintained separately; choose exact versions and applicable notices at implementation time. No SDK replacement has yet been run inside URLCode.
Activity
jimhoyd commentedon Sep 28, 2026
From the #843 proof (PR: #848): a minimal raw JSON-RPC stdio client initialized
urlcode mcp --project app --allow-authoring --host-file host.mjs --origin ...(negotiated2025-06-18, 43 tools) and invokedget_extensions,plan_feature,summarize_yaml_change,validate,run_validateandrun_test. Read-only tools worked against the Better Auth site. The runners refuse the site's operator-granted binding because the server accepts no--policy(tracked with the other gaps on #834). No SDK client was used for this run, so it is not evidence for or against the SDK migration; it is a ready-made scenario for its "real client" acceptance test.jimhoyd commentedon Sep 28, 2026
Stage 1 (local stdio authoring) is in #850:
@modelcontextprotocol/server2.1.0 now owns lifecycle, framing, version negotiation and JSON-RPC errors; URLCode keeps tools, Ajv argument checks, in-order calls and the 1 MiB bounds. An official@modelcontextprotocol/clienttest covers success, argument errors and cancellation.Findings for the remaining work: the SDK's stdio transport closes on stdin end and drops later replies, spins forever on string chunks, and dispatches
tools/callconcurrently; URLCode needed ~25 lines of glue for those, so owned lines did not shrink (222 to 230). Footprint +15.7 MiB installed, about 36 ms import. Still open here: stage 2 (packages/mcpapplication HTTP) and deleting the legacy tool-name aliases.Run the authoring MCP server on the official MCP SDK (#846, stdio) (#850
jimhoyd commentedon Sep 28, 2026
Stage 2 (application HTTP,
packages/mcp) is #852: the SDK's statelesscreateMcpHandlerserves every request; sessions, the GET stream, replay and pagination are deleted;packages/mcp/src1,058 -> 556 lines. Official@modelcontextprotocol/clienttests cover both surfaces (stdio in #850, Streamable HTTP with and without streamed progress here). Legacy authoring aliases are removed in #851. With #852 merged, every acceptance item here is covered except Windows runs of the new tests; I will close this issue then.feat(mcp): serve the application MCP server with the official SDK (#846…
jimhoyd commentedon Sep 28, 2026
Done: #850 (authoring stdio on the official SDK), #851 (legacy aliases removed) and #852 (application HTTP on the SDK, sessions deleted) are merged. Both handwritten protocol stacks are gone; official SDK clients test both surfaces. Not yet run on Windows by these new tests; CI's Windows legs cover them on the next release/dispatch run.