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

MCP npm monthly installs

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:

.vscode/mcp.json
{
  "servers": {
    "clamp": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@clamp-sh/mcp"],
      "env": {
        "CLAMP_API_KEY": "sk_proj..."
      }
    }
  }
}

Claude Code

terminal
claude mcp add clamp -- npx -y @clamp-sh/mcp
export CLAMP_API_KEY="sk_proj..."

Claude Desktop

Add to claude_desktop_config.json:

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:

.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