DocForge exposes a stdio MCP server (docforge-mcp) that wraps the REST API.
pip install -e /path/to/docforge
# or from repo root after clone:
pip install -e .Verify: docforge-mcp should be on PATH.
{
"mcpServers": {
"docforge": {
"command": "docforge-mcp",
"env": {
"DOCFORGE_API_URL": "http://127.0.0.1:8787",
"DOCFORGE_API_KEY": "df_OPTIONAL_AFTER_REGISTER"
}
}
}
}Use the cursor_config object from POST /api/v1/agents/register unchanged.
| Variable | Required | Description |
|---|---|---|
DOCFORGE_API_URL |
Yes | Base URL of running DocForge API |
DOCFORGE_API_KEY |
After register | Auto-sent as X-DocForge-Key on tool calls |
No auth. Returns full manifest JSON (same as GET /api/v1/agent-manifest).
No auth.
{
"name": "my-agent",
"description": "Optional description",
"capabilities": ["ingest", "chunk"],
"webhook_url": null,
"metadata": {}
}Returns agent id, api_key, cursor_config. Save api_key immediately.
No auth. Lists registered agents (no secrets).
No auth. Returns API status and version.
Requires API key (param or DOCFORGE_API_KEY env). Returns your agent profile.
{
"file_path": "/absolute/or/~/path/to/file.pdf",
"api_key": "optional df_…"
}Returns Markdown, token estimate, metadata.
{
"markdown": "# Title\n\nBody…",
"strategy": "headings",
"max_tokens": 512,
"overlap_tokens": 64,
"min_heading_level": 1,
"max_heading_level": 3,
"include_heading_path": true,
"token_model": "cl100k_base"
}Full pipeline — preferred for RAG ingest.
{
"file_path": "/path/to/document.docx",
"strategy": "headings",
"max_tokens": 512
}Returns markdown, chunks[], token totals, document_id.
get_agent_manifest— discover endpointsregister_agent— once per identity- Update MCP env with
DOCFORGE_API_KEY ingest_document— for each source file- Push
chunks[]to your vector store
Tools return JSON error objects when files are missing or the API returns 4xx/5xx. Check DOCFORGE_API_URL points to a running server (docforge-api or ./scripts/dev.sh).