Access mcp server#443
Conversation
| # When CF (or your provider) starts emitting scope claims, this | ||
| # fallback never fires and the token controls scope per session; | ||
| # the value here becomes inert. | ||
| MCP_FALLBACK_SCOPES: str = "read_all,create_requests" |
There was a problem hiding this comment.
Should this default to read_all instead of both scopes?
There was a problem hiding this comment.
Could go either way on this but given that tool use is still gated on whether or not the user has the permissions to do an action (eg. creating a role request requires them to own a role) I was leaning towards leaving both scopes as the default
| if err: | ||
| return _error(err) | ||
| db = _db_shim.session | ||
| query = ( |
There was a problem hiding this comment.
Since most of this code is copied from the api/routers I wonder if we can abstract it where both the router and MCP have a shared method to call maybe defined in api/views or something?
There was a problem hiding this comment.
I think it'd be possible to create a top level layer for query construction that would remove some duplicate code and reduce the possibility of drift but since that would touch the routers as well I'm inclined to say that should be left as a follow up. This PR is already massive
Add embedded MCP server (off by default)
Adds an optional MCP server at /mcp, gated behind ENABLE_MCP=False. Lets any MCP-compatible LLM client (Claude Code, Cursor, Zed, OpenAI clients, MCP Inspector, self-hosted models) read Access data and submit access/role/group requests on behalf of the authenticated user.
What's added
Tool surface (21 tools, 1 prompt)
Three-layer authorization
Scopes never grant permissions. MCP tools can do strictly less than what the same user can do via REST.
Open-source posture
Operator notes
TODO