MCP Server
Connect Cograph to AI agents via the Model Context Protocol.
What is MCP?
The Model Context Protocol (MCP) lets AI agents call tools on external systems. Cograph exposes an MCP server so agents like Claude, Cursor, Windsurf, and custom agents can query your knowledge graphs directly.
Setup
Grab an API key from your dashboard, then add this to your MCP client configuration (e.g., Claude Code settings, Cursor config, or ~/.claude/mcp.json):
{
"mcpServers": {
"cograph": {
"command": "npx",
"args": ["-y", "cograph-mcp"],
"env": {
"COGRAPH_API_KEY": "sk_live_..."
}
}
}
}The server connects to https://api.cograph.cloud by default. Override with COGRAPH_API_URL if self-hosting.
Available Tools
ask
Ask a natural language question against a knowledge graph.
| question | string, required | The question to ask |
| kg_name | string, optional | Target knowledge graph name |
list_knowledge_graphs
List all available knowledge graphs and their descriptions. No parameters.
ingest_csv
Ingest a CSV file into a knowledge graph. Schema is automatically inferred.
| file_path | string, required | Absolute path to the CSV file |
| kg_name | string, required | Name for the knowledge graph |
view_ontology
View the ontology (types, attributes, relationships) across all knowledge graphs. No parameters.
Example Usage
Once configured, you can interact with your knowledge graphs from any MCP-compatible agent:
> "What knowledge graphs do I have?"
→ calls list_knowledge_graphs()
> "How many events in San Francisco are free?"
→ calls ask(question="...", kg_name="events-sf")
> "Ingest this sales data"
→ calls ingest_csv(file_path="/path/to/sales.csv", kg_name="sales-2026")