MCP setup
@crawlpipe/mcp is a stdio MCP server that wraps the same /v1/legal/*
endpoints documented in the API reference — every tool
call is a real, metered REST request under the hood, so usage shows up in
Usage exactly like direct API calls.
Run it
npx @crawlpipe/mcpNo install step needed for most MCP clients — they invoke npx on demand.
Configuration
The server reads two environment variables:
| Variable | Required | Meaning |
|---|---|---|
CRAWLPIPE_API_KEY | Yes | An API key from API Keys in the portal (dp_live_…) |
CRAWLPIPE_BASE_URL | No | Overrides the API base URL (defaults to https://api.crawlpipe.com) — useful for local development against http://localhost:8000 |
Example: Claude Desktop / Claude Code config
{
"mcpServers": {
"crawlpipe": {
"command": "npx",
"args": ["-y", "@crawlpipe/mcp"],
"env": {
"CRAWLPIPE_API_KEY": "dp_live_a1b2c3d4e5f6…"
}
}
}
}Tools
| Tool | REST mapping |
|---|---|
legal_search(q, mode?, filters?) | GET /v1/legal/search |
legal_get_document(id, at?, include?) | GET /v1/legal/documents/{id} |
legal_get_effectivity(id, at?) | GET /v1/legal/documents/{id}/effectivity |
legal_get_relations(id, direction?, types?) | GET /v1/legal/documents/{id}/relations |
legal_changes(since, filters?) | GET /v1/legal/changes |
crawlpipe_usage() | GET /v1/usage |
Tool descriptions are written for agent consumption — they include the vocab
enums (doc_type, eff_status, relation_type, …) and the same citation
guidance as RAG with the search API, so an agent
calling legal_search gets a ready-to-cite result without extra prompting.
Metering
Because the MCP server calls the same REST API with your key, every tool
invocation is metered exactly like the equivalent REST call — legal_search
with mode: "hybrid" costs 2 units through MCP too. There's no separate MCP
pricing or quota.