Skip to main content
Glama

PeerDB MCP

CI Python 3.11+ License: MIT

Inspect replication pipelines, investigate sync errors, and manage CDC mirrors from your AI client.

PeerDB MCP connects your Model Context Protocol client to the PeerDB Flow REST API. Ask about pipeline status, review recent errors and batches, or request a pipeline change using 13 typed tools.

Community preview. MCP integration and API contract tests use a simulated gateway; live PeerDB compatibility is still being validated. Reports from real setups are welcome. This is an independent community project.

Quick start · Client setup · Tool reference · Troubleshooting · Contributing

What you can do

Ask your client…

PeerDB MCP provides…

“List my replication pipelines and their states.”

Mirror names, source/destination peers, and current states.

“Investigate the latest errors for orders_to_warehouse.”

Status, recent errors, CDC batches, and heuristic troubleshooting suggestions.

“Show the replication slots for postgres_source.”

PostgreSQL slot details and lag from PeerDB.

“Pause orders_to_warehouse, then check its state.”

A pause request and a separate status check, when writes are enabled.

You can also validate and create CDC mirrors, resume paused pipelines, and update batch size, idle timeout, snapshot settings, or table mappings. Diagnostics return evidence and possible next steps; they do not automatically repair replication.

Related MCP server: QuestLLens

Quick start

You need a reachable PeerDB Flow REST gateway, uv (which includes uvx), Git, and an MCP client that supports stdio. The server uses Python 3.11+; uv can provision a compatible Python when needed.

Add this to your client's MCP configuration. It starts in read-only mode:

{
  "mcpServers": {
    "peerdb": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/AMohammadzadeh/peerdb-mcp.git@main",
        "peerdb-mcp"
      ],
      "env": {
        "PEERDB_URL": "http://localhost:8113",
        "PEERDB_READ_ONLY": "true"
      }
    }
  }
}

Restart your client, then ask:

Check the PeerDB version, then list my pipelines. Do not change anything.

The client installs and launches the server automatically. localhost refers to the computer running the MCP process. Point the URL at the REST gateway; PeerDB's UI and gRPC ports serve different interfaces. Port 8113 is a common self-hosted gateway port—check your deployment.

For client-specific instructions, see Claude Desktop, Claude Code, Cursor, and Codex. For a fixed revision, replace @main with a full commit SHA. Installation currently uses GitHub; the package has not been published to PyPI.

Authentication

Set credentials through your client's environment or secure secret mechanism:

Gateway authentication

Variables to set

None

Only PEERDB_URL

Bearer token

PEERDB_TOKEN

HTTP Basic

Both PEERDB_USERNAME and PEERDB_PASSWORD

Choose one authentication method. See the configuration reference for examples and all environment variables. Use HTTPS for remote authenticated gateways. Pipeline logs and configuration are returned to your MCP client and may be sent to its model provider; review your client's data handling before use.

Enable pipeline changes

Set PEERDB_READ_ONLY to false and restart the MCP process to enable creation, pause, resume, and updates. The quick start explicitly enables read-only mode; the application's default when this variable is omitted is false.

Changes are asynchronous. An accepted request does not mean the operation has finished; check pipeline status afterward. See operation behavior.

Supported operations

Area

Coverage

Monitoring

Version, peers, CDC/QRep pipeline status, errors, CDC batches, PostgreSQL slots

Diagnostics

Per-pipeline evidence and heuristic findings, including partial results

CDC management

Validate, create, pause, resume, and update supported settings

QRep management

Pause/resume; creation and modification are not implemented

Transport

Local stdio, with outbound HTTP(S) to PeerDB

Peer creation, pipeline deletion, and automatic resync are not exposed. Managed ClickPipes compatibility has not been verified. Read the tool reference for arguments and API compatibility notes for the upstream source checked.

Verify your local setup

From a checkout on a computer that can reach PeerDB:

git clone https://github.com/AMohammadzadeh/peerdb-mcp.git
cd peerdb-mcp
uv sync --frozen
export PEERDB_URL=http://localhost:8113
uv run --frozen python -m peerdb_mcp.smoke --pipeline YOUR_EXISTING_MIRROR

Inject authentication variables if required. Omit --pipeline to check only MCP startup, version, and pipeline listing. The test forces read-only mode and prints a summary without URLs, credentials, pipeline names, or log contents. Failed or partial checks return a nonzero exit status. Passing checks establish API access, not replication health.

