Skip to main content
Glama
rero-mef-mcp

rero-mef-mcp

Official
by rero
README.md
# rero-mef-mcp

An [MCP](https://modelcontextprotocol.io) server giving AI assistants read-only access to
[MEF](https://mef.rero.ch), RERO's Multilingual Entity File. It calls the public MEF REST API, so it needs no
database or search access.

## Tools

| Tool | Purpose |
|---|---|
| `mef_list` | The endpoints: `agents/mef`, `agents/idref`, `concepts/gnd`, … |
| `mef_docs` | The JSON schema and the facets of an endpoint's records |
| `mef_search` | Search an endpoint with an OpenSearch query string, with paging, field selection and facets |
| `mef_get` | One record by its pid |

The assistant composes the queries itself, for example
`mef_search("agents/mef", "_exists_:rero AND NOT _exists_:idref", size=1)` to count the RERO agents not linked to
IdRef yet.

The tool signatures carry type annotations, unlike the other RERO projects: the MCP SDK builds the tools' input
schemas from them.

## Configuration

| Variable | Default | |
|---|---|---|
| `MEF_URL` | `https://mef.rero.ch` | MEF instance to query |
| `MEF_TIMEOUT` | `60` | Timeout of the MEF requests, in seconds |
| `MEF_MCP_TRANSPORT` | `stdio` | `stdio`, or `streamable-http` for a deployment |
| `MEF_MCP_HOST` | `0.0.0.0` | HTTP listen address |
| `MEF_MCP_PORT` | `8000` | HTTP port; the MCP endpoint is `/mcp`, the health check `/health` |
| `MEF_MCP_LOG_LEVEL` | `INFO` | `DEBUG` logs every MCP request with its arguments, result and duration, and every MEF request |

## Use

Locally, on stdio:

```bash
claude mcp add rero-mef -- uv run --directory /path/to/rero-mef-mcp rero-mef-mcp
```

Deployed, over HTTP:

```bash
docker compose up -d
claude mcp add --transport http rero-mef http://localhost:8000/mcp
```

Kubernetes manifests are in `deploy/k8s/`.

## Development

```bash
uv run poe tests
uv run poe lint
uv run poe format
```