by decocms
Provides a secure, unified endpoint for routing all MCP traffic, enforcing RBAC, policies, and full observability while supporting deployment on Docker, Kubernetes, Bun, or Node.
MCP Mesh acts as a control plane that sits between MCP clients (such as Cursor, Claude, VS Code, or custom agents) and MCP servers (Salesforce, Slack, GitHub, Postgres, etc.). It consolidates multiple client‑to‑server integrations into a single governed endpoint, handling authentication, policy enforcement, audit logging, and OpenTelemetry tracing.
npx @decocms/mesh
This starts a local instance with both the admin UI and the API server.git clone https://github.com/decocms/mesh.git
bun install
bun run dev # launches UI (http://localhost:3000) and API
docker-compose.yml for SQLite or PostgreSQL, or apply the manifests in k8s/ for a cluster deployment.defineTool() helper to create typed, auditable MCP tools. Each tool automatically gets input validation, access‑control checks, audit logs, and OpenTelemetry traces.Q: Do I need Docker to run MCP Mesh?
A: No. You can run it directly with Bun/Node (bun run dev or npx @decocms/mesh). Docker and Kubernetes options are provided for production deployments.
Q: How does authentication work? A: Better Auth supplies OAuth 2.1 flows and API‑key generation per workspace/project, with token vault encryption for stored secrets.
Q: Can I add my own storage backend? A: Yes. The storage layer uses Kysely, so you can swap SQLite, PostgreSQL, or any supported SQL dialect.
Q: Is MCP Mesh open‑source? A: Yes, under a Sustainable Use License (SUL). Free for internal/self‑hosted use; commercial SaaS requires a paid license.
Q: How do I expose a new tool to agents?
A: Create a file using defineTool() with Zod schemas for input/output, implement the handler, and the framework automatically registers the tool with RBAC and observability.
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:
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 fmt
apps/mesh/)bun 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) |
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.
Questions? contact@decocms.com
We welcome contributions! Run the following before submitting a PR:
bun run fmt # Format code
bun run lint # Check linting
bun test # Run tests
See AGENTS.md for detailed coding guidelines and conventions.
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by modelcontextprotocol
A Model Context Protocol server for Git repository interaction and automation.
by zed-industries
A high‑performance, multiplayer code editor designed for speed and collaboration.
by modelcontextprotocol
Model Context Protocol Servers
by modelcontextprotocol
A Model Context Protocol server that provides time and timezone conversion capabilities.
by cline
An autonomous coding assistant that can create and edit files, execute terminal commands, and interact with a browser directly from your IDE, operating step‑by‑step with explicit user permission.
by upstash
Provides up-to-date, version‑specific library documentation and code examples directly inside LLM prompts, eliminating outdated information and hallucinated APIs.
by daytonaio
Provides a secure, elastic infrastructure that creates isolated sandboxes for running AI‑generated code with sub‑90 ms startup, unlimited persistence, and OCI/Docker compatibility.
by continuedev
Enables faster shipping of code by integrating continuous AI agents across IDEs, terminals, and CI pipelines, offering chat, edit, autocomplete, and customizable agent workflows.
by github
Connects AI tools directly to GitHub, enabling natural‑language interactions for repository browsing, issue and pull‑request management, CI/CD monitoring, code‑security analysis, and team collaboration.
{
"mcpServers": {
"mesh": {
"command": "npx",
"args": [
"@decocms/mesh"
],
"env": {}
}
}
}claude mcp add mesh npx @decocms/mesh