| name | docforge |
|---|---|
| description | Register and use DocForge to convert PDF/HTML/DOCX/text into clean Markdown and deterministic RAG chunks with token estimates. Use when ingesting documents for vector stores, RAG pipelines, agent document processing, DocForge self-registration, df_ API keys, or connecting to docforge-mcp. |
DocForge provides document ingest and agent self-registration via MCP (stdio) and REST.
- Fetch
GET {DOCFORGE_ORIGIN}/api/v1/agent-manifest(or read repoAGENTS.md). - If you lack a
df_…API key, self-register (once per agent identity). - Use the key via
X-DocForge-Keyheader orDOCFORGE_API_KEYMCP env — never log or commit it.
Replace {DOCFORGE_ORIGIN} with the deployment URL or http://127.0.0.1:8787 locally.
POST {DOCFORGE_ORIGIN}/api/v1/agents/register
Content-Type: application/json
{
"name": "<agent-name>",
"description": "<optional>",
"capabilities": ["ingest", "chunk", "convert"]
}Save api_key, id, cursor_config, and mcp_env from the JSON response.
- Connect MCP with command
docforge-mcpand envDOCFORGE_API_URL={DOCFORGE_ORIGIN}. - Call
get_agent_manifestto discover endpoints (optional). - Call
register_agentwith{ "name": "…" }. - Save
api_key; setDOCFORGE_API_KEYin MCP env for later calls.
Tool: ingest_document
{
"file_path": "/path/to/document.pdf",
"strategy": "headings",
"max_tokens": 512
}Returns markdown, chunks[], document_id, token totals.
Other tools: convert_document (Markdown only), chunk_markdown (chunk existing MD).
Tool: agent_whoami — requires key, confirms registration.
POST {DOCFORGE_ORIGIN}/api/v1/ingest
X-DocForge-Key: df_…
Content-Type: multipart/form-data
file=@document.pdf
strategy=headings
max_tokens=512| Strategy | Use when |
|---|---|
headings |
Structured docs with sections |
size |
Fixed token windows, unstructured text |
See {DOCFORGE_ORIGIN}/docs/agents/chunking.md for parameters.
After registration, use cursor_config from the register response:
{
"mcpServers": {
"docforge": {
"command": "docforge-mcp",
"env": {
"DOCFORGE_API_URL": "http://127.0.0.1:8787",
"DOCFORGE_API_KEY": "df_<FROM_REGISTER_RESPONSE>"
}
}
}
}- Do not re-register repeatedly; one
api_keyper agent identity. - Do not expose
api_keyin output unless the user explicitly needs it for setup. - Prefer
ingest_documentover manual convert+chunk for RAG pipelines. - Use chunk
idfor idempotent vector store upserts. - Handle document content per the user's data classification policy.
| Doc | Path |
|---|---|
| Agent guide | {DOCFORGE_ORIGIN}/AGENTS.md |
| FAQ (AEO) | {DOCFORGE_ORIGIN}/docs/faq.md |
| LLM index | {DOCFORGE_ORIGIN}/llms.txt |
| MCP reference | {DOCFORGE_ORIGIN}/docs/agents/mcp.md |
| REST reference | {DOCFORGE_ORIGIN}/docs/agents/rest.md |
| Chunking | {DOCFORGE_ORIGIN}/docs/agents/chunking.md |
| Manifest | {DOCFORGE_ORIGIN}/api/v1/agent-manifest |
For common questions (formats, registration, MCP setup, troubleshooting), read the FAQ first.
Repo copies: AGENTS.md, .cursor/skills/docforge/SKILL.md at project root.