Conversation
In preparation for contribution to the MCP SDk
Test Failure AnalysisSummary: Test Root Cause: The test creates an OAuthProxy instance without providing a The stack trace shows the timeout occurs at: File "diskcache/core.py", line 623, in _con
con = self._local.con = sqlite3.connect(Suggested Solution: Provide an isolated in-memory storage for this test to avoid SQLite file contention:
Example fix: from key_value.aio.stores.memory import MemoryStore
async def test_callback_error_returns_html_page(self):
"""Test that OAuth callback errors return styled HTML instead of data: URLs."""
from unittest.mock import Mock
from starlette.requests import Request
from starlette.responses import HTMLResponse
from fastmcp.server.auth.oauth_proxy import OAuthProxy
from fastmcp.server.auth.providers.jwt import JWTVerifier
# Create a minimal OAuth proxy with isolated storage
provider = OAuthProxy(
upstream_authorization_endpoint="https://idp.example.com/authorize",
upstream_token_endpoint="https://idp.example.com/token",
upstream_client_id="test-client",
upstream_client_secret="test-secret",
token_verifier=JWTVerifier(
jwks_uri="https://idp.example.com/.well-known/jwks.json",
issuer="https://idp.example.com",
audience="test-client",
),
base_url="http://localhost:8000",
jwt_signing_key="test-signing-key",
client_storage=MemoryStore(), # Add this line
)
# ... rest of testDetailed AnalysisThe test was added/modified in this PR and exposed a Windows-specific issue that wasn't caught because:
Other tests in the file use the Related Files
|
Relicense from Apache 2.0 to MIT
FastMCP's code will be merged into the main MCP codebase, which is MIT licensed. To facilitate that, I am relicensing the codebase as MIT.
This will be part of a new 0.4 release for clarity.