AGE-MCP-Server
Integrates with Apache AGE, a PostgreSQL extension that provides graph database functionality. Enables querying graph data structures, analyzing relationships between nodes, and performing graph operations.
Integrates with PostgreSQL databases, specifically with the Apache AGE extension that enables graph database capabilities in PostgreSQL. Allows querying, creating, and managing graph data structures.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AGE-MCP-Servershow me all customers who purchased more than $1000 last month"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AGE MCP Server
An MCP server for querying Apache AGE graphs in PostgreSQL.
Version 0.3.0 makes read-only operation the secure default, adds asynchronous connection pooling, safe Cypher parameters and bounded cursor pagination, and returns MCP structured content from every tool.
Requirements
Python 3.13 or later
PostgreSQL with the Apache AGE extension installed and loaded
A database role restricted to the graphs and operations the MCP client needs
Enable AGE in the target database:
CREATE EXTENSION IF NOT EXISTS age CASCADE;Related MCP server: Neo4j GraphRAG MCP Server
Install
With uv:
uv init your_project
cd your_project
uv add age_mcp_serverWith a Python virtual environment:
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install age_mcp_serverWith Homebrew:
brew install rioriost/tap/age_mcp_serverConfigure an MCP client
Avoid placing a database password in command-line arguments. Supply a connection
string through PG_CONNECTION_STRING and use one of libpq's credential mechanisms,
such as PGPASSWORD or a protected PostgreSQL password file.
{
"mcpServers": {
"age_manager": {
"command": "age_mcp_server",
"env": {
"PG_CONNECTION_STRING": "host=db.example port=5432 dbname=postgres user=age_reader sslmode=require",
"PGPASSWORD": "replace-with-a-secret"
}
}
}
}Treat the MCP client configuration as a secret if it contains PGPASSWORD. A
PostgreSQL password file or the client's secret store is preferable.
The connection string can still be supplied explicitly when necessary:
age_mcp_server --pg-con-str "host=db.example dbname=postgres user=age_reader sslmode=require"For Microsoft Entra authentication to Azure Database for PostgreSQL, first sign in with the Azure CLI, then opt in to token acquisition:
age_mcp_server \
--pg-con-str "host=server.postgres.database.azure.com dbname=postgres user=identity sslmode=require" \
--azure-identityTools
Read-only mode is the default:
Tool | Purpose |
| Run a validated, parameterized, paginated read-only Cypher query |
| List Apache AGE graphs |
| Inspect counts, directions, and sampled property types |
Write tools are only advertised and accepted when the server starts with
--allow-write:
Tool | Purpose |
| Run Cypher containing a mutating clause |
| Create a graph |
| Permanently drop a graph |
age_mcp_server --allow-writeUse a separate, least-privileged database role for write mode. Enabling the flag does not grant PostgreSQL privileges that the configured role does not already have.
Safety limits
Cypher, graph names, return aliases, and graph-management arguments are safely quoted or parameterized before reaching PostgreSQL.
Read tools run inside PostgreSQL read-only transactions.
CALLis considered side-effecting and requires write mode.Read pages contain at most 50 rows. Opaque HMAC-authenticated cursors are bound to the graph, query, and parameters, with a maximum offset of 100,000.
Cypher
$parametersare accepted only when placeholder names exactly match a JSON parameter object. The object is capped at 100,000 bytes and passed to AGE through a prepared statement.Write queries execute fully and return an affected-row count instead of result rows.
Statements time out after 30 seconds by default.
Queries are limited to 100,000 characters and must contain one explicit
RETURNclause per query branch.Raw database errors, query contents, and connection credentials are not returned to MCP clients or written to normal logs.
Change the timeout when needed:
age_mcp_server --statement-timeout-ms 60000The timeout must be between 1 millisecond and 1 hour.
Tune the asynchronous connection pool or load the AGE library for every newly opened pooled connection:
age_mcp_server --pool-min-size 2 --pool-max-size 8 --load-ageThe pool must satisfy 1 <= min <= max <= 64. RETURN * remains unsupported;
list return values explicitly so Apache AGE's SQL result types can be declared.
Example tool input with parameters and pagination:
{
"graph_name": "people",
"query": "MATCH (n:Person) WHERE n.age >= $minimum RETURN n.name AS name ORDER BY name",
"parameters": {"minimum": 18},
"page_size": 25
}Pass the returned nextCursor as cursor to fetch the next page.
OpenTelemetry
Install the optional exporter dependencies and enable OTLP export:
python3 -m pip install "age_mcp_server[telemetry]"
age_mcp_server --enable-telemetry --otel-service-name age-productionThe exporter follows standard OTEL_EXPORTER_OTLP_* environment variables.
Traces and metrics record operation latency, counts, and failures. Connection
details, Cypher text, parameter values, and raw database errors are excluded.
Development
Install all development dependencies and run the release gate:
make sync
make checkmake check runs Ruff, the 80% coverage gate, Bandit, the locked dependency audit,
and package builds. The test suite includes a live Apache AGE integration test:
AGE_TEST_CONNECTION_STRING="host=127.0.0.1 dbname=postgres user=postgres password=postgres" \
make integrationCI runs this test against the official Apache AGE PostgreSQL container. See the 0.3.0 review for the completed security and feature review.
License
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceAn MCP server that enables graph database interactions with Neo4j, allowing users to access and manipulate graph data through natural language commands.
- AlicenseAqualityCmaintenanceAn MCP server that enables LLMs to perform semantic and fulltext searches within Neo4j while executing complex, search-augmented Cypher queries for GraphRAG applications. It provides tools for database schema discovery and supports multi-provider embeddings to facilitate advanced graph traversals.52MIT
- Alicense-qualityDmaintenanceA Model Context Protocol (MCP) Server that allows AI models to securely interact with data hosted in Azure Database for PostgreSQL. It enables natural language querying, schema exploration, and data management through MCP clients like Claude Desktop and Visual Studio Code.MIT
- Alicense-qualityBmaintenanceA read-only MCP server that connects Claude to the Northwind sample PostgreSQL database, allowing natural language queries to generate SQL and charts.2MIT
Related MCP Connectors
GibsonAI MCP server: manage your databases with natural language
MCP server giving Claude AI access to 22+ NYC public-record databases for real estate due diligence
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/rioriost/age_mcp_server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server