Files
alkhttp/tasks/adapters/mcp.md
T
glm-5.3-flash 63dc4b6d06 docs: implementation plan (TTY precedents folded in); task decomposition (17 tasks)
Plan updated with the alknet-tty findings: the drainer pattern
(single ordered writer) makes outbound chunk-boundary parsing sound;
TestStdinSink's try_send→Full→Pending is the inbound backpressure
precedent; OQ-01(a) now cites the reference.

Task graph (taskgraph-validated, 17 tasks, 6 generations, no cycles):
- tasks/server/: core-types, auth, healthz-decoy, adapter
- tasks/gateway/: dispatch, routes, publish
- tasks/websocket/: byte-adapter (research POC), upgrade-session, overlay-ops
- tasks/adapters/: from-openapi, from-jsonschema, to-openapi, from-wss, mcp
- tasks/client/: http-host
- tasks/infra/: integration-suite (phase 4)

Critical path runs through server core → adapter → WS session →
overlay tests → integration suite. High-risk tasks are the three WS
tasks, de-risked by the ws-byte-adapter POC blocking upgrade-session.
2026-08-28 06:05:45 +00:00

1.6 KiB

id, name, status, depends_on, scope, risk, impact, level, tags
id name status depends_on scope risk impact level tags
adapter-mcp from_mcp + to_mcp (mcp feature) pending
client-http-host
gateway-routes
broad medium component implementation
adapters
mcp
phase-3

Description

Port both MCP adapters from /workspace/@alkdev/alknet/crates/alknet-http/src/adapters/{from_mcp/, to_mcp.rs} behind the mcp feature (rmcp, streamable HTTP only — ADR-037). from_mcp: tools/list discovery, per-tool HandlerRegistration (Mutation, HandlerKind::Once, FromMCP leaf), structuredContent-preferred output handling, ContentBlock-union fallback, isError→CallError. to_mcp: 4 fixed gateway tools (search/schema/call/batch — Sub AND Pub excluded), StreamableHttpService into axum under /mcp with bearer middleware. Shared dispatch spine with to_openapi via GatewayDispatch.

Acceptance Criteria

  • Both adapters behind mcp; default features compile without rmcp
  • from_mcp round-trip against a mock MCP server (tools/list, tools/call, structured + content-block outputs)
  • to_mcp: 4 tools listed; call dispatch filtered by ACL; Pub/Sub ops excluded
  • stdio transport not present anywhere (dependency audit)
  • cargo test --all-features passes

References

  • docs/architecture/http-mcp.md
  • docs/architecture/decisions/037-mcp-stdio-transport-exclusion.md, 041-mcp-tool-gateway-pattern.md
  • Old source: /workspace/@alkdev/alknet/crates/alknet-http/src/adapters/from_mcp/, to_mcp.rs, tests/from_mcp_integration.rs

Notes

Agent fills during implementation.

Summary

Agent fills on completion.