refactor(keycardai-fastmcp): drop the keycardai-mcp dependency - #243
Merged
Conversation
Co-Authored-By: Larry Osakwe <larry@keycard.ai>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…old module path tests/keycardai/mcp/integrations/fastmcp/test_provider.py mirrored the pre-rename module layout. The file tests keycardai.fastmcp.provider, so it sits at tests/test_provider.py alongside test_access_context.py; the integration-style AuthProvider tests already live in tests/integration/test_auth_provider.py. Pure rename, no content change. 85 passed, coverage 85.29%.
Larry-Osakwe
approved these changes
Aug 27, 2026
Larry-Osakwe
left a comment
Contributor
There was a problem hiding this comment.
Verified: 17 re-exports repointed at their canonical keycardai.oauth modules, MCPServerError preserved as the OAuthServerError alias so class identity is unchanged, MissingContextError defined locally with FastMCP-correct guidance (from fastmcp import Context, and async def in the examples). __all__ unchanged. Lock drops 12 packages, 101 to 89, confirmed by name for keycardai-mcp, keycardai-starlette, aiosqlite, nanoid and aiohttp. CI ran the fastmcp suite: 85 passed, 85.29% coverage against a 60% gate.
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.
keycardai-fastmcpimported 19 symbols fromkeycardai.mcp; 17 were pure re-export shims ofkeycardai-oauth, which this package already depends on directly. Those now come from their canonical modules,MCPServerErrorstays the same alias (OAuthServerError), andMissingContextError— the only class actually defined inkeycardai-mcp— is defined locally inkeycardai/fastmcp/exceptions.py.__all__is unchanged.Resolution before/after
uv pip compileof the localpackages/fastmcploses 11 packages:Before (79 packages):
After (68 packages): the same list minus the 11 removed above.
Behavior change to be aware of
MissingContextErrorraised bykeycardai-fastmcpis now a different class fromkeycardai.mcp.server.exceptions.MissingContextError. Anyone catching thekeycardai-mcpclass around a FastMCP tool stops catching it; the documented path (from keycardai.fastmcp import MissingContextError) is unaffected, and both subclassOAuthServerError, soexcept MCPServerErrorstill catches it.User-visible fix
The default
MissingContextErrormessage told FastMCP developers to writefrom mcp.server.mcpserver import Context(both raise sites inprovider.pypass no message, so that was the guidance shipped today). Both branches now sayfrom fastmcp import Context.Verification
just build,just test-package fastmcp(85 passed),just check, andpytest --cov-fail-under=60(85.29%) pass.just typecheckfails identically onmain(715 diagnostics) and on this branch (607) —packages/fastmcpis outside the uv workspace, so the roottyenvironment cannot resolvefastmcp/keycardai.fastmcp; no new diagnostics come from this change.grep -rn "keycardai\.mcp" packages/fastmcp/is clean apart fromCHANGELOG.mdand one line inREADME.md, which documents the retiredkeycardai.mcp.integrations.fastmcpimport path for users migrating offkeycardai-mcp-fastmcp— historical prose, not an import, so it is left as-is.Link to Devin session: https://app.devin.ai/sessions/8b148bceda6344b691340a9ea7ea7523
Open in Devin Desktop: https://app.devin.ai/desktop/session/8b148bceda6344b691340a9ea7ea7523?variant=devin
Requested by: @Larry-Osakwe