Skip to main content

Apache AGE MCP Server

Project description

AGE-MCP-Server

License Python

Apache AGE MCP Server

Apache AGE™ is a PostgreSQL Graph database compatible with PostgreSQL's distributed assets and leverages graph data structures to analyze and use relationships and patterns in data.

Azure Database for PostgreSQL is a managed database service that is based on the open-source Postgres database engine.

Introducing support for Graph data in Azure Database for PostgreSQL (Preview).

Table of Contents

Prerequisites

  • Python 3.13 and above
  • This module runs on psycopg
  • Enable the Apache AGE extension in your Azure Database for PostgreSQL instance. Login Azure Portal, go to 'server parameters' blade, and check 'AGE" on within 'azure.extensions' and 'shared_preload_libraries' parameters. See, above blog post for more information.
  • Load the AGE extension in your PostgreSQL database.
CREATE EXTENSION IF NOT EXISTS age CASCADE;
brew install claude
brew intall visual-studio-code

Install

  • with brew
brew tap rioriost/age-mcp-server
brew install age-mcp-server
  • with uv
uv init your_project
cd your_project
uv venv
source .venv/bin/activate
uv add age-mcp-server
  • with python venv on macOS / Linux
mkdir your_project
cd your_project
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install age-mcp-server
  • with python venv on Windows
mkdir your_project
cd your_project
python -m venv venv
.\venv\Scripts\activate
python -m pip install age-mcp-server

Usage with Claude

  • on macOS claude_desktop_config.json is located in ~/Library/Application Support/Claude/.

  • on Windows You need to create a new claude_desktop_config.json under %APPDATA%\Claude.

  • Homebrew on macOS

Homebrew installs age-mcp-server into $PATH.

{
  "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 / Pyhon venv

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

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

If you need to hide the password or to use Entra ID, you can set --pg-con-str as follows.

{
  "mcpServers": {
    "age-manager": {
        ...
        "--pg-con-str",
        "host=your_server.postgres.database.azure.com port=5432 dbname=postgres user=your_username",
        ...
      ]
    }
  }
}

And, you need to set PGPASSWORD env variable, or to install Azure CLI and sign into Azure with your Azure account.

After saving claude_desktop_config.json, start Claude Desktop Client.

Show me graphs on the server Show me a graph schema of FROM_AGEFREIGHTER Pick up a customer and calculate the amount of its purchase. Find another customer buying more than Lisa OK. Please make a new graph named MCP_Test Make a node labeled 'Person' with properties, name=Rio, age=52 Please make an another node labeled 'Company' with properties, name=Microsoft Can you put a relation, "Rio WORK at Microsoft"? Delete the graph, MCP_Test

Claude on Windows

Usage with Visual Studio Code

After installing, [Preferences]->[Settings] and input mcp to [Search settings].

MCP Settings in Preferences

Edit the settings.json as followings:

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

And then, you'll see start to start the AGE MCP Server.

Switch the Chat window to agent mode.

VSCode Agent

Now, you can play with your graph data via Visual Studio Code!

VSCode Agent

Write Operations

AGE-MCP-Server prohibits write operations by default for safety. If you want to enable write operations, you can use 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"
      ]
    }
  }
}

Release Notes

0.2.34 Release

  • Dependency Update

0.2.32 Release

  • Dependency Update

0.2.31 Release

  • Dependency Update

0.2.30 Release

  • Dependency Update

0.2.29 Release

  • Dependency Update

0.2.28 Release

  • Dependency Update

0.2.27 Release

  • Dependency Update

0.2.26 Release

  • Dependency Update

0.2.25 Release

  • Dependency Update

0.2.24 Release

  • Dependency Update

0.2.23 Release

  • Dependency Update

0.2.22 Release

  • Dependency Update

0.2.21 Release

  • Dependency Update

0.2.20 Release

  • Dependency Update

0.2.19 Release

  • Dependency Update

0.2.18 Release

  • Dependency Update

0.2.17 Release

  • Dependency Update

0.2.16 Release

  • Dependency Update

0.2.15 Release

  • Dependency Update

0.2.14 Release

  • Dependency Update

0.2.13 Release

  • Dependency Update

0.2.12 Release

  • Dependency Update

0.2.11 Release

  • Dependency Update

0.2.10 Release

  • Dependency Update

0.2.9 Release

  • Dependency Update

0.2.8 Release

  • Add support for VSCode(Stable)

0.2.7 Release

  • Add support for VSCode Insiders

0.2.6 Release

  • Fix a typo

0.2.5 Release

  • Support connection with Entra ID

0.2.4 Release

  • Dependency Update

0.2.3 Release

  • Dependency Update

0.2.2 Release

  • Drop a conditional test of CREATE operation by adding RETURN to the description for write-age-cypher tool.

0.2.1 Release

  • Fix a bug in node/edge creation

0.2.0 Release

  • Add multiple graph support
  • Add graph creation and deletion support
  • Obsolete --graph-name argument

0.1.8 Release

  • Add --allow-write flag

0.1.7 Release

  • Add Windows support

0.1.6 Release

  • Fix parser for RETURN values

0.1.5 Release

  • Draft release

0.1.4 Release

  • Draft release

0.1.3 Release

  • Draft release

0.1.2 Release

  • Draft release

0.1.1 Release

  • Draft release

0.1.0a1 Release

  • Draft release

For More Information

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

age_mcp_server-0.2.34.tar.gz (2.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

age_mcp_server-0.2.34-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file age_mcp_server-0.2.34.tar.gz.

File metadata

  • Download URL: age_mcp_server-0.2.34.tar.gz
  • Upload date:
  • Size: 2.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.6

File hashes

Hashes for age_mcp_server-0.2.34.tar.gz
Algorithm Hash digest
SHA256 b401b4424691682c5f4ef70442efdda3f08d56aa10866864146624a66b341939
MD5 ad6b1a5dfa0871914f7e6830c77182e9
BLAKE2b-256 baaf0f2f6f21fbc90f3c0200509ca75d093bd7485990f9ad43d40bb94ce9aef0

See more details on using hashes here.

File details

Details for the file age_mcp_server-0.2.34-py3-none-any.whl.

File metadata

File hashes

Hashes for age_mcp_server-0.2.34-py3-none-any.whl
Algorithm Hash digest
SHA256 66dde7ba38d1c2945d2d18028333551ee7e6b3bdb055eb91d30e9c6053c8dfa4
MD5 6a25a7f87aa7249fbb8f59097b80a2b0
BLAKE2b-256 0ff3359aed7bb23eddad9a6d13d89da8e86c3463f65566d0ac0f323f060a4664

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page