Skip to main content

Claude Code

Connect Claude Code (Anthropic's terminal coding agent) to ColabHive via MCP.

Two paths: hosted (recommended) or local stdio.


Path A — Hosted endpoint

Prerequisites

  • Claude Code installed (pnpm i -g @anthropic-ai/claude-code or your installer of choice)
  • A ColabHive API key

Config

Create or edit ~/.claude/mcp.json (global) or <project>/.mcp.json (project-scoped):

{
"mcpServers": {
"colabhive": {
"transport": "sse",
"url": "https://mcp.colabhive.com/mcp",
"headers": {
"X-API-Key": "${env:COLABHIVE_API_KEY}"
}
}
}
}

The ${env:COLABHIVE_API_KEY} lets you keep the key out of the file. Source it from your shell:

# ~/.zshrc or ~/.bashrc
export COLABHIVE_API_KEY=hive_xxx

Via the CLI

# Global
claude mcp add colabhive --transport sse \
--url https://mcp.colabhive.com/mcp \
--header "X-API-Key: $COLABHIVE_API_KEY"

# Verify
claude mcp list
# colabhive ✓ connected (63 tools)

Path B — Local stdio

{
"mcpServers": {
"colabhive": {
"command": "uvx",
"args": ["colabhive-mcp@latest"],
"env": { "COLABHIVE_API_KEY": "${env:COLABHIVE_API_KEY}" }
}
}
}

Verify

claude mcp list
# colabhive ✓ connected

Inside Claude Code, type /mcp to see all registered servers.

Then prompt:

Use the ColabHive embeddings-public tool to embed each line of README.md.

Run my trained fraud-detector-v3 model on the rows in data/transactions.csv.


Recipes

Restrict to safe tools

Path A does not support enforced per-tool restrictions today. API-key scopes are stored but not enforced. In Path B, apply the restriction locally:

{
"mcpServers": {
"colabhive": {
"command": "uvx",
"args": [
"colabhive-mcp@latest",
"--deny-side-effects", "network,mutating,destructive",
"--stability", "stable"
],
"env": { "COLABHIVE_API_KEY": "${env:COLABHIVE_API_KEY}" }
}
}
}

CI usage

# .github/workflows/data-pipeline.yml
- name: Run Claude Code task
env:
COLABHIVE_API_KEY: ${{ secrets.COLABHIVE_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: |
claude --headless --prompt "Use ColabHive embeddings-public to embed each row in data.csv and save to embeds.parquet"

Path A (hosted) is simpler in CI: nothing to install.

Pin a manifest snapshot for reproducible CI

Fetch once, pin to that exact snapshot via ETag:

curl -H "X-API-Key: $COLABHIVE_API_KEY" \
https://mcp.colabhive.com/mcp ... # not strictly needed; Path A always reads live

For real reproducibility prefer Path B + --manifest-pin=./snapshot.json.


Troubleshooting

claude mcp list shows "✗ connection error" (Path A)

curl https://mcp.colabhive.com/health
# Should print JSON. If not, network issue.

claude mcp logs colabhive | tail -50
# Look for 401 (key issue) or 5xx (server issue).

Same error (Path B)

uvx colabhive-mcp@latest --log-level debug 2>&1 | head -30

Most common: missing COLABHIVE_API_KEY in the launching shell.

Tool name not callable

  • Manifest stale → claude mcp restart colabhive.
  • Tool not visible to your account → check console.colabhive.com.

Concurrency / hangs

Path B only:

"args": ["colabhive-mcp@latest", "--max-concurrent=4"]

See also