Skip to content

Support the MCP 2026-07-28 specification ("MCP 2.0") - #24

Open
javabudd wants to merge 5 commits into
xdevplatform:masterfrom
javabudd:master
Open

Support the MCP 2026-07-28 specification ("MCP 2.0")#24
javabudd wants to merge 5 commits into
xdevplatform:masterfrom
javabudd:master

Conversation

@javabudd

Copy link
Copy Markdown

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.

javabudd and others added 3 commits June 3, 2026 16:35
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")
@CLAassistant

CLAassistant commented Jul 31, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

javabudd and others added 2 commits August 2, 2026 11:00
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants