{
  "markdown": "# Castlemap MCP server\n\nA [Model Context Protocol](https://modelcontextprotocol.io) server for the\nCastlemap atlas: 7,786 castles, fortresses, palaces and ruins across 141 countries,\nwith coordinates, founding dates, categories, fame ranking and Wikipedia\nsummaries.\n\nIt is already running. Point a client at the hosted endpoint — there is no\ninstall, no signup and no API key:\n\n```\nhttps://thecastlemap.com/mcp\n```\n\nStreamable HTTP, stateless, POST-only (a `GET` returning 405 is correct).\nProtocol revisions `2025-06-18` and `2025-03-26` are accepted.\n\n## Client configuration\n\n```json\n{\n  \"mcpServers\": {\n    \"castles\": {\n      \"type\": \"http\",\n      \"url\": \"https://thecastlemap.com/mcp\"\n    }\n  }\n}\n```\n\nRegistry entry: `com.thecastlemap/castles`.\n\n## Tools\n\n| Tool | What it does |\n| --- | --- |\n| `search_castles` | Find castles by name, country or category |\n| `get_castle` | Full record for one castle |\n| `castles_near` | Nearest castles to a coordinate (haversine); geocode first |\n| `top_castles` | Best-known castles, by fame rank |\n| `list_countries` | The 141 countries, with counts |\n| `get_statistics` | Live aggregates — totals, per-country, per-century |\n| `random_castle` | One castle at random |\n\n## Data\n\nDerived from [Wikidata](https://www.wikidata.org), with summaries from\nWikipedia and images from Wikimedia Commons. The atlas is curated rather than\nexhaustive: it covers castles with a documented history, a real photo and exact\ncoordinates, not every earthwork and ruin.\n\nThe factual records are released as **CC0** and downloadable as GeoJSON and CSV\nfrom [thecastlemap.com/data](https://thecastlemap.com/data/) — also mirrored on\n[GitHub](https://github.com/Flightmussy/castlemap-dataset),\n[Hugging Face](https://huggingface.co/datasets/Flightmussy/castles-of-the-world),\n[Kaggle](https://www.kaggle.com/datasets/flightmussy/castles-of-the-world)\nand [Zenodo](https://doi.org/10.5281/zenodo.21322359) (concept DOI\n`10.5281/zenodo.21322359`, which always resolves to the newest version).\n\n## Running it yourself\n\n`server.mjs` has **zero dependencies** — no SDK, no `node_modules`. It needs\nNode 18+ and a `castles.geojson` to read (download one from\n[/data](https://thecastlemap.com/data/)):\n\n```sh\nCASTLES_GEOJSON=/path/to/castles.geojson PORT=8891 node server.mjs\n```\n\nIt binds `127.0.0.1:8891` by default; `HOST`, `PORT` and `CASTLES_GEOJSON`\noverride that. The file is re-read when its mtime changes (throttled to 60s), so\nupdating the data needs no restart.\n\n`castlemap-mcp.service` is the systemd unit used in production — loopback-bound,\n`DynamicUser`, `ProtectSystem=strict`, with nginx terminating TLS in front. Set\n`ExecStart` to your own node path and `ReadOnlyPaths`/`CASTLES_GEOJSON` to\nwherever the data lives.\n\n## Provenance\n\nBuilt by [flightmussy](https://thecastlemap.com) with AI assistance: the concept,\ndirection and review are mine; much of the implementation was written with\nClaude. The underlying data is not generated — it comes from Wikidata, and every\nrecord is traceable to its Wikidata item.\n\n## License\n\nCode: MIT (see `LICENSE`). Data: CC0. Wikipedia summary text remains CC BY-SA\nand is attributed per record.\n",
  "bytes": 3170,
  "sha": "5f0def544a978a8f9c5a2bf1e20e3cc72a46ee3977e8e9f20b1fa1e637dbf420",
  "repo_slug": "flightmussy/castlemap-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_com_thecastlemap_castles_25a26aff/readme"
}