Metadata-Version: 2.4
Name: mcp-service-registry
Version: 0.1.0
Summary: MCP server that shares microservice API contracts between AI coding assistants
Project-URL: Homepage, https://github.com/sinan-mohammed/his-service-registry
Author-email: Sinan <sinan@curanova.ai>
License: MIT
License-File: LICENSE
Keywords: api-registry,claude,mcp,microservices,model-context-protocol
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.10
Requires-Dist: mcp[cli]>=1.2.0
Requires-Dist: psycopg[binary]>=3.1
Description-Content-Type: text/markdown

# HIS Service Registry (MCP)

An MCP server that lets multiple Claude Code sessions share microservice API
contracts, so a Claude working on one service can look up another service's
real endpoints and field names instead of guessing.

## What's inside

- `list_services` — list all microservices in the registry.
- `get_service_api` — get one service's endpoints, request fields, response fields.
- `add_service` — add or update a service's API contract.

Data is stored in a **PostgreSQL** database (table: `services`).

## Setup

### 1. Start the database (PostgreSQL in Docker)

First time only — creates the container:

```bash
docker run -d --name registry-db \
  -e POSTGRES_PASSWORD=devpass -e POSTGRES_DB=registry \
  -p 5432:5432 postgres:16
```

Create the table (first time only):

```bash
docker exec -i registry-db psql -U postgres -d registry -c "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());"
```

After a reboot, just start the existing container again:

```bash
docker start registry-db
```

### 2. Install dependencies

```bash
uv sync
```

### 3. Run / test with the Inspector

```bash
uv run mcp dev src/service_registry/server.py
```

## Configuration

The database connection is read from the `REGISTRY_DB_URL` environment variable.
Default (local Docker):

```
postgresql://postgres:devpass@127.0.0.1:5432/registry
```

Note: use `127.0.0.1`, not `localhost`, on Windows — `localhost` can resolve to
IPv6 and hang against the Docker-mapped IPv4 port.
