Skip to content

feat(agent-connect): mount MCP-over-HTTP at /mcp on the dashboard#16

Merged
Coding-Dev-Tools merged 3 commits into
mainfrom
feat/mcp-over-http
Jul 16, 2026
Merged

feat(agent-connect): mount MCP-over-HTTP at /mcp on the dashboard#16
Coding-Dev-Tools merged 3 commits into
mainfrom
feat/mcp-over-http

Conversation

@Coding-Dev-Tools

Copy link
Copy Markdown
Owner

No description provided.

MCP-native agents (Claude Code, Cursor, ...) point one URL at the cloud instance
(https://team.engraphis.com/mcp) with a per-user bearer token and reuse the same v2
store the dashboard reads — no local install. Team-gated (402) + member-authed (401),
exactly like /api/remember.

- mcp_server: set_service(svc) injects the dashboard's MemoryService so the MCP tools
  share ONE writer (no second SQLite connection -> no WAL lock contention).
- dashboard_app: build the streamable-http ASGI app up front and give the app a lifespan
  that initializes the MCP session manager (a mounted sub-app's own lifespan does not run
  in Starlette -> 'Task group is not initialized'); mount at /mcp with the endpoint at
  '/' inside the sub-app so the prefix lines up. The mcp import + session-manager build
  are fully inside a try so the dashboard still starts if the mcp extra is absent
  (MCP mount is genuinely optional). Reset _session_manager per create_app() so multiple
  apps in one process (tests) each get a fresh, runnable instance (run() is once-per-instance).
- _auth_gate: protect /mcp (Team license 402 + member token/cookie 401) before the
  existing /api/* logic; disable MCP's DNS-rebinding host allowlist on the mounted
  instance (default localhost-only would 421 a real domain like team.engraphis.com; the
  dashboard gate is the real auth boundary; standalone mcp_server_http is unaffected as
  its own process).
- v2_team.connect-info: mcp_over_http + mcp_url now reflect whether /mcp is mounted.
- docs/AGENT_CONNECT.md updated (/mcp now live + config snippet); CHANGELOG.
- tests/test_agent_connect_mcp.py: 5 tests (401, 402, handshake+tools/list,
  write-shares-dashboard-store, connect-info reports /mcp). Suite green (one pre-existing
  flaky inspector test fails under load but passes in isolation, on main too).
@Coding-Dev-Tools Coding-Dev-Tools added the needs-rework Council gate requires rework this PR label Jul 15, 2026

@Coding-Dev-Tools Coding-Dev-Tools left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Pre-PR Code Review — BLOCK (failing CI)

Verdict: BLOCK — do not merge until CI is green.

The MCP-over-HTTP feature design is sound and security-conscious (Team-gated 402, per-user bearer auth, session→owner binding, role re-evaluation per request, DNS-rebinding guard preserved, shared single-writer MemoryService). Tests cover auth/role/host/session paths well.

However, CI is RED on this PR (Python 3.10/3.11/3.12 test + lint (full offline stack)), while main is fully green (7/7). Exactly one test fails, and it is introduced by this PR:

FAILED tests/test_agent_connect_mcp.py::test_mcp_requires_team_license_402
AssertionError: {detail:{error:Team

@Coding-Dev-Tools Coding-Dev-Tools added council-approved Council gate approved this PR (APPROVE / APPROVE_WITH_NITS) and removed needs-rework Council gate requires rework this PR labels Jul 16, 2026
@Coding-Dev-Tools Coding-Dev-Tools merged commit b561000 into main Jul 16, 2026
18 of 21 checks passed
@Coding-Dev-Tools Coding-Dev-Tools deleted the feat/mcp-over-http branch July 16, 2026 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

council-approved Council gate approved this PR (APPROVE / APPROVE_WITH_NITS)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant