hls_mcp
MCP server for the Historical Dictionary of Switzerland (HLS), enabling full-text search and retrieval of biographical, geographical, and topical articles.
README
hls_mcp
HLS (Historisches Lexikon der Schweiz | Dizionario Storico della Svizzera |
Dictionnaire Historique de la Suisse) — MCP server using the MCP 2.0
MCPServer API with streamable HTTP transport.
Corpus
- 33,506 articles across four categories:
bio(biographies),fam(families),geo(places),tem(topics/institutions) - 24,277 bio articles with birth/death dates and family names
- Full-text content in German, French, Italian
Building the database
The hls.db is built from the HLS CSV export on first run (or on demand):
docker compose run --rm hls-mcp python build_db.py
Or outside Docker:
HLS_SRC_CSV=/path/to/hls_articles.csv HLS_OUT_DB=/path/to/hls.db python build_db.py
Running
docker compose up -d
The endpoint is http://localhost:8004/mcp by default, and whatever --http-path
says otherwise — see Transport.
Connect Claude Code with — note the name and URL are positional, there is no --url
flag:
claude mcp add --transport http hls http://<server-ip>:8004/mcp -s user
-s user makes the server available in every project; -s project writes it to
.mcp.json to share with a repository. In Claude Desktop, Cowork or claude.ai, use
Customize → Connectors → + → Add custom connector with the same URL; those
clients connect from Anthropic's cloud, so the server must be reachable over the public
internet. In a .mcp.json the entry is {"type": "http", "url": "…"} — a url
without a type is read as a stdio server and skipped.
Tools
| Tool | Description |
|---|---|
corpus_stats |
Corpus summary: article/person counts, text size, categories |
search_articles |
FTS5 full-text search across title, text, lexical class |
get_article |
Full article record by HLS id (e.g. 001398) |
list_articles_by_category |
Browse articles by type: bio, fam, geo, tem |
list_articles_by_year |
Articles whose time-span overlaps a given year range |
list_persons |
Paginated person authority list |
search_persons |
Search persons by family name or forename |
get_person |
Person record by HLS person id (e.g. per-001398) |
Transport
<a id="transport"></a>
Streamable HTTP — one endpoint answering POST (requests), GET (the
server→client stream), and DELETE (session teardown).
This replaces the SSE transport this server used previously. SSE is deprecated, and
its handshake hands the client an absolute /messages/ path computed from the app's
own mount point — a path the client cannot reach when the server sits behind a
reverse-proxy sub-path. Clients pointed at /sse must be repointed.
Behind a reverse proxy
Set --http-path (or HLS_HTTP_PATH) to the public path, and give nginx a
location with the same string. Then nginx forwards the path unchanged:
location /mcp/hls/mcp {
proxy_pass http://127.0.0.1:8004; # no trailing slash
proxy_http_version 1.1;
proxy_set_header Connection '';
proxy_buffering off;
proxy_read_timeout 3600s;
chunked_transfer_encoding on;
}
The app's path and the nginx location must agree exactly or every request 404s.
The startup line prints what is actually being served:
Starting HLS MCP server on 0.0.0.0:8004/mcp/hls/mcp
Environment variables
| Variable | Default | Description |
|---|---|---|
HLS_DB |
/data/hls.db |
Path to the SQLite database |
HLS_HOST |
0.0.0.0 |
Bind address |
HLS_PORT |
8004 |
TCP port |
HLS_HTTP_PATH |
/mcp |
Path the MCP endpoint is served at |
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.
Name search. SQL wildcards in a query are escaped, so searching for 100% finds a
literal "100%" rather than matching every record.
Full-text search. search_articles passes the query to FTS5, so operators work —
Bern OR Brugg, Zwing*, NEAR(...). An invalid FTS5 query falls back to quoted
phrases and then to a literal title search instead of raising.
Year ranges. list_articles_by_year reads the free-text time_span field, so the
overlap test runs in Python — over the candidate set before paging. It examines at
most YEAR_SCAN_CAP (5000) rows.
Result size. Claude.ai and Claude Desktop truncate a tool or resource result at roughly 150,000 characters; the 500-row ceiling keeps every tool under it.
Tests
pip install pytest
pytest test_hls_mcp.py
Unit tests build their own throwaway database and need no setup. DB and server tests skip unless pointed at them:
HLS_DB=/data/hls.db HLS_SERVER=http://localhost:8004 pytest test_hls_mcp.py
Requires Python 3.10+ (X | None annotations); the container image is
python:3.12-slim.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。