Feedback and contributions

Trying this with PeerDB? Report your results with your PeerDB version, MCP client, and a sanitized smoke-test summary. Please remove credentials and private data from anything you share.

Bug fixes, compatibility reports, documentation improvements, and focused feature requests are welcome. Start with CONTRIBUTING.md for development commands and the API contract conventions.

License

PeerDB MCP is available under the MIT License.

Available Tools

13 tools
create_pipelineB
Destructive

Validate and create a CDC pipeline using existing peers. May copy source data.

Inputs: config (required). Returns: object

diagnose_pipelineA
Read-onlyIdempotent

Combine status, recent errors and CDC batches with heuristic troubleshooting steps.

Reports partial results if a check fails. Never repairs or changes a pipeline.

Inputs: name (required), limit. Returns: object

get_peerdb_versionA
Read-onlyIdempotent

Check gateway connectivity and report the PeerDB version.

Inputs: no named parameters. Returns: object

get_peer_slotsB
Read-onlyIdempotent

Inspect PostgreSQL replication slots and lag for a source peer.

Inputs: peer_name (required). Returns: object

get_pipeline_batchesB
Read-onlyIdempotent

Get recent CDC batches to inspect throughput and sync progress; not for QRep.

Inputs: name (required), limit, before_id. Returns: object

get_pipeline_errorsB
Read-onlyIdempotent

Read paginated pipeline logs; defaults to the 20 most recent errors.

Inputs: name (required), page, level, limit. Returns: object

get_pipeline_statusB
Read-onlyIdempotent

Get pipeline state, configuration, snapshot progress and replication totals.

Inputs: name (required). Returns: object

list_peersA
Read-onlyIdempotent

List available source and destination peers for pipeline configuration.

Inputs: no named parameters. Returns: object

list_pipelinesA
Read-onlyIdempotent

List CDC and QRep pipelines, their peers and current states.

Inputs: no named parameters. Returns: object

pause_pipelineA
Destructive

Request pause of a running pipeline. Poll status to observe completion.

Inputs: name (required). Returns: object

resume_pipelineB
Destructive

Request resume of a paused pipeline. Poll status to observe completion.

Inputs: name (required). Returns: object

update_pipelineA
Destructive

Modify CDC batch size, idle timeout, snapshot settings or table mappings.

Requires running or paused state. Adding tables may start snapshots; removing tables stops their replication. Requests the observed state; avoid concurrent lifecycle changes.

Inputs: name (required), update (required). Returns: object

validate_pipelineA
Read-onlyIdempotent

Ask PeerDB to validate a CDC configuration without creating a pipeline.

Inputs: config (required). Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 13 tools

    Disambiguation5/5

    Each tool targets a distinct action or resource: lifecycle (create/pause/resume/update), listing (pipelines/peers), status/diagnostics (status/errors/batches/slots/diagnose/validate), and version. Overlap is minimal; diagnose_pipeline is composite but clearly distinct from raw status by including heuristic troubleshooting.

    Naming Consistency5/5

    All 13 tools use snake_case with a verb_noun pattern (e.g., get_peerdb_version, list_pipelines, create_pipeline). The convention is consistent throughout, with no deviations in style or case.

    Tool Count5/5

    13 tools is well-scoped for a pipeline management server, covering connectivity, inventory, lifecycle, diagnostics, and validation. No tool appears redundant or superfluous.

    Completeness3/5

    Core pipeline lifecycle is covered (create, read, update, pause/resume), but there is no delete_pipeline operation to remove a pipeline. Peer management is read-only (list_peers), and QRep pipelines lack dedicated diagnostic tools (get_pipeline_batches explicitly excludes QRep). These gaps may force agents to work around missing operations.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Gives AI agents read-only access to any QuestDB instance, enabling schema discovery, time-series querying, and monitoring of partitions, WAL state, symbols, and ingestion health through MCP.
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to securely connect to a vybeflow tenant for multi-channel messaging operations such as reading inbox tickets, looking up contacts, checking campaign progress, and sending messages under scoped permissions.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to query PostgreSQL databases securely with read-only defaults, PII masking, rate limiting, and human-approved, expiring mutation tokens.
      9
      1
      Apache 2.0