{"id":48736068,"url":"https://github.com/n24q02m/mcp-core","last_synced_at":"2026-05-02T08:08:25.001Z","repository":{"id":350647241,"uuid":"1207716789","full_name":"n24q02m/mcp-core","owner":"n24q02m","description":"Unified MCP Streamable HTTP 2025-11-25 transport, OAuth 2.1 AS, lifecycle, install, and shared embedding daemon","archived":false,"fork":false,"pushed_at":"2026-04-29T07:17:41.000Z","size":1351,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-29T08:06:26.727Z","etag":null,"topics":["ai","mcp","model-context-protocol","oauth21","python","streamable-http","typescript"],"latest_commit_sha":null,"homepage":"https://github.com/n24q02m/mcp-core","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/n24q02m.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-04-11T09:55:14.000Z","updated_at":"2026-04-29T07:17:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"5074d098-b794-4b5b-bf3c-ba4ea87dd349","html_url":"https://github.com/n24q02m/mcp-core","commit_stats":null,"previous_names":["n24q02m/mcp-core"],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/n24q02m/mcp-core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n24q02m%2Fmcp-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n24q02m%2Fmcp-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n24q02m%2Fmcp-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n24q02m%2Fmcp-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/n24q02m","download_url":"https://codeload.github.com/n24q02m/mcp-core/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n24q02m%2Fmcp-core/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32428622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T13:34:34.882Z","status":"ssl_error","status_checked_at":"2026-04-29T13:34:29.830Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","mcp","model-context-protocol","oauth21","python","streamable-http","typescript"],"created_at":"2026-04-12T04:06:37.485Z","updated_at":"2026-05-02T08:08:24.995Z","avatar_url":"https://github.com/n24q02m.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mcp-core\n\nUnified MCP Streamable HTTP 2025-11-25 transport, OAuth 2.1 Authorization\nServer, lifecycle management, install automation, and shared embedding\ndaemon for the n24q02m MCP ecosystem.\n\n`mcp-core` is the **functional successor** to the archived\n[`mcp-relay-core`](https://github.com/n24q02m/mcp-relay-core). All crypto,\nstorage, OAuth, relay, and schema modules from `mcp-relay-core` ship under\nthe same paths in `mcp-core` (1:1 superset), so downstream MCP servers can\nmigrate with a pure import + dependency rename. See\n[`docs/migration-from-mcp-relay-core.md`](docs/migration-from-mcp-relay-core.md)\nfor the rename table.\n\n## Packages\n\n| Package | Language | Registry | Install |\n|---------|----------|----------|---------|\n| [`packages/core-py`](packages/core-py) | Python 3.13 | PyPI: [`n24q02m-mcp-core`](https://pypi.org/project/n24q02m-mcp-core/) | `pip install n24q02m-mcp-core` |\n| [`packages/core-ts`](packages/core-ts) | TypeScript / Node 24 | npm: [`@n24q02m/mcp-core`](https://www.npmjs.com/package/@n24q02m/mcp-core) | `bun add @n24q02m/mcp-core` |\n| [`packages/embedding-daemon`](packages/embedding-daemon) | Python 3.13 | PyPI: [`mcp-embedding-daemon`](https://pypi.org/project/mcp-embedding-daemon/) | `pip install mcp-embedding-daemon` |\n\nAll three packages share the same version (`semantic-release.toml` bumps both\nPython `pyproject.toml` files plus the npm `package.json` in lockstep).\n\n## What you get\n\n### `n24q02m-mcp-core` (Python) and `@n24q02m/mcp-core` (TypeScript)\n\nIdentical public API in both languages:\n\n- **`crypto/`** — ECDH P-256, AES-256-GCM, HKDF-SHA256 primitives.\n  Cross-language test vectors guarantee Python and TypeScript produce the\n  same ciphertext for the same input.\n- **`storage/`** — encrypted config file (`config.enc`) backed by PBKDF2\n  600k + machine-id key derivation, plus session lock files and config\n  resolver helpers.\n- **`oauth/`** — OAuth 2.1 Authorization Server building blocks: `JWTIssuer`\n  (RS256), `OAuthProvider` (PKCE flow + relay session integration),\n  `SqliteUserStore` for multi-user mode.\n- **`relay/`** — `RelaySession`, `create_session`, `poll_for_result`,\n  `send_message` plus the EFF Diceware wordlist for passphrase generation.\n- **`schema/`** — `RelayConfigSchema` TypedDict that downstream servers use\n  to declare their config form.\n- **`transport/`** — `StreamableHTTPServer` wrapper around FastMCP /\n  `@modelcontextprotocol/sdk` Streamable HTTP transport, plus\n  `OAuthMiddleware` (RFC 6750 + RFC 9728 compliant Bearer validation).\n- **`lifecycle/`** — `LifecycleLock` cross-platform file lock that prevents\n  two server instances from binding the same `(name, port)` pair.\n- **`install/`** (Python only) — `AgentInstaller` that writes MCP server\n  entries into Claude Code, Cursor, Codex, Windsurf, and OpenCode config\n  files.\n\n### `mcp-embedding-daemon`\n\nFastAPI HTTP server scaffold for the upcoming shared ONNX/GGUF embedding\nbackend. Currently exposes:\n\n- `GET /health` — returns `{status, version}`\n- `POST /embed` — returns 501 with a roadmap link (backend wiring lands in\n  the next release)\n- `POST /rerank` — returns 501 with a roadmap link\n\nCLI entry point: `mcp-embedding-daemon --host 127.0.0.1 --port 9800`.\n\n## Quick start (Python)\n\n```python\nfrom mcp_core import RelaySession, create_session, decrypt\nfrom mcp_core.transport.streamable_http import StreamableHTTPServer\nfrom mcp_core.oauth import JWTIssuer\nfrom mcp_core.transport.oauth_middleware import OAuthMiddleware\nfrom fastmcp import FastMCP\n\nmcp = FastMCP(\"my-server\")\n\nissuer = JWTIssuer(\"my-server\")\nissuer  # Use issuer.issue_access_token(sub) / verify_access_token(token)\n\nmiddleware = [OAuthMiddleware(issuer=issuer, resource_metadata_url=\"http://127.0.0.1:9876/.well-known/oauth-protected-resource\")]\nserver = StreamableHTTPServer(mcp, port=9876, middleware=middleware)\nserver.run()\n```\n\n## Quick start (TypeScript)\n\n```typescript\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'\nimport { JWTIssuer } from '@n24q02m/mcp-core/oauth'\nimport { OAuthMiddleware, StreamableHTTPServer } from '@n24q02m/mcp-core/transport'\n\nconst server = new McpServer({ name: 'my-server', version: '0.0.0' })\nconst issuer = new JWTIssuer('my-server')\nawait issuer.init()\n\nconst middleware = new OAuthMiddleware({\n  jwtIssuer: issuer,\n  resourceMetadataUrl: 'http://127.0.0.1:9876/.well-known/oauth-protected-resource'\n})\n\nconst http = new StreamableHTTPServer({ server, port: 9876, oauthMiddleware: middleware })\nawait http.connect()\n// Then mount http.handleRequest(req, res) on your http.Server / Express / Hono.\n```\n\n## Development\n\n```bash\nmise run setup            # install runtimes + deps + pre-commit hooks\nbun install               # root TypeScript workspace install\n\n# Python (per package)\ncd packages/core-py\nuv sync --group dev\nuv run pytest\nuv run ty check\nuv run ruff check .\n\n# TypeScript\ncd packages/core-ts\nbun run test\nbun run check\nbun run build\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn24q02m%2Fmcp-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn24q02m%2Fmcp-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn24q02m%2Fmcp-core/lists"}