Skip to main content

Multi-tenant MCP server that shares microservice API contracts between AI coding assistants

Project description

mcp-service-registry

An MCP server that lets multiple AI coding assistants (Claude Code, Cursor, etc.) share microservice API contracts. A developer working on one service can look up another service's real endpoints and field names — instead of guessing and creating mismatched integrations.

Example: "Billing" needs to call "Inventory". Instead of inventing field names, Billing's AI asks the registry and gets the exact Stock Request contract (itemId, quantity, warehouseId, requestedBy).


Which user are you?

I want to... Do this
Look up other services' APIs (most people) Connect to a running registry — just a URL, no install
Run my own registry (host it) Self-host — install + database

A. Connect to a running registry (no install)

If your team already has a registry running (for example on Render), you only need its URL. Nothing to install.

Claude Code:

claude mcp add --transport http registry https://YOUR-REGISTRY-URL/mcp

Or add it manually to your MCP config:

{
  "mcpServers": {
    "registry": {
      "type": "http",
      "url": "https://YOUR-REGISTRY-URL/mcp"
    }
  }
}

Then just ask your assistant, for example:

  • "Using the registry, what services exist?"
  • "What fields does the inventory stock-request API need?"
  • "Register this service's API in the registry."

That's it — the assistant will call the tools automatically.


B. Run your own registry

1. Install

pip install mcp-service-registry
# or, to run without installing permanently:
uvx mcp-service-registry

2. Provide a PostgreSQL database

The server needs a PostgreSQL database. Point it at one with the REGISTRY_DB_URL environment variable:

export REGISTRY_DB_URL="postgresql://user:pass@host:5432/dbname"

Create the table once:

CREATE TABLE IF NOT EXISTS services (
  name        TEXT PRIMARY KEY,
  description TEXT NOT NULL,
  contract    JSONB NOT NULL,
  updated_at  TIMESTAMPTZ NOT NULL DEFAULT now()
);

Tip: a free cloud PostgreSQL (e.g. Neon) works well. On Windows + local Docker, use 127.0.0.1 instead of localhost in the URL.

3. Run it

Local mode (stdio) — for a single machine / testing / the Inspector:

his-registry

Add it to Claude Code as a local command:

{
  "mcpServers": {
    "registry": {
      "command": "his-registry",
      "env": { "REGISTRY_DB_URL": "postgresql://..." }
    }
  }
}

Network mode (HTTP) — to share it with other devices:

export MCP_TRANSPORT=http
export MCP_PORT=8000          # optional; cloud hosts set PORT automatically
his-registry

It serves at http://<this-machine>:8000/mcp, with a health check at /health.


The tools

Tool What it does Arguments
list_services List all registered services + descriptions none
get_service_api Get one service's endpoints, request fields, response fields service
add_service Add or update a service's API contract name, description, endpoints_json

Registering a service

add_service takes the service name, a one-line description, and a JSON array of endpoints. Each endpoint looks like:

[
  {
    "method": "POST",
    "path": "/stock-request",
    "summary": "Create a stock request",
    "request_fields": {
      "itemId": "string (required)",
      "quantity": "integer (required, > 0)",
      "warehouseId": "string (required)",
      "requestedBy": "string (required)"
    },
    "response_fields": {
      "requestId": "string",
      "status": "string (PENDING | APPROVED | REJECTED)"
    }
  }
]

The easiest way to register: just ask your AI assistant, e.g. "Register the inventory service in the registry with a POST /stock-request endpoint that takes itemId, quantity, warehouseId, requestedBy." — it will call add_service for you.


Testing locally with the MCP Inspector

uvx --with mcp-service-registry mcp dev -c "from service_registry.server import mcp"

(Or clone the repo and run uv run mcp dev src/service_registry/server.py.)


Configuration reference

Variable Default Meaning
REGISTRY_DB_URL local Docker URL PostgreSQL connection string
MCP_TRANSPORT stdio stdio (local) or http (network)
MCP_PORT / PORT 8000 Port for HTTP mode

Works with other assistants

Because it uses the open Model Context Protocol, it isn't limited to Claude Code — any MCP-compatible client (Cursor, and others) can connect the same way.

License

MIT

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

mcp_service_registry-0.2.0.tar.gz (71.2 kB view details)

Uploaded Source

Built Distribution

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

mcp_service_registry-0.2.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file mcp_service_registry-0.2.0.tar.gz.

File metadata

  • Download URL: mcp_service_registry-0.2.0.tar.gz
  • Upload date:
  • Size: 71.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for mcp_service_registry-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b000636a6760157b74409d92840105b2908f1388c6d6e419ec88a8b60cb61767
MD5 9b8be4ce1daf83bbae672fe34c734195
BLAKE2b-256 be56d0e025e79cc588e02ea3607b166f2d1033c017f03340c7df51a3e33addd4

See more details on using hashes here.

File details

Details for the file mcp_service_registry-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: mcp_service_registry-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for mcp_service_registry-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 132d861439e815c2934633ea65bd35b081beadaa0efdc606eb590313f525ddc5
MD5 f343cc15d1f661f384c1db5f30a9167f
BLAKE2b-256 36db187405475b10d00eede9f2b60385e08bc084440be4afb4cbf8d996b4330e

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