The Apache AGE MCP Server is a tool that allows AI assistants to interact with PostgreSQL graph databases using the Model Context Protocol (MCP). It enables AI systems to query, visualize, and manipulate graph data stored in Apache AGE, a PostgreSQL extension for graph database functionality.
Before installing the AGE MCP Server, ensure you have:
To load the AGE extension, run:
CREATE EXTENSION IF NOT EXISTS age CASCADE;
To enable the Apache AGE extension in Azure Database for PostgreSQL:
brew tap rioriost/age-mcp-server
brew install age-mcp-server
uv init your_project
cd your_project
uv venv
source .venv/bin/activate
uv add age-mcp-server
mkdir your_project
cd your_project
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install age-mcp-server
mkdir your_project
cd your_project
python -m venv venv
.\venv\Scripts\activate
python -m pip install age-mcp-server
On macOS, edit the claude_desktop_config.json
file located at ~/Library/Application Support/Claude/
.
On Windows, create a new claude_desktop_config.json
file under %APPDATA%\Claude
.
{
"mcpServers": {
"age-manager": {
"command": "age-mcp-server",
"args": [
"--pg-con-str",
"host=your_server.postgres.database.azure.com port=5432 dbname=postgres user=your_username password=your_password"
]
}
}
}
{
"mcpServers": {
"age-manager": {
"command": "/Users/your_username/.local/bin/uv",
"args": [
"--directory",
"/path/to/your_project",
"run",
"age-mcp-server",
"--pg-con-str",
"host=your_server.postgres.database.azure.com port=5432 dbname=postgres user=your_username password=your_password"
]
}
}
}
{
"mcpServers": {
"age-manager": {
"command": "C:\\Users\\USER\\.local\\bin\\uv.exe",
"args": [
"--directory",
"C:\\path\\to\\your_project",
"run",
"age-mcp-server",
"--pg-con-str",
"host=your_server.postgres.database.azure.com port=5432 dbname=postgres user=your_username password=your_password"
]
}
}
}
To hide the password or use Entra ID authentication:
{
"mcpServers": {
"age-manager": {
"command": "age-mcp-server",
"args": [
"--pg-con-str",
"host=your_server.postgres.database.azure.com port=5432 dbname=postgres user=your_username"
]
}
}
}
Additionally, you need to either:
PGPASSWORD
environment variable, orAfter installing AGE MCP Server, configure it in VS Code:
{
"mcp": {
"inputs": [],
"servers": {
"age-manager": {
"command": "/Users/your_user_name/.local/bin/uv",
"args": [
"--directory",
"/path/to/your_project",
"run",
"age-mcp-server",
"--pg-con-str",
"host=your_server.postgres.database.azure.com port=5432 dbname=postgres user=your_username password=your_password",
"--debug"
]
}
}
}
}
By default, AGE MCP Server prohibits write operations for safety. To enable write operations, add the --allow-write
flag:
{
"mcpServers": {
"age-manager": {
"command": "age-mcp-server",
"args": [
"--pg-con-str",
"host=your_server.postgres.database.azure.com port=5432 dbname=postgres user=your_username password=your_password",
"--allow-write"
]
}
}
}
Once configured, you can use natural language to interact with your graph database through Claude or VS Code:
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "age-manager" '{"command":"age-mcp-server","args":["--pg-con-str","host=your_server.postgres.database.azure.com port=5432 dbname=postgres user=your_username password=your_password"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"age-manager": {
"command": "age-mcp-server",
"args": [
"--pg-con-str",
"host=your_server.postgres.database.azure.com port=5432 dbname=postgres user=your_username password=your_password"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"age-manager": {
"command": "age-mcp-server",
"args": [
"--pg-con-str",
"host=your_server.postgres.database.azure.com port=5432 dbname=postgres user=your_username password=your_password"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect