MCP Server
Model Context Protocol server for Meshes. Gives AI coding agents like Claude Code, Cursor, and Windsurf direct tool access to emit events, manage workspaces, inspect resources, update mappings, and manage embedded sessions.
The Meshes MCP server implements the Model Context Protocol to give AI coding agents direct access to the Meshes API. Instead of your agent guessing at endpoints, it gets 31 typed tools that cover event delivery, workspace discovery, routing rules, connection mappings, and embedded sessions.
This works with any MCP-compatible client: Claude Code, Claude Desktop, Cursor, Windsurf, and others.
Installation
The MCP server is available as a standalone repository: mesheshq/meshes-mcp-server.
Quick start (recommended)
Run directly with npx:
npx -y @mesheshq/mcp-server
The published package requires Node.js 20 or later.
Run from source
git clone https://github.com/mesheshq/meshes-mcp-server.git
cd meshes-mcp-server
npm install
npm run build
npm test
Configuration
The server needs your Meshes machine key credentials to authenticate. It automatically mints short-lived JWTs for each API request, so you never need to generate tokens manually.
Create or copy your machine keys from the Meshes dashboard under Profile -> API Keys. See Authentication for the underlying auth model.
You'll need these environment variables:
export MESHES_ACCESS_KEY=your_access_key
export MESHES_SECRET_KEY=your_secret_key
export MESHES_ORG_ID=your_organization_uuid
You can also use MESHES_ORGANIZATION_ID instead of MESHES_ORG_ID. If you are pointing at a non-default environment, set MESHES_API_URL too.
| Variable | Required | Description |
|---|---|---|
MESHES_ACCESS_KEY | Yes | Machine access key from the dashboard |
MESHES_SECRET_KEY | Yes | Machine secret key from the dashboard |
MESHES_ORG_ID | Yes* | Organization UUID |
MESHES_ORGANIZATION_ID | Yes* | Alias for MESHES_ORG_ID |
MESHES_API_URL | No | API base URL (defaults to https://api.meshes.io) |
* Set either MESHES_ORG_ID or MESHES_ORGANIZATION_ID.
Cursor
Security note: These config files contain your secret key. They live in your home directory (not your project repo), so they won't be accidentally committed. Never commit access keys or secret keys to version control. Publishable keys are safe to commit.
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"meshes": {
"command": "npx",
"args": ["-y", "@mesheshq/mcp-server"],
"env": {
"MESHES_ACCESS_KEY": "your_access_key",
"MESHES_SECRET_KEY": "your_secret_key",
"MESHES_ORG_ID": "your_organization_uuid"
}
}
}
}
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"meshes": {
"command": "npx",
"args": ["-y", "@mesheshq/mcp-server"],
"env": {
"MESHES_ACCESS_KEY": "your_access_key",
"MESHES_SECRET_KEY": "your_secret_key",
"MESHES_ORG_ID": "your_organization_uuid"
}
}
}
}
Claude Code
claude mcp add meshes \
-e MESHES_ACCESS_KEY=your_access_key \
-e MESHES_SECRET_KEY=your_secret_key \
-e MESHES_ORG_ID=your_organization_uuid \
-- npx -y @mesheshq/mcp-server
Windsurf
Add to your Windsurf MCP configuration:
{
"mcpServers": {
"meshes": {
"command": "npx",
"args": ["-y", "@mesheshq/mcp-server"],
"env": {
"MESHES_ACCESS_KEY": "your_access_key",
"MESHES_SECRET_KEY": "your_secret_key",
"MESHES_ORG_ID": "your_organization_uuid"
}
}
}
}
Available tools
The MCP server exposes 31 tools organized by resource type.
Workspaces
| Tool | Description |
|---|---|
meshes_list_workspaces | List all workspaces in the organization |
meshes_get_workspace | Get details for a specific workspace |
meshes_create_workspace | Create a new workspace |
meshes_update_workspace | Update workspace properties |
meshes_get_workspace_event_types | List event types configured for a workspace |
meshes_get_workspace_resources | List resources configured for a workspace |
Connections
| Tool | Description |
|---|---|
meshes_list_connections | List connections across the organization |
meshes_get_connection | Get connection details |
meshes_create_connection | Create a new connection destination |
meshes_update_connection | Update connection configuration metadata |
meshes_delete_connection | Delete a connection |
meshes_get_connection_actions | Discover available destination actions |
meshes_get_connection_fields | Get destination field configuration for mappings |
meshes_get_connection_default_mappings | Get default mappings for a connection |
meshes_update_connection_default_mappings | Update default mappings for a connection |
Rules
| Tool | Description |
|---|---|
meshes_list_rules | List all routing rules |
meshes_get_rule | Get details for a routing rule |
meshes_create_rule | Create an event routing rule |
meshes_delete_rule | Delete an event routing rule |
Events
| Tool | Description |
|---|---|
meshes_emit_event | Emit a single event |
meshes_emit_bulk_events | Emit up to 100 events in one request |
meshes_list_events | List events across the organization |
meshes_get_workspace_events | List events for a workspace with filters |
meshes_get_event | Get event details and delivery status |
meshes_get_event_payload | Get event details including payload |
meshes_retry_event_rule | Retry a failed rule delivery |
Integrations
| Tool | Description |
|---|---|
meshes_list_integrations | Get metadata about supported integrations |
Sessions
| Tool | Description |
|---|---|
meshes_create_session | Mint a new embedded workspace session |
meshes_list_sessions | List embedded sessions for a workspace |
meshes_refresh_session | Refresh an existing session token |
meshes_revoke_session | Revoke an embedded session |
Example workflows
"Set up a signup event that goes to HubSpot"
The agent will:
- Call
meshes_list_workspacesto find the right workspace - Call
meshes_list_connectionsto find the HubSpot connection - Call
meshes_get_connection_actionsto discover available actions (e.g.,create_or_update_contact) - Call
meshes_create_ruleto binduser.signup→ HubSpot →create_or_update_contact
"Why didn't my payment.failed event reach Salesforce?"
The agent will:
- Call
meshes_get_workspace_eventswithevent=payment.failedandstatus=failed - Call
meshes_get_eventto inspectrule_eventsfor error details - Call
meshes_get_event_payloadto verify the payload was correct - Call
meshes_retry_event_ruleafter you fix the underlying issue
"Emit a test event to verify my setup"
The agent will call meshes_emit_event with a test payload and confirm the event was accepted.
"Create an embedded session for a customer workspace"
The agent will:
- Call
meshes_list_workspacesto find the target workspace - Call
meshes_create_sessionto mint a session for that workspace - Call
meshes_list_sessionsto confirm the active session inventory - Call
meshes_refresh_sessionormeshes_revoke_sessionlater as needed
Testing
You can test the MCP server locally with the MCP Inspector:
npx @modelcontextprotocol/inspector npx -y @mesheshq/mcp-server
Also available
- Cursor Rules: For editors that support project-level rules files — teaches the agent the Meshes API without needing MCP.