feat(auth): replace stub bearer with LIME OAuth 2.1 + agent identity - #1
Open
Mawyxx wants to merge 1 commit into
Open
feat(auth): replace stub bearer with LIME OAuth 2.1 + agent identity#1Mawyxx wants to merge 1 commit into
Mawyxx wants to merge 1 commit into
Conversation
- Removes MCP_HTTP_AUTH_TOKEN stub - Adds LIME JWT verification via lime-mcp-server-sdk - Every request carries agent_id from JWT sub claim - Full audit trail: who called which tool - Adds auth/ module with LimeMcpTokenVerifier and current_agent_id() - HTTP transport now uses native FastMCP OAuth RS - Legacy mode for backward compatibility (1 release) - Tests: 27/27 passing - Docs: README, .env.example, AUTH.md, UPSTREAM_PR.md Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Problem
MCP_HTTP_AUTH_TOKEN).subidentity).Solution
token_verifier+AuthSettings+mcp.run(transport="streamable-http").lime-mcp-server-sdk.auth/package: settings, verifier adapter, agent context, factory.agent_id(JWTsub, never raw JWT).Breaking changes
MCP_HTTP_AUTH_TOKENdeprecated; production usesMCP_AUTH_MODE=lime.MCP_RESOURCE_SERVER_URLrequired in lime mode.http_auth_legacy.py).Test plan
pytest tests/ -v— full matrix indocs/AUTH_TEST_MATRIX.md(27/27 passing)GET /.well-known/oauth-protected-resourcelime-agents-sdk): JWT from LIME AS →list_tools+call_tool search_docs→ server logtool=search_docs agent_id=<sub>./scripts/verify_checklist_live.py— 20/20 automated checks (none / legacy / lime + live JWT)Production deploy checklist
Agent documentation
See
docs/AUTH.md— two integration paths:lime-agents-sdk):list_tools/call_toolget_mcp_access_token()+Authorization: BearerDeveloper API for per-request identity:
Files changed
src/byteask_embedded_mcp/auth/*server.py,config.pyhttp_auth.py,http_auth_legacy.pyobs.py(agent_id in document requests)tests/test_auth.pydocs/AUTH*.md,README.md,.env.example,server.jsonNon-goals (follow-up PRs)