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
20.2K downloads
1 star

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.

Prerequisites

Before installing the AGE MCP Server, ensure you have:

  • Python 3.13 or above
  • Apache AGE extension enabled in your Azure Database for PostgreSQL instance
  • The AGE extension loaded in your PostgreSQL database

To load the AGE extension, run:

CREATE EXTENSION IF NOT EXISTS age CASCADE;

To enable the Apache AGE extension in Azure Database for PostgreSQL:

  1. Login to Azure Portal
  2. Go to 'server parameters' blade
  3. Check 'AGE' within 'azure.extensions' and 'shared_preload_libraries' parameters

Installation Options

Using Homebrew

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

Using UV

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

Configuration Setup

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.

Homebrew Installation (macOS)

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

UV/Python venv Installation (macOS)

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

UV/Python venv Installation (Windows)

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

Secure Connection Options

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:

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

Using with Visual Studio Code

After installing AGE MCP Server, configure it in VS Code:

  1. Go to [Preferences] → [Settings]
  2. Search for "mcp" in the settings search bar
  3. Edit settings.json with:
{
    "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 launch the AGE MCP Server
  2. Switch the Chat window to "agent" mode to start interacting with your graph database

Enabling Write Operations

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

Example Queries

Once configured, you can use natural language to interact with your graph database through Claude or VS Code:

  • "Show me graphs on the server"
  • "Show me a graph schema of [GRAPH_NAME]"
  • "Pick up a customer and calculate the amount of its purchase"
  • "Make a new graph named [GRAPH_NAME]"
  • "Make a node labeled 'Person' with properties, name=Rio, age=52"
  • "Put a relation, 'Rio WORKS at Microsoft'"
  • "Delete the graph [GRAPH_NAME]"

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