MCP-native Β· TypeScript-first Β· Deploy anywhere
One secure endpoint for every MCP server.
π Docs Β· π¬ Discord Β· π decocms.com/mesh
TL;DR:
- Route all MCP traffic through a single governed endpoint
- Enforce RBAC, policies, and audit trails at the control plane
- Full observability with OpenTelemetry β traces, costs, errors
- Runtime strategies as gateways for optimal tool selection
- Self-host with Docker, Bun/Node, Kubernetes, or run locally
MCP Mesh is an open-source control plane for MCP traffic. It sits between your MCP clients (Cursor, Claude, Windsurf, VS Code, custom agents) and your MCP servers, providing a unified layer for auth, routing and observability.
It replaces MΓN integrations (M MCP servers Γ N clients) with one production endpoint, so you stop maintaining separate configs in every client. Built for multi-tenant orgs: workspace/project scoping for policies, credentials, and logs.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β MCP Clients β
β Cursor Β· Claude Β· VS Code Β· Custom Agents β
βββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β MCP MESH β
β Gateway Β· Policy Engine Β· Observability Β· Token Vault β
βββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β MCP Servers β
β Salesforce Β· Slack Β· GitHub Β· Postgres Β· Your APIs β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Clone and install
git clone https://github.com/decocms/mesh.git
bun install
# Run locally (client + API server)
bun run devβ runs at http://localhost:3000 (client) + API server
Or use npx @decocms/mesh to instantly get a mesh running.
As tool surfaces grow, βsend every tool definition to the model on every callβ gets expensive and slow. The mesh models runtime strategies as gateways: one endpoint, different ways of exposing tools.
Examples:
- Full-context: expose everything (simple and deterministic for small toolsets)
- Smart selection: narrow the toolset before execution
- Code execution: load tools on demand and run code in a sandbox
Gateways are configurable and extensible. You can add new strategies and also curate toolsets (see Virtual MCPs).
| Capability | What it does |
|---|---|
| MeshContext | Unified runtime interface providing auth, storage, observability, and policy control |
| defineTool() | Declarative API for typed, auditable, observable MCP tools |
| AccessControl | Fine-grained RBAC via Better Auth β OAuth 2.1 + API keys per workspace/project |
| Multi-tenancy | Workspace/project isolation for config, credentials, policies, and audit logs |
| OpenTelemetry | Full tracing and metrics for tools, workflows, and UI interactions |
| Storage Adapters | Kysely ORM β SQLite / Postgres, easily swapped |
| Proxy Layer | Secure bridge to remote MCP servers with token vault + OAuth |
| Virtual MCPs | Compose and expose governed toolsets as new MCP servers |
| Event Bus | Pub/sub between connections with scheduled/cron delivery and at-least-once guarantees |
| Bindings | Capability contracts (ex.: agents, workflows, views) so apps target interfaces instead of specific MCP implementations |
Tools are first-class citizens. Type-safe, audited, observable, and callable via MCP.
import { z } from "zod";
import { defineTool } from "~/core/define-tool";
export const CONNECTION_CREATE = defineTool({
name: "CONNECTION_CREATE",
description: "Create a new MCP connection",
inputSchema: z.object({
name: z.string(),
connection: z.object({
type: z.enum(["HTTP", "SSE", "WebSocket"]),
url: z.string().url(),
token: z.string().optional(),
}),
}),
outputSchema: z.object({
id: z.string(),
scope: z.enum(["workspace", "project"]),
}),
handler: async (input, ctx) => {
await ctx.access.check();
const conn = await ctx.storage.connections.create({
projectId: ctx.project?.id ?? null,
...input,
createdById: ctx.auth.user!.id,
});
return { id: conn.id, scope: conn.projectId ? "project" : "workspace" };
},
});Every tool call automatically gets: input/output validation, access control checks, audit logging, and OpenTelemetry traces.
βββ apps/
β βββ mesh/ # Full-stack MCP Mesh (Hono API + Vite/React)
β β βββ src/
β β β βββ api/ # Hono HTTP + MCP proxy routes
β β β βββ auth/ # Better Auth (OAuth + API keys)
β β β βββ core/ # MeshContext, AccessControl, defineTool
β β β βββ tools/ # Built-in MCP management tools
β β β βββ storage/ # Kysely DB adapters
β β β βββ event-bus/ # Pub/sub event delivery system
β β β βββ encryption/ # Token vault & credential management
β β β βββ observability/ # OpenTelemetry tracing & metrics
β β β βββ web/ # React 19 admin UI
β β βββ migrations/ # Kysely database migrations
β βββ docs/ # Astro documentation site
β
βββ packages/
βββ bindings/ # Core MCP bindings and connection abstractions
βββ runtime/ # MCP proxy, OAuth, and runtime utilities
βββ ui/ # Shared React components (shadcn-based)
βββ cli/ # CLI tooling (deco commands)
βββ create-deco/ # Project scaffolding (npm create deco)
βββ vite-plugin-deco/ # Vite plugin for Deco projects
# Install dependencies
bun install
# Run dev server (client + API)
bun run dev
# Run tests
bun test
# Type check
bun run check
# Lint
bun run lint
# Format
bun run fmtbun run dev:client # Vite dev server (port 4000)
bun run dev:server # Hono server with hot reload
bun run migrate # Run database migrations# Docker Compose (SQLite)
docker compose -f deploy/docker-compose.yml up
# Docker Compose (PostgreSQL)
docker compose -f deploy/docker-compose.postgres.yml up
# Self-host with Bun
bun run build:client && bun run build:server
bun run start
# Kubernetes
kubectl apply -f k8s/Runs on any infrastructure β Docker, Kubernetes, AWS, GCP, or local Bun/Node runtimes. No vendor lock-in.
| Layer | Tech |
|---|---|
| Runtime | Bun / Node |
| Language | TypeScript + Zod |
| Framework | Hono (API) + Vite + React 19 |
| Database | Kysely β SQLite / PostgreSQL |
| Auth | Better Auth (OAuth 2.1 + API keys) |
| Observability | OpenTelemetry |
| UI | React 19 + Tailwind v4 + shadcn |
| Protocol | Model Context Protocol (MCP) |
- Multi-tenant admin dashboard
- MCP bindings (swap providers without rewrites)
- Version history for mesh configs
- NPM package runtime
- Edge debugger / live tracing
- Cost analytics and spend caps
- MCP Store β discover and install pre-built MCP apps
The MCP Mesh is the infrastructure layer of decoCMS.
| Layer | What it does |
|---|---|
| MCP Mesh | Connect, govern, and observe MCP traffic |
| MCP Studio (coming soon) | Package durable MCP capabilities into shareable apps (SDK + no-code admin) |
| MCP Store (coming soon) | Discover, install (and eventually monetize) pre-built MCP apps. |
The MCP Mesh ships with a Sustainable Use License (SUL). See LICENSE.md.
- β Free to self-host for internal use
- β Free for client projects (agencies, SIs)
β οΈ Commercial license required for SaaS or revenue-generating production systems
Questions? [email protected]
We welcome contributions! Run the following before submitting a PR:
bun run fmt # Format code
bun run lint # Check linting
bun test # Run testsSee AGENTS.md for detailed coding guidelines and conventions.