hls_mcp

hls_mcp

MCP server for the Historical Dictionary of Switzerland (HLS), enabling full-text search and retrieval of biographical, geographical, and topical articles.

Category
Visit Server

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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured