HGB Basel MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@HGB Basel MCP Serversearch for person named Hans Müller"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
HGB Basel — MCP Server
An MCP server that exposes the Historisches Grundbuch Basel (HGB) corpus for use with Claude and other MCP-compatible clients.
Architecture
hgb_full_*.xml ──► build_db.py ──► hgb.db (SQLite + FTS5)
│
server.py (FastMCP / HTTP SSE)
│
http://<host>:8000/sseThe 800 MB XML is parsed once into a ~100 MB SQLite database. The server then runs stateless queries against it.
Related MCP server: German Law MCP Server
Setup
1. Install dependencies
cd mcp_server
pip install -r requirements.txt2. Build the database
python build_db.py --xml ../hgb_full_26_05_29_05.xml --db hgb.dbThis takes ~10 minutes and produces hgb.db. Run it once; repeat only when the XML changes.
3. Start the server
python server.py --db hgb.db --host 0.0.0.0 --port 80004. Connect a client
Add to your claude_desktop_config.json (or equivalent):
{
"mcpServers": {
"hgb": {
"url": "http://<server-ip>:8000/sse"
}
}
}Or for Claude Code:
claude mcp add hgb --transport sse --url http://<server-ip>:8000/sseDocker deployment (recommended for the vServer)
Build image
docker compose buildFirst-time: build the database
# Copy XML to /data/hgb/ on the server, then:
docker run --rm \
-v /data/hgb:/data \
hgb-mcp \
python build_db.py --xml /data/hgb_full_26_05_29_05.xml --db /data/hgb.dbRun
docker compose up -dUpdate /data/hgb in docker-compose.yml to match the actual path on the vServer.
Reverse proxy (nginx, optional but recommended)
server {
listen 443 ssl;
server_name hgb-mcp.example.unibe.ch;
location / {
proxy_pass http://localhost:8000;
proxy_http_version 1.1;
# Required for SSE
proxy_set_header Connection '';
proxy_buffering off;
proxy_cache off;
chunked_transfer_encoding on;
}
}Available tools
Tool | Description |
| Document/span/person/event counts and year range |
| FTS search for person names (FTS5 syntax) |
| Full document: text, all spans, events |
| All documents for a property, ordered by year |
| Keyword search over raw transcriptions with snippets |
| Person mentions filtered by year |
| Other persons in the same documents |
| All properties with coordinates and year ranges |
Available resources
URI | Description |
| Corpus statistics (JSON) |
| All dossiers (JSON) |
| Single document (JSON) |
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/thodel/kf_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server