Support the MCP 2026-07-28 specification ("MCP 2.0") - #24
Open
javabudd wants to merge 5 commits into
Open
Conversation
Upgrade to FastMCP 4, the first release implementing the 2026-07-28 MCP revision. The server now answers server/discover and tools/list with no initialize handshake and no Mcp-Session-Id, and still serves handshake-era clients on 2025-11-25 from the same /mcp endpoint, so the xAI hosted MCP client used by test_grok_mcp.py keeps working unchanged. - Pin fastmcp>=4.0.0b1 and swap httpx for httpx2, which FastMCP 4 uses. The X API client and all four event hooks (OAuth1 signing, comma-joined array query params, request/response logging) move across unchanged. - Drop the FASTMCP_EXPERIMENTAL_ENABLE_NEW_OPENAPI_PARSER passthrough; that setting no longer exists in FastMCP 4. - Advertise a server version and 2.0 cache hints on tools/list and server/discover. The tool set is derived from the OpenAPI spec once at startup and is immutable for the life of the process, so it is genuinely cacheable. Tunable via MCP_CACHE_TTL (default 300s). - Document the protocol behavior, bump the stated Python floor to 3.10 to match FastMCP 4, and correct a stale README line about the spec being fetched from api.twitter.com. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Support the MCP 2026-07-28 specification ("MCP 2.0")
The webhook exclusion in should_exclude_operation only matched "/webhooks"
in the path, so six activity subscription operations shipped as tools even
though the README stated webhook endpoints were excluded:
getAccountActivitySubscriptionCount GET /2/account_activity/subscriptions/count
getActivitySubscriptions GET /2/activity/subscriptions
createActivitySubscription POST /2/activity/subscriptions
deleteActivitySubscriptionsByIds DELETE /2/activity/subscriptions
updateActivitySubscription PUT /2/activity/subscriptions/{subscription_id}
deleteActivitySubscription DELETE /2/activity/subscriptions/{subscription_id}
Only one of these lives under /2/account_activity/; the other five are under
a separate /2/activity/subscriptions family tagged Activity, which is why the
existing path check missed them. The /2/account_activity/webhooks/... variants
were already excluded because they do contain "/webhooks".
These configure where X pushes webhook events rather than reading or writing
content, so they are not useful as agent tools.
Exclude them by path and by tag, mirroring the existing stream/webhooks
structure. Verified against the live spec: 146 -> 140 operations, removing
exactly those six with no collateral damage. The Activity and Account Activity
tags map to precisely these ten subscription operations and nothing else, so
the tag rule cannot over-exclude.
Also drop the four now-invalid entries from the README allowlist table and
update the exclusion notes.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Exclude activity subscription endpoints from the tool list
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.
Upgrade to FastMCP 4, the first release implementing the 2026-07-28 MCP revision. The server now answers server/discover and tools/list with no initialize handshake and no Mcp-Session-Id, and still serves handshake-era clients on 2025-11-25 from the same /mcp endpoint, so the xAI hosted MCP client used by test_grok_mcp.py keeps working unchanged.