Skip to main content
Glama

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

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

Registry entry: com.thecastlemap/castles.

Related MCP server: chuk-mcp-geocoder

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.

Available Tools

7 tools
castles_nearFind castles near a pointAInspect

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 ", geocode the place yourself, then call this with its latitude/longitude.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMax results (default 10)
categoryNo
latitudeYes
longitudeYes
radius_kmNoSearch radius in km (default 100)

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, the description discloses key behaviors: results are sorted by distance, include 'distance_km', and the radius defaults/max are specified. It doesn't mention idempotency or side effects, but the listing nature implies read-only operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences with essential information front-loaded. No filler or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description adequately describes the output format (distance_km, sorted). It mentions the default/max radius and provides usage guidance. Minor omission: no mention of the 'limit' parameter's default behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 40% (limit and radius_km have descriptions; latitude, longitude, category do not). The description adds radius defaults but does not clarify the missing parameters. It provides marginal value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description specifies the verb 'List' and the resource 'landmarks within a radius of a WGS84 coordinate', and clarifies the ordering ('nearest first'). It provides a concrete usage example ('For "castles near <place>"...'), which distinguishes the tool from siblings like 'search_castles' that likely use text-based queries.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit instructions for the common use case ('geocode the place yourself, then call this'), which aids selection. While it doesn't explicitly state when not to use this tool, the guidance is clear and actionable.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_castleGet one castle in fullAInspect

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, Wikipedia link and its readership signals (Wikidata sitelinks, annual Wikipedia pageviews). Unsure of the slug? Call search_castles first.

ParametersJSON Schema
NameRequiredDescriptionDefault
castleYesSlug (preferred, e.g. "himeji-castle") or exact name

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Describes exactly what data is returned (coordinates, founding year, fame rank, photo, Wikipedia link, readership signals). No annotations exist, so description carries full burden. It lacks mention of error behavior or rate limits but is thorough for a read tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, 55 words. Front-loads the action and resource, then provides a fallback hint. Every sentence is necessary and efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (1 param, no output schema, no annotations), the description covers the key aspects: how to call it, what it returns, and when to use alternatives. Minor omissions like exact output structure are acceptable for a straightforward get operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema already covers the parameter with high coverage (100%), so baseline is 3. The description adds value by emphasizing slug preference and suggesting search_castles if unsure, which helps the agent select the correct input format.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Fetch one landmark’s full record' using a slug or exact name, and lists the returned fields. It immediately distinguishes from sibling tools like search_castles by implying this is the full record retrieval, not a search.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly tells when NOT to use ('Unsure of the slug?') and directs to the correct alternative ('Call search_castles first'). This provides clear guidance on when to use this tool versus its sibling.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_statisticsAtlas statisticsAInspect

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

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It says 'computed live from the atlas' indicating real-time computation. It lists what statistics are included but doesn't specify performance or whether it's read-only. Still, it gives adequate behavioral context for a stateless read operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences that are front-loaded with the main purpose and include specific examples. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description lists the categories of statistics (totals, top countries, etc.) and references a full write-up URL. It could detail the response format more, but for a simple stats tool it's fairly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are no parameters, so the description provides all necessary semantic meaning by detailing what statistics the tool returns.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool provides headline statistics computed live from the atlas, listing specific categories like totals by type, top countries, etc. It distinguishes itself from sibling tools by focusing on aggregate data rather than individual castles or searches.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says it's 'the source for claims like which country has the most castles', giving clear usage context. It does not explicitly state when not to use, but the alternative tools (get_castle, top_castles) are implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_countriesCountries with castle countsAInspect

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.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Despite lacking annotations, the description discloses key behavioral traits: it returns all countries sorted by count descending, includes country name and ISO code, and mentions a URL for browsing. This is sufficient for a simple read-only tool, though it lacks details on data freshness or limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at two sentences, front-loaded with the primary purpose and a practical use case. Every word adds value, with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (no parameters, no output schema, no annotations), the description is fully complete. It explains the output format, sorting, and provides an example answer, plus a link for further detail.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are no parameters (0 params), so the baseline score of 4 applies. The description adds no further parameter information, which is appropriate given the absence of parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists every country with its landmark count, sorted descending, and answers the specific question 'which country has the most castles'. The verb 'list' in the name and the explicit purpose differentiate it from siblings like search_castles or get_castle.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for obtaining a broad overview of countries with castle counts, but does not explicitly state when to use this tool versus alternatives like castles_near or top_castles. No when-not or exclusion criteria are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

random_castleA random castleAInspect

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

ParametersJSON Schema
NameRequiredDescriptionDefault
countryNoCountry name or ISO code (optional)

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, description discloses key behaviors: returns one random record, optional country filter. Adequate for a simple read tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence front-loads purpose and is perfectly concise with no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one optional param, no output schema), the description covers return type, optionality, and intended use completely.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and parameter description already explains 'country' as optional. Tool description adds context ('optionally limited to a country') but minimal extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it returns one random landmark with full record, optionally filtered by country. It distinguishes from siblings like get_castle (specific) and castles_near (proximity).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly mentions use cases like discovery, quizzes, and 'castle of the day'. Implies when not to use via sibling tool names but lacks explicit exclusions or alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_castlesSearch castles by nameAInspect

