SSRQ MCP Server
Exposes the Swiss Summary of Roman Law (SSRQ) authority files for persons and organisations, enabling search, lookup, and relation queries through MCP-compatible clients.
README
SSRQ — MCP Server
An MCP server that exposes the person and organisation authority file of the Sammlung Schweizerischer Rechtsquellen — Les sources du droit suisse / Le fonti del diritto svizzero, in English the Collection of Swiss Law Sources (SSRQ · SDS · FDS) — to Claude and other MCP-compatible clients.
The collection is published by the Rechtsquellenstiftung of the Swiss Law Society and comprises over 140 editions of legal-historical documents from the Middle Ages to 1798 (https://ssrq-sds-fds.ch). This server serves the authority file behind those editions: 23,674 persons, 7,047 organisations, and 138,298 name variants.
Architecture
ssrq__fuseki_*.ttl ──► SSRQ ETL ──► ssrq.db (SQLite)
persons ────┐
orgs ───────┼──► server.py
name_index ─┘ (mcp 2.0 MCPServer,
streamable HTTP)
│
http://<host>:8002/mcp
The server targets mcp 2.0, which renamed the high-level server class
(FastMCP → MCPServer) and removed mcp.server.fastmcp; requirements.txt pins the
major version accordingly.
The database is built by the SSRQ project's ETL pipeline from the RDF-TTL source dump;
this repository only serves it. Every connection is opened mode=ro with
PRAGMA query_only, so the server cannot write to the corpus.
Setup
1. Build the database
The database lives at /data/ssrq.db in the container. To rebuild it from the RDF-TTL
source (in the SSRQ project repository):
python ssrq_parse_ttl.py --input /path/to/ssrq__fuseki_*.ttl --db ssrq.db
db.SCHEMA_SQL holds the schema this server expects — it is the contract between the
ETL and the server, and the tests build their fixtures from it.
2. Install dependencies
pip install -r requirements.txt
3. Start the server
python server.py --db ssrq.db --host 0.0.0.0 --port 8002
Each flag also has an environment variable — SSRQ_DB, SSRQ_HOST, SSRQ_PORT — which
the flags override. Importing server.py never reads sys.argv, so it is safe to import
from tests or an ASGI loader.
4. Connect a client
Add to your claude_desktop_config.json (or equivalent):
{
"mcpServers": {
"ssrq": {
"url": "http://<server-ip>:8002/mcp",
"transport": "streamable-http"
}
}
}
Or for Claude Code:
claude mcp add ssrq --transport http --url http://<server-ip>:8002/mcp
Docker deployment
Build image
docker compose build
Run
docker compose up -d
The container serves on port 8002 and expects ssrq.db at /data/ssrq.db. Adjust the
volume path in docker-compose.yml if your data lives elsewhere.
Reverse proxy (nginx, optional but recommended)
server {
listen 443 ssl;
server_name ssrq-mcp.example.unibe.ch;
location / {
proxy_pass http://localhost:8002;
proxy_http_version 1.1;
# Required for the streaming responses
proxy_set_header Connection '';
proxy_buffering off;
proxy_cache off;
chunked_transfer_encoding on;
}
}
Note: the server has no authentication. By default
docker-compose.ymlpublishes port 8002 on all interfaces; if a proxy fronts it, bind it to loopback instead so the authority file is not reachable directly:SSRQ_BIND=127.0.0.1 docker compose up -dOtherwise restrict access at the firewall.
Available tools
| Tool | Description |
|---|---|
corpus_stats() |
Person/org/name-variant counts and the attested year range |
list_persons(limit=50, offset=0) |
Paginated list of the person authority file, by id |
search_persons(query, limit=50) |
Persons by standardised name, label, or spelling variant |
get_person(pid) |
Full person record by SSRQ id (e.g. per000001), with name variants |
get_persons_by_year(year_from, year_to, limit=100) |
Persons whose attested years overlap a range (max span 500 years) |
search_orgs(query, limit=50) |
Organisation authority by name |
get_org(oid) |
Full org record by SSRQ id (e.g. org000001), with name variants |
search_name_index(query, type_filter="", limit=50) |
Search all 138k name variants; type_filter is person, org, or empty for both |
get_name_variants(id) |
All name variants for a given person or org id |
related_persons(pid) |
Spouses, mothers, fathers, organisations, and places, resolved to records |
Available resources
| URI | Description |
|---|---|
ssrq://stats |
Corpus statistics (JSON) |
ssrq://orgs |
Organisation index — {total, returned, truncated, orgs: [...]}, capped at 9999 rows and flagged when truncated |
ssrq://person/{pid} |
Single person record (JSON) |
ssrq://org/{oid} |
Single organisation record (JSON) |
Query behaviour
Limits. Every limit is clamped to at most 500; a negative, zero, or non-numeric
value falls back to that tool's own default rather than returning the whole table. Use
list_persons(limit, offset) to page through the register.
Name search. search_persons, search_orgs, and search_name_index do a plain
case-insensitive substring match. SQL wildcards in the query are escaped, so searching for
100% finds a literal "100%" rather than matching every record. search_persons looks at
std_name, label, and both spelling-variant columns; historical spellings that differ
from the modern form are best reached through search_name_index.
Name index shape. Every row carries kind (person or org), so the result shape is
the same whether or not type_filter is set.
Missing records. get_person, get_org, and related_persons return
{"error": "... not found."} rather than raising.
Year ranges. get_persons_by_year matches on overlap: a person is returned when
first_year <= year_to and last_year >= year_from. Persons with no attested years are
never returned. An inverted range, or one spanning more than 500 years, comes back as an
error object.
Places. related_persons resolves spouse_ids, mother_ids, father_ids, and
org_ids against the persons and orgs tables. loc_ids point at the SSRQ place
authority, which this database does not currently carry: those ids are returned as bare
{"id": ...} entries together with a places_note. If a places (or locations) table
is added to the database later, they are resolved to full records automatically.
Database schema
| Table | Contents |
|---|---|
persons |
id, uri, etype, label, label_lang, std_name, forename, surname, sex, first_year, last_year, years, org_ids, spouse_ids, mother_ids, father_ids, loc_ids, orig_names, std_names |
orgs |
id, uri, etype, label, std_name, surname, alias_of, org_type |
name_index |
name_text, ssrq_id, is_orig (138k variant → canonical mappings) |
Key notes
- Person IDs:
per000001–per999999(23,674 total) - Org IDs:
org000001–org999999(7,047 total) orig_names/std_names— original and normalised spelling variants (comma-joined)is_orig=1inname_indexmeans the name is the original spelling;is_orig=0is a normalised variant. Original spellings sort first in every variant listing.- The relation columns (
org_ids,spouse_ids,mother_ids,father_ids,loc_ids) are comma-joined id lists;related_personsresolves them all in one call.
Tests
pip install -r requirements-dev.txt
pytest test_ssrq_mcp.py
Unit tests build their own throwaway database and run with no setup. The DB and server tests skip unless you point them at the real database and a running server:
SSRQ_DB=/data/ssrq.db SSRQ_SERVER=http://localhost:8002 pytest test_ssrq_mcp.py
The suite also runs standalone, with grouped output and a non-zero exit on failure:
python test_ssrq_mcp.py --unit --db /data/ssrq.db --server http://localhost:8002
Note that the DB tests assert corpus-size floors (≥20,000 persons, ≥6,000 organisations, ≥100,000 name variants) — they will fail against a small sample database.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。