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:

ToolDescription
ingestIngest a local file (Markdown, text, HTML, PDF) into the knowledge graph
ingest_urlFetch and ingest a URL
querySemantic search over embedded document chunks
list_sourcesEnumerate all ingested sources with metadata
list_entitiesList extracted entities, optionally filtered by type or source
list_relationsList entity-to-entity relations
get_graphExport the full knowledge graph as JSON
add_entityManually add an entity
add_relationAdd a relation between two entities
update_entityUpdate an entity's name, type, or description
delete_entityDelete an entity and its relations
delete_sourceRemove a source and all its chunks, entities, and relations
update_sourceUpdate a source's title or metadata
get_statsReturn counts of sources, chunks, entities, and relations
resetDelete 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.