Get the FREE Ultimate OpenClaw Setup Guide →

homebrew-age

Apache AGE MCP Server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio rioriost-homebrew-age-mcp-server age-mcp-server --pg-con-str host=your_server.postgres.database.azure.com port=5432 dbname=postgres user=your_username password=your_password --allow-write \
  --env PGPASSWORD="your Azure PostgreSQL password or placeholder"

How to use

AGE-MCP-Server is an MCP server wrapper around the Apache AGE extension for PostgreSQL, designed to manage and query graph data stored in Azure Database for PostgreSQL or other PostgreSQL instances with AGE enabled. It exposes a simple command-line interface (age-mcp-server) that connects to your PostgreSQL instance using a provided connection string and executes graph operations through the AGE extension. This server integrates with MCP tooling and can be driven from Claude, Visual Studio Code, or other MCP clients to create, query, and manipulate graph structures without directly writing Cypher-like queries. By default, write operations are disabled for safety, but you can enable them with a flag when you start the server.

Usage scenarios include pulling graph data into interactive clients, creating graphs and nodes, and performing graph traversals or pattern queries via the MCP workflow. For local development, you can run the server from a Python virtual environment after installing age-mcp-server, or install via Homebrew for macOS and start it with the appropriate PostgreSQL connection string. The tooling works with Claude Desktop Client and Visual Studio Code Insiders, enabling graphical query construction and result visualization from within those environments.

How to install

Prerequisites:

  • Python 3.13 or newer (for the Python/venv installation path)
  • PostgreSQL with the AGE extension loaded (CREATE EXTENSION IF NOT EXISTS age CASCADE;)
  • Access to a PostgreSQL server (host, port, database, user, password)

Install options:

  1. Install via Homebrew (macOS) brew tap rioriost/age-mcp-server brew install age-mcp-server

    Start using the age-mcp-server command

  2. Install with uv (uv tool for Python projects) uv init your_project cd your_project uv venv source .venv/bin/activate uv add age-mcp-server

    Start the server with the configured --pg-con-str

  3. Install with a Python virtual environment mkdir your_project cd your_project python3 -m venv .venv source .venv/bin/activate python3 -m pip install age-mcp-server

    Run via age-mcp-server with the appropriate arguments

Example run (typical): age-mcp-server --pg-con-str "host=your_server.postgres.database.azure.com port=5432 dbname=postgres user=your_username password=your_password" [--allow-write]

Note: If using uv or a virtual environment, ensure the environment is activated and the path to age-mcp-server is correct in your startup command.

Additional notes

Tips and common issues:

  • Ensure the AGE extension is loaded on your PostgreSQL instance and that you can CREATE EXTENSION IF NOT EXISTS age CASCADE;. Verify connectivity with the provided host, port, and credentials before starting the MCP server.
  • When using uv or a Python virtual environment, activate the environment prior to launching age-mcp-server to ensure dependencies are available.
  • By default, write operations are disabled. To enable writes, add the --allow-write flag to the age-mcp-server command and ensure your user has appropriate permissions.
  • If you need to hide credentials, consider using a connection string without password in the CLI and set PGPASSWORD environment variable or use a secret store.
  • For Claude integration, configure claude_desktop_config.json with the appropriate command and arguments to point to age-mcp-server and the pg-con-str. For VSCode, update the mcp settings with the uv or age-mcp-server executable path and pass the pg-con-str as shown in the README.
  • Keep yourAGE-related dependencies updated to avoid compatibility issues, as noted in the project release notes.

Related MCP Servers

Sponsor this space

Reach thousands of developers