get_or_create_graphLABSCO SUMMARY
Semantic seeds, then walk the graph from them.
graph_context is the tool that justifies putting a graph behind an assistant at all: vector search finds the entry points, and the N-hop expansion brings back what they connect to, which plain similarity search cannot do. Everything upserts by ident, so re-running an ingest updates rather than duplicates.
What it is
An MCP server for Apache AGE graph databases, written in F# on .NET 10. It lets an assistant read and write graph data, run Cypher directly, and — with an embedding endpoint configured — search by meaning and expand from the results.
What you get
- Graph management —
get_or_create_graph,list_graphs,drop_graphs - Vertices and edges —
upsert_vertexandupsert_edgemerge on ident rather than overwriting,upsert_graphbatches both transactionally,drop_vertexremoves a vertex and its edges,drop_edgeremoves one by ident - Query —
cypher_queryfor reads,cypher_writefor writes returning an affected count,search_vertices,search_edges,get_neighborsfor 1–5 hop directional traversal,get_schemafor labels and counts - Export and import —
export_graphto JSON,import_graphback, creating the graph if needed - Visualization and search —
generate_visualizationrenders an interactive vis.js graph,semantic_searchdoes vector similarity over pgvector,graph_contextcombines semantic seeds with N-hop expansion for Graph RAG - OpenBrain bridge —
sync_to_openbrain,import_from_openbrain
Requirements
Install with dotnet tool install --global AgeMcp and run age-mcp over stdio. AGE_CONNECTION_STRING is required — an Npgsql connection string pointing at PostgreSQL with Apache AGE. TENANT_ID defaults to default and prefixes every graph name as t_{TENANT_ID}__{graph_name}, which is how multi-tenancy works. semantic_search and graph_context additionally need EMBEDDING_API_URL pointing at an OpenAI-compatible embedding endpoint, with EMBEDDING_MODEL defaulting to text-embedding-3-small and EMBEDDING_DIMENSIONS to 384 — the dimensions must match the model's output. A Docker setup running PostgreSQL 17 with Apache AGE 1.6.0 and pgvector is included.
Setup effort
One command plus credentials — dotnet tool install --global AgeMcp, then supply credentials
USE CASES
Answering a question that needs relationships, not just matches
Seed with semantic search and expand outward through the graph.
Loading a dataset into a graph safely
Batch the vertices and edges into one transaction, merging on ident so a re-run does not duplicate.
Exploring what is actually in there
Read the labels and counts, then walk out from a node a few hops.
Showing the graph to someone
Generate an interactive HTML view, or export the whole graph as JSON.
21 tools
Listed in project docs. Your client may show a different list.
list_graphsdrop_graphsupsert_vertexdrop_vertexupsert_edgedrop_edgeupsert_graphcypher_querycypher_writesearch_verticessearch_edgesget_neighborsget_schemaexport_graphimport_graphgenerate_visualizationsemantic_searchgraph_contextsync_to_openbrainimport_from_openbrainBEFORE YOU INSTALL
What to know first
Tools you get
21 tools named in the project's documentation.
Requires
- age-mcp on PATH
- AGE_CONNECTION_STRING in your environment
Where it runs
Both documented clients run the server on your machine.
INSTALLATION
Connect your client
Server setup
dotnet tool install --global AgeMcpMCP Clients
Claude Desktop, Claude Code
{
"mcpServers": {
"age-mcp": {
"type": "stdio",
"command": "age-mcp",
"env": {
"AGE_CONNECTION_STRING": "Host=localhost;Port=5435;Database=agemcp;Username=agemcp;Password=agemcp",
"TENANT_ID": "default"
}
}
}
}