Castles

com.thecastlemapPublished by thecastlemap.comOfficial publisherv1.0.3Updated Oct 24, 2026

Castles, fortresses, palaces and ruins worldwide: search, nearby, fame ranking, statistics. CC0.

VerifiedStreamable HTTPWeb executableLocation & LifestyleKnowledge & Memory

Overview

AI-generated overview

Remote MCP server for the Castlemap atlas of castles, fortresses, palaces and ruins, letting an assistant search, look up, rank and find landmarks near a place.

What you can do
  • Search landmarks by name, country or category, best match first
  • Fetch one landmark's full record by slug or exact name, with coordinates, founding date, fame rank, photo credit and Wikipedia links
  • List landmarks within a radius of a coordinate, nearest first
  • Rank the most famous landmarks worldwide or in one country
  • List countries with landmark counts, and get live statistics such as totals by type, top countries and busiest founding century
  • Return one random landmark for discovery or quizzes
When to use it
Useful when an assistant needs factual answers about historic castles, palaces and ruins: what exists in a country, which are most famous, what is near a given coordinate, or headline statistics about the atlas. It is a read-only reference source rather than a planning or booking tool.
Requirements
Nothing to install: it is a hosted streamable HTTP endpoint with no signup and no API key. The client must support streamable HTTP (POST-only, stateless). Self-hosting is optional and needs Node 18+ plus a castles GeoJSON file.
Before you install
All tools are read-only lookups; no writes, accounts or payments are involved. Nearby search does not geocode place names, so the assistant must supply coordinates itself. The atlas is curated rather than exhaustive, and its data is derived from Wikidata, Wikipedia and Wikimedia Commons, so photo credits and licences should be preserved when reused.

Installation

In SourceWeft

  1. Open Castles in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/com.thecastlemap%2Fcastles/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "mcpServers": {
    "castles": {
      "type": "http",
      "url": "https://thecastlemap.com/mcp"
    }
  }
}

README

Castlemap 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

json
{  "mcpServers": {    "castles": {      "type": "http",      "url": "https://thecastlemap.com/mcp"    }  }}

Registry entry: com.thecastlemap/castles.

Tools

ToolWhat it does
search_castlesFind castles by name, country or category
get_castleFull record for one castle
castles_nearNearest castles to a coordinate (haversine); geocode first
top_castlesBest-known castles, by fame rank
list_countriesThe 141 countries, with counts
get_statisticsLive aggregates — totals, per-country, per-century
random_castleOne 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):

sh
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.

Source: README.md at commit c428e57

Tools

7

search_castles

Search castles by name

Search the atlas’s 9,035 castles, fortresses, palaces and ruins by name (accent- and case-insensitive substring match). Optionally filter by country (name or ISO code) and category. Results come best-match-first, then by fame; each has coordinates, founding century, fame rank and links to its atlas page and Wikipedia. If nothing matches, retry with a shorter fragment of the name.

Parameterslimitqueryrequiredcountrycategory

get_castle

Get one castle in full

Fetch one landmark’s full record by slug (preferred, e.g. "palace-of-versailles") or exact name: coordinates, founding year and century, worldwide fame rank, photo URL with photographer credit and licence, Wikipedia link and its readership signals (Wikidata sitelinks, Wikipedia pageviews over the last 60 days summed across its largest language editions). Unsure of the slug? Call search_castles first.

Parameterscastlerequired

castles_near

Find castles near a point

List landmarks within a radius of a WGS84 coordinate, nearest first, each with distance_km. Radius defaults to 100 km (max 2,000). For "castles near <place>", geocode the place yourself, then call this with its latitude/longitude.

Parameterslimitcategorylatituderequiredlongituderequiredradius_km

top_castles

Most famous castles

The most famous landmarks worldwide or in one country, ordered by Castlemap fame rank — a blend of Wikipedia coverage and readership; rank 1 is the most famous (Great Wall of China). The direct answer to "most famous castles in <country>"; filter by country and/or category.

Parameterslimitcountrycategory

list_countries

Countries with castle counts

Every country in the atlas with its landmark count, most first — answers "which country has the most castles" (France leads). Returns country name and ISO code per row; country pages are browsable from the countries_index URL.

Takes no parameters.

get_statistics

Atlas statistics

Headline statistics computed live from the atlas: totals by type, top countries, busiest founding century, oldest landmarks, geographic extremes and the most famous entry. The source for claims like "which country has the most castles" or "when were castles built"; the full write-up lives at thecastlemap.com/statistics/.

Takes no parameters.

random_castle

A random castle

One random landmark with its full record, optionally limited to a country — for discovery, quizzes and "castle of the day" features.

Parameterscountry

Version history

1
  1. v1.0.3LatestSep 16, 2026

Score

100% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts