Files
ai-agent/backend/mcpserver/__init__.py
gabrielvidalandClaude Opus 5.5 c754d5981a feat(mcp): the hub as a remote MCP server with OAuth 2.1
POST /mcp (Streamable HTTP, stateless, JSON) runs the CLI's MCP tools
against the backend's own API over loopback as the connection's caller.
OAuth: RFC 9728/8414 metadata from MCP_PUBLIC_URL, open dynamic client
registration (capped, unapproved apps pruned), /oauth/authorize parks the
request (PKCE S256 required) for the PWA's /connect page, codes single-use,
1 h access + 90-day rolling refresh, everything hashed in /data/mcp.json.

The owner approves on the admin host (OwnerDep + same-origin) or by a
notify-ask push (Allow / Read only / Deny, capped); a guest with the new
users.json 'mcp' switch approves for themselves on the guest host, and
their calls carry X-AIA-MCP-User, a gate downgrade to the CLI's routes.
Conversations an app starts get meta.via; mcp_connected / mcp_revoked go
to the security log. Settings API: /api/mcp (owner), /api/me/ai-apps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 21:24:56 +01:00

0 lines
0 B
Python