Skip to main content

Mount an MCP server on a hayate app: Streamable HTTP transport bridging the official python-sdk

Project description

hayate-mcp

Mount an MCP server into a hayate app — a Streamable HTTP transport that bridges the official MCP Python SDK to WHATWG Request/Response. The @hono/mcp architecture, in Python.

Status: alpha (0.1.x). The transport serves MCP Inspector, Claude Code, and the official SDK client today (single-JSON responses; the optional GET SSE stream and Workers Durable Object sessions land in 0.2). The internal design memo (Japanese, per project convention) lives in DESIGN.md.

from mcp.server.lowlevel import Server   # official SDK — define your tools here
from hayate import Hayate
from hayate_mcp import McpMount

server = Server("my-tools")
# … @server.list_tools() / @server.call_tool() …

app = Hayate()
McpMount(server, path="/mcp").register(app)   # that's the whole integration

Serve it with any ASGI server (uvicorn server:app), then connect:

npx @modelcontextprotocol/inspector --cli http://127.0.0.1:8000/mcp --transport http --method tools/list
claude mcp add my-tools --transport http http://127.0.0.1:8000/mcp

What it implements

Verb Behavior
POST JSON-RPC request → single JSON response (initialize mints an Mcp-Session-Id); notifications → 202
DELETE Explicit session termination
GET 405 until v0.2 (optional server-initiated SSE stream)

Plus spec-mandated Origin validation (DNS-rebinding defense) and an in-memory session store with idle eviction. Protocol handling — capabilities, tool dispatch, versioning — stays entirely in the official SDK: this package is transport only, so spec revisions ride SDK upgrades.

Why

  • Python is MCP's largest ecosystem, yet mounting an MCP endpoint inside your own web app still goes through ASGI plumbing with known friction.
  • Cloudflare's remote-MCP story (Agents SDK, McpAgent) is TypeScript-only — MCP on Python Workers is unclaimed territory. hayate's SSE and Durable Object support are already verified on workerd, and the SDK itself imports and runs there (docs/research/pyodide.md).

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hayate_mcp-0.1.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hayate_mcp-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file hayate_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: hayate_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for hayate_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d6115547163122b27540931fac2a8328a5e9462ba24d3bac5e87b5ea3aca0a7d
MD5 2e9644ce38359ec3e3c76700bbee6030
BLAKE2b-256 717458480cb57c4c8aba880f1977afe948d6610649b32eec55cac424083edd66

See more details on using hashes here.

Provenance

The following attestation bundles were made for hayate_mcp-0.1.0.tar.gz:

Publisher: release.yml on hayatepy/hayate-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hayate_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hayate_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for hayate_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ee001a29ba6754e1092ff34e1bff1f82a3f6a3126a0ee16dd422efa7ea876f91
MD5 f33be16e88fd84ae09f6ea2a9cf95d38
BLAKE2b-256 43c85cdee61bfe6d00c6e76f675f2c3abeaa08c45a25091b6836855c6ce340c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for hayate_mcp-0.1.0-py3-none-any.whl:

Publisher: release.yml on hayatepy/hayate-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page