Self-hosting the MCP server
Most people should use the hosted remote MCP. It’s one click, signs in with OAuth, and picks up new tools automatically. Use this page only if you have a reason to run the server locally.
When to self-host.CI pipelines that can’t complete an OAuth flow, fully headless agents, or a self-hosted Clamp deployment. For everything else, the hosted MCP is simpler and always up to date.
Install
The @clamp-sh/mcp package runs as a local subprocess over stdio and authenticates with a project API key. Keys come from Settings → API Keys in the Clamp dashboard and start with sk_proj. Each key is scoped to one project.
VS Code / Copilot
Add to .vscode/mcp.json in your project:
{
"servers": {
"clamp": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@clamp-sh/mcp"],
"env": {
"CLAMP_API_KEY": "sk_proj..."
}
}
}
}Claude Code
claude mcp add clamp -- npx -y @clamp-sh/mcp
export CLAMP_API_KEY="sk_proj..."Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"clamp": {
"command": "npx",
"args": ["-y", "@clamp-sh/mcp"],
"env": {
"CLAMP_API_KEY": "sk_proj..."
}
}
}
}Cursor
Add to .cursor/mcp.json:
{
"mcpServers": {
"clamp": {
"command": "npx",
"args": ["-y", "@clamp-sh/mcp"],
"env": {
"CLAMP_API_KEY": "sk_proj..."
}
}
}
}Pointing at a self-hosted Clamp
Set CLAMP_API_URLto your deployment’s API base. Defaults to https://api.clamp.sh when unset.
export CLAMP_API_KEY="sk_proj..."
export CLAMP_API_URL="https://clamp.example.com"Caveats
- The local server only sees the one project the API key belongs to.
list_projectsreturns that single row. - You’re responsible for upgrading.
npx -y @clamp-sh/mcpfetches the latest on each invocation, but pinned installs will lag behind the hosted MCP. - Write tools (
create_funnel,create_alert) still require a Pro or Growth plan on the owning org.