Apache AGE Graph MCP server

Bridges Claude with PostgreSQL databases using Apache AGE graph extension, enabling natural language execution of Cypher queries for graph operations, relationship analysis, and data visualization without complex SQL.
Back to servers
Setup instructions
Provider
Rio Fujita
Release date
Mar 19, 2025
Language
Python
Package
Stats
22.2K downloads
1 star

Apache AGE MCP Server is a tool that enables PostgreSQL Graph database capabilities in Azure Database for PostgreSQL. This server implements the Model Context Protocol (MCP), allowing AI assistants like Claude and Visual Studio Code to interact with graph databases through natural language.

Prerequisites

Before installing the AGE MCP Server, you'll need:

  • Python 3.13 or higher
  • Apache AGE extension enabled in your Azure Database for PostgreSQL instance
  • Claude Desktop Client or Visual Studio Code Insiders

To enable the AGE extension in your PostgreSQL database:

CREATE EXTENSION IF NOT EXISTS age CASCADE;

Installation Options

Using Homebrew

brew tap rioriost/age-mcp-server
brew install age-mcp-server

Using UV Package Manager

uv init your_project
cd your_project
uv venv
source .venv/bin/activate
uv add age-mcp-server

Using Python venv (macOS/Linux)

mkdir your_project
cd your_project
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install age-mcp-server

Using Python venv (Windows)

mkdir your_project
cd your_project
python -m venv venv
.\venv\Scripts\activate
python -m pip install age-mcp-server

Using with Claude

Configuring Claude Desktop Client

On macOS

Edit the claude_desktop_config.json file located in ~/Library/Application Support/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"
      ]
    }
  }
}

On Windows

Create a new claude_desktop_config.json file in %APPDATA%\Claude:

{
  "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"
      ]
    }
  }
}

Using with Python venv

For macOS (example with UV):

{
  "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"
      ]
    }
  }
}

Using Entra ID Authentication

To avoid exposing passwords in your configuration, you can omit the password:

{
  "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"
      ]
    }
  }
}

Then either:

  • Set the PGPASSWORD environment variable, or
  • Install Azure CLI and sign into Azure with your account

Using with Visual Studio Code

After installation, configure VS Code:

  1. Go to Preferences > Settings and search for "mcp"
  2. Edit settings.json:
{
    "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"
            ]
            }
        }
    }
}
  1. Click "start" to start the AGE MCP Server
  2. Switch the Chat window to "agent" mode to interact with your graph database

Enabling Write Operations

By default, AGE-MCP-Server prohibits write operations for safety. To enable them, 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"
      ]
    }
  }
}

How to install this MCP server

For Claude 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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later