About castles
castles is an MCP server for the Castlemap atlas, with searchable records of castles, fortresses, palaces, and ruins worldwide. Entries include coordinates, dates, categories, fame rankings, and Wikipedia summaries.
Key features
- 01Search by name, country, or category
- 02Retrieve a castle's full record
- 03Find nearby castles by coordinates
- 04Browse fame rankings or a random entry
- 05View country lists and statistics
Use cases
- 01Plan castle-focused trips
- 02Find historic sites near a location
- 03Study castle distribution by country
MCP support
It provides a remote MCP server over Streamable HTTP, exposing search, record lookup, nearby-site, and statistics tools to clients.
Configuration
Remote servers need no local install. Pick your client, then copy the config or install in one click.
https://thecastlemap.com/mcpclaude mcp add --transport http com-thecastlemap-castles https://thecastlemap.com/mcp{"mcpServers":{"com-thecastlemap-castles":{"type":"http","url":"https://thecastlemap.com/mcp"}}}Open in Cursor{"servers":{"com-thecastlemap-castles":{"type":"http","url":"https://thecastlemap.com/mcp"}}}Open in VS Code{"mcpServers":{"com-thecastlemap-castles":{"type":"http","url":"https://thecastlemap.com/mcp"}}}{"mcpServers":{"com-thecastlemap-castles":{"serverUrl":"https://thecastlemap.com/mcp"}}}Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.
Tools
7| Parameter | Type | Required | Description |
|---|---|---|---|
| limit | integer | No | Max results (default 10) |
| query | string | Yes | Name or part of a name, e.g. "neuschwanstein" or "himeji" |
| country | string | No | Country name or 2-letter ISO code (optional) |
| category | enum | No | Landmark type (optional)castle | fortress | palace | ruin |
Details
From the project READMECastlemap MCP server
A Model Context Protocol server for the Castlemap atlas: 7,786 castles, fortresses, palaces and ruins across 141 countries, with coordinates, founding dates, categories, fame ranking and Wikipedia summaries.
It is already running. Point a client at the hosted endpoint — there is no install, no signup and no API key:
https://thecastlemap.com/mcp
Streamable HTTP, stateless, POST-only (a GET returning 405 is correct).
Protocol revisions 2025-06-18 and 2025-03-26 are accepted.
Client configuration
{
"mcpServers": {
"castles": {
"type": "http",
"url": "https://thecastlemap.com/mcp"
}
}
}
Registry entry: com.thecastlemap/castles.
Tools
| Tool | What it does |
|---|---|
search_castles | Find castles by name, country or category |
get_castle | Full record for one castle |
castles_near | Nearest castles to a coordinate (haversine); geocode first |
top_castles | Best-known castles, by fame rank |
list_countries | The 141 countries, with counts |
get_statistics | Live aggregates — totals, per-country, per-century |
random_castle | One castle at random |
Data
Derived from Wikidata, with summaries from Wikipedia and images from Wikimedia Commons. The atlas is curated rather than exhaustive: it covers castles with a documented history, a real photo and exact coordinates, not every earthwork and ruin.
The factual records are released as CC0 and downloadable as GeoJSON and CSV
from thecastlemap.com/data — also mirrored on
GitHub,
Hugging Face,
Kaggle
and Zenodo (concept DOI
10.5281/zenodo.21322359, which always resolves to the newest version).
Running it yourself
server.mjs has zero dependencies — no SDK, no node_modules. It needs
Node 18+ and a castles.geojson to read (download one from
/data):
CASTLES_GEOJSON=/path/to/castles.geojson PORT=8891 node server.mjs
It binds 127.0.0.1:8891 by default; HOST, PORT and CASTLES_GEOJSON
override that. The file is re-read when its mtime changes (throttled to 60s), so
updating the data needs no restart.
castlemap-mcp.service is the systemd unit used in production — loopback-bound,
DynamicUser, ProtectSystem=strict, with nginx terminating TLS in front. Set
ExecStart to your own node path and ReadOnlyPaths/CASTLES_GEOJSON to
wherever the data lives.
Provenance
Built by flightmussy with AI assistance: the concept, direction and review are mine; much of the implementation was written with Claude. The underlying data is not generated — it comes from Wikidata, and every record is traceable to its Wikidata item.
License
Code: MIT (see LICENSE). Data: CC0. Wikipedia summary text remains CC BY-SA
and is attributed per record.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.