feat(mcp): optional MCP OAuth for Claude-compatible connectors#59
Draft
ChrisCoder9000 wants to merge 70 commits intodevelopmentfrom
Draft
feat(mcp): optional MCP OAuth for Claude-compatible connectors#59ChrisCoder9000 wants to merge 70 commits intodevelopmentfrom
ChrisCoder9000 wants to merge 70 commits intodevelopmentfrom
Conversation
feat: add CRUD support for entities and relationships
Featured graph consolidation layer (5th agent)
improved neighbors retrieval migrated neighbors into synergies
Development
fix(neo4j): added safe parsing
Development
Development
Development
fix(embeddings): logging error
build(Dockerfile): fixed poetry version
Development
fix(Dockerfile): install poetry deps
chore(readme): top banner
Development
ci(deps): added installation + import of spacy and other deps with po…
Development
fix(retrieval): fixed missing brain_id relationships retrieval
Development
fix(agent base): fixed many iterations and tool calls
chore(readme): urls
fix(retrieval): text chunks retirieval
bump version 2.9.2-dev
fix(files ingestion): dynamic webhook url from request
fix(doc ingestion): header url extraction
bump version 2.9.4-dev
fix(build): added deps on container build time not startup anymore
bump version v2.9.5-dev
feat(mcp): restricted to pat-only brains
bump version v2.9.6-dev
fix(brain_id): mismatch between middleware and route args
bumo version 2.9.7-dev
Development
Development
chore(readme): updated layout
chore(readme): fixed context example
Development
Development
Development
bump version 2.11.7-dev
Enable MCP spec OAuth when MCP_OAUTH_ISSUER_URL is set: dynamic client registration, protected resource metadata via FastMCP, consent page that binds BrainPAT to opaque access tokens, and Bearer-to-PAT resolution for existing tool authorization. Document env vars in example compose. Co-authored-by: Christian <ChrisCoder9000@users.noreply.github.com>
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This adds optional OAuth for the BrainAPI MCP HTTP service so MCP clients (including Claude’s remote MCP connector) can follow the MCP authorization spec: protected resource metadata, dynamic client registration, PKCE authorization code flow, and
Authorization: Beareraccess tokens.When OAuth is disabled (default, no env vars), behavior stays the same: MCP accepts
BrainPATorAuthorization: Bearer <brainpat>as today.How to enable
Set
MCP_OAUTH_ISSUER_URLto the public HTTPS base URL of the MCP service (same host/port as uvicorn, no path), for examplehttps://mcp.example.com.Optional:
MCP_RESOURCE_SERVER_URL: canonical MCP resource URL (defaults to{issuer}/mcp). Must match what clients send as the RFC 8707resourceparameter.MCP_OAUTH_SCOPES: space-separated scopes (defaultbrainapi).MCP_OAUTH_ACCESS_TOKEN_TTL,MCP_OAUTH_REFRESH_TOKEN_TTL,MCP_OAUTH_AUTH_CODE_TTL: TTLs in seconds.MCP_OAUTH_SERVICE_DOCUMENTATION_URL: URL for OAuth server metadataservice_documentation.User flow
/.well-known/oauth-authorization-server,/register,/authorize,/token)./authorize, the user is redirected to/mcp-oauth/consentto enter BrainPAT; on success an auth code is issued and the client exchanges it for tokens.guard_brainpat: Bearer access tokens are mapped back to the BrainPAT supplied at consent.Notes
example-docker-compose.yamldocuments the new env vars for the MCP service.