{"id":40114847,"url":"https://github.com/wasmcp/wasmcp","last_synced_at":"2026-04-01T19:41:34.815Z","repository":{"id":303496368,"uuid":"1015036222","full_name":"wasmcp/wasmcp","owner":"wasmcp","description":"Build MCP servers with WebAssembly components","archived":false,"fork":false,"pushed_at":"2026-03-17T11:16:41.000Z","size":18509,"stargazers_count":71,"open_issues_count":6,"forks_count":6,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-18T00:54:10.132Z","etag":null,"topics":["mcp","modelcontextprotocol","rust","wasm","webassembly"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wasmcp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":"GOVERNANCE.md","roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":"MAINTAINERS.md","copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-06T22:24:36.000Z","updated_at":"2026-03-17T21:10:36.000Z","dependencies_parsed_at":"2026-01-28T04:01:15.019Z","dependency_job_id":null,"html_url":"https://github.com/wasmcp/wasmcp","commit_stats":null,"previous_names":["fastertools/wasmcp","wasmcp/wasmcp"],"tags_count":174,"template":false,"template_full_name":null,"purl":"pkg:github/wasmcp/wasmcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasmcp%2Fwasmcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasmcp%2Fwasmcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasmcp%2Fwasmcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasmcp%2Fwasmcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wasmcp","download_url":"https://codeload.github.com/wasmcp/wasmcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasmcp%2Fwasmcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31291180,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"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":["mcp","modelcontextprotocol","rust","wasm","webassembly"],"created_at":"2026-01-19T12:06:21.432Z","updated_at":"2026-04-01T19:41:34.786Z","avatar_url":"https://github.com/wasmcp.png","language":"Rust","funding_links":[],"categories":["Tools"],"sub_categories":["Host Runtimes"],"readme":"\u003cdiv align=\"center\"\u003e\n\n# `wasmcp`\n\nA [WebAssembly Component](https://component-model.bytecodealliance.org/) Development Kit for the [Model Context Protocol](https://modelcontextprotocol.io/docs/getting-started/intro)\n\n\u003c/div\u003e\n\n## Install\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/wasmcp/wasmcp/main/install.sh | bash\n```\n\nSee [releases](https://github.com/wasmcp/wasmcp/releases) for SBOMs etc.\n\nOr build from source:\n\n```bash\ncargo install --git https://github.com/wasmcp/wasmcp\n```\n\nRequires [`wasmtime`](https://wasmtime.dev/), [`wash`](https://github.com/wasmCloud/wash), [`spin`](https://github.com/spinframework/spin), or another component-capable runtime to run composed servers.\n\n## Quick Start\n\nCreate and run your first MCP tool component:\n```bash\n# Create a component in your favorite language\nwasmcp new time-tools --language python\ncd time-tools \u0026\u0026 make \u0026\u0026 cd ..\n\n# Register it with a short alias\nwasmcp registry component add time time-tools/time-tools.wasm\n\n# Compose into an MCP server and run\nwasmcp compose server time --runtime wasmtime -o server.wasm\nwasmtime serve -Scli -Skeyvalue -Shttp server.wasm  # http://0.0.0.0:8080/mcp\n```\n\nCombine multiple tool components - they automatically merge into a unified catalog:\n```bash\n# Create another component\nwasmcp new math-tools --language rust\ncd math-tools \u0026\u0026 make \u0026\u0026 cd ..\nwasmcp registry component add math math-tools/target/wasm32-wasip2/release/math_tools.wasm\n\n# Compose both together\nwasmcp compose server time math --runtime wasmtime -o combined-server.wasm\nwasmtime serve -Scli -Skeyvalue -Shttp combined-server.wasm\n```\n\nSee [examples/](examples/) for more.\n\n## Documentation\n\n- **[Examples](examples/)**\n- **[CLI Reference](cli/README.md)**\n- **[Development MCP server](docs/daemon-management.md)** - Run a local development server that provides context to your coding agent about developing, composing, and running `wasmcp` projects.\n\n## Authentication Modes\n\nwasmcp supports both public (unauthenticated) and OAuth 2.1 protected MCP servers via the `WASMCP_AUTH_MODE` environment variable.\n\n### Public Mode (Default)\n\n```bash\n# No environment variables needed (default behavior)\nwasmtime serve -Scli -Skeyvalue -Shttp server.wasm\n```\n\nOr explicitly set:\n```bash\nWASMCP_AUTH_MODE=public wasmtime serve -Scli -Skeyvalue -Shttp server.wasm\n```\n\n### OAuth Mode\n\nRequires JWT bearer tokens per MCP OAuth 2.1 spec. Supports two validation patterns:\n\n#### Dynamic Registration Pattern\n\nPer-user client IDs created dynamically. No fixed audience - validation via issuer and signature only.\n\n**Required Environment Variables:**\n- `WASMCP_AUTH_MODE=oauth` - Enable OAuth authentication\n- `JWT_ISSUER` - Expected token issuer (e.g., `https://your.issuer.com`)\n- `JWT_JWKS_URI` - JWKS endpoint for public key retrieval\n\n**Example:**\n```bash\nWASMCP_AUTH_MODE=oauth \\\nJWT_ISSUER=https://api.workos.com \\\nJWT_JWKS_URI=https://api.workos.com/sso/jwks/client_01234567890 \\\nwasmtime serve -Scli -Skeyvalue -Shttp server.wasm\n```\n\n## Features\n\n- **Stateful Sessions** - Built-in session management with key-value storage for multi-request workflows\n- **Authentication** - JWT/OAuth bearer token validation with scope-based authorization\n- **Auto-Composition** - Automatically wraps components with appropriate middleware\n- **Type-Safe Storage** - TypedValue enum for runtime type safety in sessions\n- **Real-time Notifications** - Progress updates, logs, and resource changes via streaming\n\n## Why?\n\nWebAssembly components are:\n- **Composable** - Combine compiled binaries like building blocks\n- **Sandboxed** - Isolated execution with explicit interfaces\n- **Distributable** - Push/pull components from OCI registries\n- **Lean** - Complete servers can be under 1MB\n\nThese qualities are a perfect match for MCP's [server design principals](https://modelcontextprotocol.io/specification/2025-06-18/architecture#design-principles).\n\n\u003e 1. Servers should be extremely easy to build\n\u003e 2. Servers should be highly composable\n\u003e 3. Servers should not be able to read the whole conversation, nor “see into” other servers\n\u003e 4. Features can be added to servers and clients progressively\n\n## Architecture\n\nServer features like tools, resources, prompts, and completions, are implemented by individual WebAssembly components that export the narrow, spec-mapped WIT interfaces defined in [spec/2025-06-18/wit/](spec/2025-06-18/wit/).\n\n`wasmcp compose` wraps these components with published middleware components from [crates/](crates/) and composes them together behind a transport component as a complete middleware [chain of responsibility](https://en.wikipedia.org/wiki/Chain-of-responsibility_pattern) that implements an MCP server. The chain terminates with [crates/method-not-found](crates/method-not-found), which returns errors for unhandled methods.\n\nAny of the published default wasmcp components can be swapped out for custom implementations during composition, enabling flexible server configurations.\n\n```\nTransport\u003cProtocol\u003e\n        ↓\n    Middleware₀\n        ↓\n    Middleware\u003cFeature\u003e₁\n        ↓\n    Middleware\u003cFeature\u003e₂\n        ↓\n       ...\n        ↓\n    Middlewareₙ\n        ↓\n    MethodNotFound\n```\n\nEach component:\n- Handles requests it understands (e.g., `tools/call`)\n- Delegates others downstream\n- Merges results (e.g., combining tool lists)\n\nThis enables dynamic composition without complex configuration - like Unix pipes for MCP.\n\n### Example Composition\n\nComponents can be specified as local paths, registry packages (OCI), aliases, or profiles:\n\n```bash\n# Local file path\nwasmcp compose server ./calculator.wasm -o server.wasm\n\n# Registry package (OCI) - colon identifies it as a registry spec\nwasmcp compose server wasmcp:calculator@0.1.0 -o server.wasm\n\n# Aliases (registered in ~/.config/wasmcp/wasmcp.toml)\nwasmcp compose server calc weather -o server.wasm\n\n# Mixed: local path + registry package + alias\nwasmcp compose server ./logger.wasm wasmcp:calculator@1.0 weather -o server.wasm\n```\n\nWhen a client requests `tools/list`, each component that offers tools contributes their tools, creating a unified catalog automatically.\n\n## Registry\n\n`wasmcp registry` allows for simple artifact aliases and reusable composition profiles.\n\n### Component Aliases\n\nRegister short names for frequently-used components:\n\n```bash\n# Register local components (file paths)\nwasmcp registry component add calc ./calculator.wasm\nwasmcp registry component add weather ./weather-tools.wasm\n\n# Register from OCI registry (namespace:name@version)\nwasmcp registry component add db wasmcp:database@1.0.0\nwasmcp registry component add logger namespace:logger@2.0.0\n\n# Aliases can also reference other aliases\nwasmcp registry component add prod-calc calc\n\n# Use aliases in composition\nwasmcp compose server calc weather -o server.wasm\nwasmcp compose server db logger -o server.wasm\n\n# List and manage\nwasmcp registry component list\nwasmcp registry component remove calc\n```\n\n### Profiles\n\nSave a list of components to compose together:\n\n```bash\n# Save: dev = calc + weather\nwasmcp registry profile add dev calc weather -o dev.wasm\n\n# Later, rebuild the same server\nwasmcp compose server dev\n# Creates: ~/.config/wasmcp/composed/dev.wasm\n\n# Or specify a different output location\nwasmcp compose server dev -o ./my-server.wasm\n# Creates: ./my-server.wasm\n```\n\nProfiles can inherit from other profiles:\n```bash\nwasmcp registry profile add prod logger monitor -o prod.wasm -b dev\n# prod = calc + weather + logger + monitor\n```\n\nList and remove:\n```bash\nwasmcp registry profile list\nwasmcp registry profile remove dev\n```\n\n### Registry Info\n\nView your registry configuration:\n\n```bash\nwasmcp registry info              # Show all\nwasmcp registry info --components # Filter to components\nwasmcp registry info --profiles   # Filter to profiles\n```\n\n### Configuration\n\nRegistry data is stored in `~/.config/wasmcp/config.toml` ([XDG Base Directory](https://specifications.freedesktop.org/basedir-spec/latest/)).\n\n## Components\n\n### Your Components\n\nWrite handlers in any language with [component toolchain support](https://component-model.bytecodealliance.org/language-support.html):\n\n```bash\nwasmcp new my-handler --language rust       # Rust (calculator example)\nwasmcp new my-handler --language python     # Python (string tools example)\nwasmcp new my-handler --language typescript # TypeScript (example tool)\n```\n\nGenerated templates demonstrate the capability pattern with working tool implementations.\n\n### Framework Components\n\nPublished to [ghcr.io/wasmcp](https://github.com/orgs/wasmcp/packages):\n\n- **transport** - Universal transport for HTTP / stdio execution with JWT validation\n- **server-io** - Universal MCP message I/O with configurable transport framing support\n- **session-store** - Stateful session management with key-value storage\n- **authorization** - JWT/OAuth bearer token validation and claim extraction\n- **kv-store** - Type-safe key-value storage with TypedValue support\n- **method-not-found** - Terminal handler for unhandled methods\n\nThe CLI automatically downloads these when composing.\n\n## License\n\nApache 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwasmcp%2Fwasmcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwasmcp%2Fwasmcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwasmcp%2Fwasmcp/lists"}