MCP
The Model Context Protocol (MCP) server lets AI agents — Claude Desktop, Cursor, or any MCP-aware tool — traverse your knowledge graph rather than just search flat text chunks. Agents can query entities, follow connections, and reason across the full graph as if it were a first-class context source.
What the MCP server does
The docgraph-mcp server exposes your knowledge graph as a set of tools that an agent
can call during a conversation. Instead of pasting excerpts, the agent can ask
"find every contract that mentions the Acme SLA and summarise what we actually promised"
and the server will traverse the graph, returning documents, entities, and the edges
between them.
The server runs as a stdio MCP server — it speaks the MCP protocol over standard input/output, which is the format that Claude Desktop and most MCP clients expect.
Connecting Claude Desktop
Add an entry to your claude_desktop_config.json. The command is the docgraph-mcp
binary and the args tell it to start the MCP server in stdio mode:
{
"mcpServers": {
"docgraph": {
"command": "docgraph-mcp",
"args": ["serve"]
}
}
}
Once saved, restart Claude Desktop. The docgraph tools will appear in any new
conversation — no further configuration needed.
HTTP mode with Google OAuth
For remote access or team setups, docgraph-mcp serve-http starts an HTTP MCP
server protected by Google OAuth:
GOOGLE_CLIENT_ID="..." GOOGLE_CLIENT_SECRET="..." docgraph-mcp serve-http --addr :8080
The HTTP server implements a full OAuth 2.0 authorization flow and exposes the MCP
endpoint at POST /mcp (requires a bearer token obtained via the OAuth flow).
Connecting other MCP-aware agents
Any agent or tool that can launch a child process over stdio can connect to the
docgraph-mcp server using "command": "docgraph-mcp" and "args": ["serve"].
Refer to your agent's documentation for where to specify MCP server entries.
What agents can do
Once connected, an agent has access to the following tools:
| Tool | Description |
|---|---|
ingest | Ingest a local file (Markdown, text, HTML, PDF) into the knowledge graph |
ingest_url | Fetch and ingest a URL |
query | Semantic search over embedded document chunks |
list_sources | Enumerate all ingested sources with metadata |
list_entities | List extracted entities, optionally filtered by type or source |
list_relations | List entity-to-entity relations |
get_graph | Export the full knowledge graph as JSON |
add_entity | Manually add an entity |
add_relation | Add a relation between two entities |
update_entity | Update an entity's name, type, or description |
delete_entity | Delete an entity and its relations |
delete_source | Remove a source and all its chunks, entities, and relations |
update_source | Update a source's title or metadata |
get_stats | Return counts of sources, chunks, entities, and relations |
reset | Delete all data (dangerous — no undo) |
The graph is your corpus: every document you upload in Document Analyser is indexed and made available through these tools.
Note
The MCP server reads from the same knowledge graph that powers your Document Analyser web app. Changes you make in the app (uploading, tagging) are reflected in the MCP server the next time it processes a query.