Skip to main content

Unified MCP Streamable HTTP 2025-11-25 transport, OAuth 2.1 AS, lifecycle, install

Project description

mcp-core

Unified MCP Streamable HTTP 2025-11-25 transport, OAuth 2.1 Authorization Server, lifecycle management, install automation, and shared embedding daemon for the n24q02m MCP ecosystem.

mcp-core is the functional successor to the archived mcp-relay-core. All crypto, storage, OAuth, relay, and schema modules from mcp-relay-core ship under the same paths in mcp-core (1:1 superset), so downstream MCP servers can migrate with a pure import + dependency rename. See docs/migration-from-mcp-relay-core.md for the rename table.

Packages

Package Language Registry Install
packages/core-py Python 3.13 PyPI: n24q02m-mcp-core pip install n24q02m-mcp-core
packages/core-ts TypeScript / Node 24 npm: @n24q02m/mcp-core bun add @n24q02m/mcp-core
packages/embedding-daemon Python 3.13 PyPI: mcp-embedding-daemon pip install mcp-embedding-daemon
packages/stdio-proxy Python 3.13 PyPI: mcp-stdio-proxy pip install mcp-stdio-proxy

All four packages share the same version (semantic-release.toml bumps all three Python pyproject.toml files plus the npm package.json in lockstep).

What you get

n24q02m-mcp-core (Python) and @n24q02m/mcp-core (TypeScript)

Identical public API in both languages:

  • crypto/ — ECDH P-256, AES-256-GCM, HKDF-SHA256 primitives. Cross-language test vectors guarantee Python and TypeScript produce the same ciphertext for the same input.
  • storage/ — encrypted config file (config.enc) backed by PBKDF2 600k + machine-id key derivation, plus session lock files and config resolver helpers.
  • oauth/ — OAuth 2.1 Authorization Server building blocks: JWTIssuer (RS256), OAuthProvider (PKCE flow + relay session integration), SqliteUserStore for multi-user mode.
  • relay/RelaySession, create_session, poll_for_result, send_message plus the EFF Diceware wordlist for passphrase generation.
  • schema/RelayConfigSchema TypedDict that downstream servers use to declare their config form.
  • transport/StreamableHTTPServer wrapper around FastMCP / @modelcontextprotocol/sdk Streamable HTTP transport, plus OAuthMiddleware (RFC 6750 + RFC 9728 compliant Bearer validation).
  • lifecycle/LifecycleLock cross-platform file lock that prevents two server instances from binding the same (name, port) pair.
  • install/ (Python only) — AgentInstaller that writes MCP server entries into Claude Code, Cursor, Codex, Windsurf, and OpenCode config files.

mcp-embedding-daemon

FastAPI HTTP server scaffold for the upcoming shared ONNX/GGUF embedding backend. v0.1.0 alpha exposes:

  • GET /health — returns {status, version}
  • POST /embed — returns 501 with a roadmap link (backend wiring lands in the next release)
  • POST /rerank — returns 501 with a roadmap link

CLI entry point: mcp-embedding-daemon --host 127.0.0.1 --port 9800.

mcp-stdio-proxy

Thin stdio-to-HTTP forwarder for agents that only support stdio MCP transport (e.g., Antigravity). Reads JSON-RPC frames from stdin, POSTs them to a remote MCP server, writes responses to stdout.

CLI entry point: mcp-stdio-proxy --url https://my-mcp.example.com/mcp --token <bearer>. Falls back to MCP_CORE_SERVER_URL and MCP_CORE_SERVER_TOKEN env vars when flags are not supplied.

Quick start (Python)

from mcp_core import RelaySession, create_session, decrypt
from mcp_core.transport.streamable_http import StreamableHTTPServer
from mcp_core.oauth import JWTIssuer
from mcp_core.transport.oauth_middleware import OAuthMiddleware
from fastmcp import FastMCP

mcp = FastMCP("my-server")

issuer = JWTIssuer("my-server")
issuer  # Use issuer.issue_access_token(sub) / verify_access_token(token)

middleware = [OAuthMiddleware(issuer=issuer, resource_metadata_url="http://127.0.0.1:9876/.well-known/oauth-protected-resource")]
server = StreamableHTTPServer(mcp, port=9876, middleware=middleware)
server.run()

Quick start (TypeScript)

import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
import { JWTIssuer } from '@n24q02m/mcp-core/oauth'
import { OAuthMiddleware, StreamableHTTPServer } from '@n24q02m/mcp-core/transport'

const server = new McpServer({ name: 'my-server', version: '0.0.0' })
const issuer = new JWTIssuer('my-server')
await issuer.init()

const middleware = new OAuthMiddleware({
  jwtIssuer: issuer,
  resourceMetadataUrl: 'http://127.0.0.1:9876/.well-known/oauth-protected-resource'
})

const http = new StreamableHTTPServer({ server, port: 9876, oauthMiddleware: middleware })
await http.connect()
// Then mount http.handleRequest(req, res) on your http.Server / Express / Hono.

Development

mise run setup            # install runtimes + deps + pre-commit hooks
bun install               # root TypeScript workspace install

# Python (per package)
cd packages/core-py
uv sync --group dev
uv run pytest
uv run ty check
uv run ruff check .

# TypeScript
cd packages/core-ts
bun run test
bun run check
bun run build

Spec

Architecture design lives in claude-plugins/docs/superpowers/specs/2026-04-10-mcp-core-unified-transport-design.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

n24q02m_mcp_core-1.1.0.tar.gz (136.2 kB view details)

Uploaded Source

Built Distribution

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

n24q02m_mcp_core-1.1.0-py3-none-any.whl (84.2 kB view details)

Uploaded Python 3

File details

Details for the file n24q02m_mcp_core-1.1.0.tar.gz.

File metadata

  • Download URL: n24q02m_mcp_core-1.1.0.tar.gz
  • Upload date:
  • Size: 136.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for n24q02m_mcp_core-1.1.0.tar.gz
Algorithm Hash digest
SHA256 f57eb708963eaef0555458b593bb62b4d14f62259c466ff80a0df994d5cbf0fa
MD5 3c4b02ee7676e229d12407acf58950a6
BLAKE2b-256 6ee138a24c39e67b4a50cc89a505bdbec1a38c39d3a99e2aeb0ab13c7b398556

See more details on using hashes here.

File details

Details for the file n24q02m_mcp_core-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: n24q02m_mcp_core-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 84.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for n24q02m_mcp_core-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 48056e3c6644ec55bc98768c808f99c2e998c08e59ffeabf86bde34b9e02d6c4
MD5 30e8ebc6655179a21c034c77aeb67af9
BLAKE2b-256 04ce903408a136b2af4e2f35c913c8b07799e32f3138788c5cb88cc06c44f01f

See more details on using hashes here.

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