Search the atlas’s 2,400 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.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMax results (default 10)
queryYesName or part of a name, e.g. "neuschwanstein" or "himeji"
countryNoCountry name or 2-letter ISO code (optional)
categoryNoLandmark type (optional)

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description effectively discloses behavior: accent/case-insensitive substring matching, result ordering (best-match-then-fame), output fields (coordinates, century, fame rank, links), and retry advice. It does not mention authentication, rate limits, or mutability, but as a search tool it is sufficiently transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three sentences, each serving a purpose: first states the core action, second details optional filters, third describes result format and advice. No redundant information, well front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 100% schema coverage and no output schema, the description covers the search behavior, optional filters, result fields, and retry advice. It is complete for a search tool, though it could mention pagination or default limit behavior more explicitly (but limit is in schema).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description adds value beyond the schema by clarifying that query matching is accent/case-insensitive substring and that country accepts name or ISO code. It also explains default limit behavior and result ordering, which the schema lacks.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool searches the atlas's 2,400 castles by name with optional filters, using a specific verb 'search' and resource 'castles'. It distinguishes from siblings like 'castles_near' (likely location-based) and 'get_castle' (single item) by focusing on name-based substring search.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for name-based searching and provides a retry hint for no matches, but does not explicitly say when to use this tool over alternatives or when not to use it. No exclusions or prerequisites are stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

top_castlesMost famous castlesAInspect

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

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoHow many (default 10)
countryNoCountry name or ISO code (optional — omit for worldwide)
categoryNo

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It discloses ordering by fame rank and that omitting country gives worldwide results. However, it does not mention that the tool is read-only, nor does it describe any limitations or special behaviors beyond the rank explanation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences: the first defines the result ordering, the second explains usage and filtering. Every sentence is meaningful and front-loaded with the core purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description could benefit from mentioning the return structure (e.g., list of castle names with rank). It adequately covers functionality but lacks completeness on response format.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema covers 67% of parameters with descriptions. The description adds context by explaining the ranking and that category is a filter. It does not introduce new parameter semantics beyond reinforcing the filter concept.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that the tool returns the most famous landmarks worldwide or in a country, ordered by a specific fame rank. It distinguishes itself from siblings like 'search_castles' or 'castles_near' by focusing on ranking based on fame.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidance: it is the direct answer for 'most famous castles in <country>' and allows filtering by country and/or category. However, it does not explicitly state when not to use this tool or mention alternative tools for different queries.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 7 tool updatesv1.1.0
    • First observedcastles_near
    • First observedget_castle
    • First observedget_statistics
    • First observedlist_countries
    • First observedrandom_castle
    • First observedsearch_castles
    • First observedtop_castles

TDQS

A4.2/5.0

Scored across 7 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: geographic search (castles_near), record retrieval (get_castle), aggregate statistics (get_statistics), country listing (list_countries), random sample (random_castle), name search (search_castles), and fame-ranked listing (top_castles). No overlap exists.

Naming Consistency3/5

Most tools follow a verb_noun pattern (e.g., get_castle, search_castles, list_countries), but 'castles_near' breaks the pattern with a noun_prep structure. Singular/plural usage is inconsistent (get_castle vs. search_castles), though readability is maintained.

Tool Count5/5

Seven tools is well-scoped for a read-only atlas of 2,400 landmarks. Each tool covers a distinct access pattern (search, random, near, stats, etc.) without redundancy or bloat.

Completeness4/5

The tool surface covers key operations: search, retrieval, statistics, and exploration. A minor gap is the lack of a generic 'list all' endpoint with pagination, but search may fill this role. The set is largely complete for its domain.

Maintenance

ActivityActive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables exploration of geographical data including countries, cities, states/provinces, and regions through a SQLite database. Supports searches by name, location coordinates, currency, and regional groupings with comprehensive statistical queries.
    6
    -
  • A
    license
    A
    quality
    D
    maintenance
    Provides forward/reverse geocoding, bounding box extraction, nearby places discovery, batch geocoding, route waypoints, and administrative boundary lookup using OpenStreetMap data.
    10
    Apache 2.0
  • F
    license
    B
    quality
    B
    maintenance
    Provides read-only query tools over OpenStreetMap data in PostGIS, enabling natural language queries for features, categories, and spatial analysis.
    7
    -
  • A
    license
    A
    quality
    A
    maintenance
    The world railway atlas as read-only MCP tools: search 744+ legendary train routes (high-speed, classic, night, scenic) and get per-route facts, rankings and journey times. Runs from the repo's open dataset (CC BY 4.0); a free hosted endpoint is also live at https://trainrouter.com/mcp.
    7
    3
    MIT