HERE Technologies and Wherobots announce partnership Learn More

What is an MCP Server? Spatial Context for AI Agents

Authors

A Model Context Protocol (MCP) server is a program that gives an AI agent tools it can call and data it can read. Anthropic released MCP as an open standard on 25 November 2024. With a spatial MCP server, an agent can find a map table, read its columns, and run a spatial query that returns a measured number.

We tested that with one question for Claude Code, Anthropic's coding agent: how many buildings does Overture Maps record inside San Francisco? On 9 November 2026, with no tools, Claude Code gave no number, and through the Wherobots MCP server it counted 162,538 buildings in 233 seconds. That count covers buildings in Overture's open map data whose center falls inside the city's land boundary. The city's own file lists 177,023 footprints.

Key takeaways

  • What an MCP server is: a program that offers tools, data and prompt templates to AI agents in one shared format. Messages use JSON-RPC 2.0 (a standard way to write requests and replies as text), sent between programs on one computer or over the web with HTTPS.
  • The measured difference: in one test on 9 November 2026, with web search also off, Claude Code gave no building count for San Francisco. With the Wherobots MCP server it returned 162,538 in 233 seconds. 72 of those seconds went to starting a runtime, the cloud compute that runs Structured Query Language (SQL) queries. The count is Overture Maps buildings whose center lies inside the city's land boundary.
  • The check: our rerun of the agent's query from a separate session returned the same 162,538. The city's own file lists 177,023 footprints, 9% more, because it splits buildings at property lines. The land boundary measured 122.13 km², 1.0% more than the 2024 Census figure of 120.91 km².
  • Setup: adding the server to Claude Code and getting a first answer took 14 and 20 seconds in two timed runs, not counting the time to create an API key.
  • How Wherobots did it: the agent made 13 MCP tool calls, 8 of them checks for results. Its spatial query ran in WherobotsDB, the Wherobots spatial SQL engine, on a building table of 2.53 billion rows. A filter on each building's bounding box meant it read only the rows near San Francisco.

What is an MCP server?

An MCP server is one side of a connection defined by the Model Context Protocol specification. The specification names three roles. A host is the AI application a person uses, such as Claude Code, Cursor or ChatGPT. A client is the part of the host that holds the connection to one server. A server is the program that offers the tools and data.

Anthropic described MCP at launch as a standard for "connecting AI assistants to the systems where data lives." It shipped the specification and servers for Google Drive, Slack, GitHub, Git, Postgres and Puppeteer. It also shipped software development kits (SDKs), code libraries for building servers and clients. The specification says MCP took inspiration from the Language Server Protocol, Microsoft's standard that lets one code editor support many programming languages. MCP applies the same idea to AI applications and the tools they use.

Before MCP, each AI application needed its own code for each service it used. With MCP, a team writes one server for its service, and every host that supports MCP can use it.

How does an MCP server work?

A server offers three kinds of features:

  • Tools: functions the language model can choose to run, such as "run this SQL query."
  • Resources: data the host application reads and passes to the model, such as a file or a version number.
  • Prompts: message templates a person picks, such as a saved workflow.

Messages follow JSON-RPC 2.0. Each request is written in JSON (JavaScript Object Notation, a text format for data) and names a method and its inputs. The client asks for the tool list with tools/list.

Each tool comes back with a name, a description in words and a JSON Schema, a formal list of the inputs it accepts. To run a tool, the client sends tools/call with the tool's name and arguments, the inputs for that call. The server returns the result.

The transports section of the specification defines two standard ways to carry those messages:

  • stdio: the host starts the server as a program on the same computer. They exchange messages through its standard input and output, the text channels a program reads from and writes to.
  • Streamable HTTP: each message is an HTTPS request to one web address, and the server can run anywhere. The Wherobots MCP server is a remote server at https://api.cloud.wherobots.com/mcp/.
Diagram of three boxes. Claude Code or Cursor is the host, which runs the language model and holds one MCP client per server. The client exchanges JSON-RPC messages over HTTPS with the Wherobots MCP server, whose tools include list_catalogs, describe_table, submit_read_query, get_query_results and search_documentation. The server sends queries to Wherobots, where the Overture buildings table holds 2.53 billion outlines.
How a host, an MCP client and the Wherobots MCP server connect. Tool names and table size read from the Wherobots MCP server and an agent run on 9 November 2026. Building outlines: Overture Maps Foundation. Analysis: Wherobots.

Remote servers need to know who is calling. The MCP authorization section builds on OAuth, the web standard for signing in to one service from another (the OAuth 2.0 standard from the Internet Engineering Task Force). The Wherobots server accepts OAuth sign-in in the browser. For scripts and editors without OAuth support, it accepts an API key, a secret string that identifies your account, in an x-api-key header.

The specification says there should always be a human able to deny a tool call. Claude Code asks before each tool call unless you approve that tool in advance.

MCP vs API

An application programming interface (API) is the set of requests one service accepts, in that service's own format. MCP is one format for every service, and it adds the descriptions a language model needs to choose a call.

Many MCP servers sit in front of an existing API. The Wherobots MCP server and the Wherobots command line tool both send requests to Wherobots Cloud. The command line tool covers the full API, such as starting job runs. The MCP server covers what an agent needs to explore data and run spatial SQL.

The Wherobots docs describe its SQL as read-only. On 9 November 2026, though, the server also listed submit_write_query and submit_destructive_query to our account. Those tools create, change or delete tables, so approve them only when a task needs them.

MCP server examples

  • Files and code: Anthropic's first servers connected Google Drive, Slack, GitHub and Git, and Puppeteer, a tool that drives a web browser.
  • Databases: the launch included a Postgres server. A database server lets an agent read a database's list of tables and columns and run SQL queries.
  • Spatial data: the Wherobots MCP server lists catalogs, describes tables and searches the Wherobots docs. It runs spatial SQL on vector data (points, lines and shapes) and raster data (grids of cells, such as satellite images). It also reads the logs of queries and job runs.
  • Chat apps: Claude and ChatGPT connect to remote MCP servers as connectors. Wherobots is listed in the Anthropic Connectors Directory.

Why AI agents need spatial context

Language models learn from text, documents, databases, and the internet. They learn something about places from that text. Rohin Manvi and colleagues published GeoLLM at the International Conference on Learning Representations (ICLR) in 2024. They showed that prompts built from map data can draw estimates of population density and wealth from a model.

Wes Gurnee and Max Tegmark published Language Models Represent Space and Time in 2023. They found that a place's latitude and longitude can be read from the numbers a model computes for that place's name.

Those are estimates, and a spatial question often needs a count or a distance. How many buildings stand in a flood zone? Which roads stay open within 5 km of a fire? Answers like these come from joining shapes in a known coordinate system, the reference that fixes where each shape lies. The data changes with each new release.

Training text rarely holds counts like these for a given place and date. Context engineering, the practice of choosing what information a model receives for a task, works on this gap. A context engine for physical world data computes relations like these at the time of the question.

A spatial MCP server lets an agent send that computation to a database. The agent writes the query, and a geospatial database runs it and returns the number.

The Wherobots MCP server: one question, two runs

The question. We asked Claude Code: "How many buildings in Overture Maps lie inside the city of San Francisco, and what is their total footprint area in square kilometers?" Overture Maps is an open map dataset from the Overture Maps Foundation, and Wherobots hosts it in the Havasu catalog.

The claim and what would support it. The claim is that a spatial MCP server lets an agent return a measured number it cannot give from memory. If it holds, the agent with no tools gives no measured number, and the agent with the server returns one that a rerun and an outside source confirm. If the agent without tools gave a number close to the measured one, the claim would be weaker.

Run 1, no tools. We turned off every tool, including web search. Claude Code answered in 16 seconds that it had no way to run a query. It gave no number, and it wrote a SQL query for us to run. It noted that the answer depends on what counts as "inside" and on which boundary is used.

Run 2, with the Wherobots MCP server. Claude Code made 13 calls to the server in 233 seconds:

  1. Started the SQL runtime with a one-line query, because a runtime that is not running can take several minutes to start, according to the Wherobots docs. This one took 72 seconds.
  2. Read the columns of two tables with describe_table. The building table held 2,533,842,612 outlines, and the boundaries table 1,084,259 shapes.
  3. Found two San Francisco boundaries with a query on the boundaries table: one with the bay and ocean, 601.4 km², and one of land only, 122.1 km². It used the land boundary.
  4. Counted the buildings with a spatial join, a query that matches rows by where their shapes lie (spatial join). The query ran for 43 seconds.
  5. Checked for results 8 times with get_query_results while the queries ran.
Timeline of one question answered in 233 seconds through 13 tool calls: 2 table descriptions, 3 SQL queries and 8 checks for results. The SQL runtime took 72 seconds to start. The answer was 162,538 buildings.
Claude Code’s 13 calls to the Wherobots MCP server for one question on 9 November 2026, in seconds from the first call. The shaded band is the 72 seconds the SQL runtime took to start. Analysis: Wherobots.

This is the query we ran again from a separate session. It keeps the agent's join and filters, and it looks up the boundary by name in place of the code number the agent used:

WITH sf AS (
  SELECT geometry AS g
  FROM wherobots_open_data.overture_maps_foundation.divisions_division_area
  WHERE country = 'US' AND region = 'US-CA' AND subtype = 'county'
    AND names.primary = 'San Francisco' AND is_land = true
),
b AS (
  SELECT geometry
  FROM wherobots_open_data.overture_maps_foundation.buildings_building
  WHERE bbox.xmin <= -122.3277 AND bbox.xmax >= -122.5297
    AND bbox.ymin <= 37.8638 AND bbox.ymax >= 37.7082
)
SELECT
  COUNT(*) AS buildings,
  ROUND(SUM(ST_AreaSpheroid(b.geometry)) / 1e6, 2) AS footprint_km2,
  ROUND(MAX(ST_AreaSpheroid(sf.g)) / 1e6, 2) AS land_km2
FROM b JOIN sf ON ST_Within(ST_Centroid(b.geometry), sf.g)

A bounding box is the smallest rectangle around a shape. The bbox filter keeps buildings whose bounding boxes overlap the city's bounding box, so the query reads a small part of the table. ST_Within(ST_Centroid(...)) counts a building only when its center falls inside the land boundary. ST_AreaSpheroid measures each outline's area on the curved Earth from its longitude and latitude.

The result. The agent reported 162,538 buildings with 31.93 km² of footprints, the ground area inside the mapped building outlines. Counting every building with any part inside the boundary gives 162,666, or 128 more.

The checks. We reran the query from a separate session, on a runtime that was already running. In 34 seconds it returned 162,538 buildings, 31.93 km² of footprints and a land area of 122.13 km². The US Census Bureau's 2024 Gazetteer gives San Francisco County 120.91 km² of land and 600.62 km² in total. Overture's land boundary is 1.0% larger, and its full boundary 0.13% larger.

The city's own building footprints dataset lists 177,023 footprints. That is 9% more than Overture's count, because the city splits buildings at property lines. The spatial intelligence article found the same two counts. So the agent's count repeats on Overture's data, and the city's data gives a different count.

Verdict. The claim held. With no tools, the agent gave no number. With the MCP server, it found the building and boundary tables, used a boundary that matches the Census figure within 1%, and returned a count that our rerun reproduced.

What the test leaves out. It is one question, one agent and one day. A building count measures what Overture maps: buildings missing from its sources are missing from the count.

About 72 of the 233 seconds went to starting the runtime. The count query finished about 144 seconds in, and the answer came at 233 seconds, after more waits and checks. The Wherobots docs note that large operations, such as planet-wide analysis or areas reachable within a set driving time, may time out through the MCP server.

Set up the Wherobots MCP server in Claude Code and Cursor

You need a Wherobots account. For the API key route, you need a Wherobots API key stored in an environment variable named WHEROBOTS_API_KEY. An environment variable holds a value that programs on your computer can read, so the key stays out of the config file. Also keep the key out of version control, the system that stores your code's history.

Claude Code

From your project folder, run:

claude mcp add --transport http wherobots https://api.cloud.wherobots.com/mcp/ --scope project \
  --header 'x-api-key: ${WHEROBOTS_API_KEY}'

The single quotes keep the placeholder as text, and Claude Code reads the key from your environment when it connects. The command writes this .mcp.json file, which you can also create by hand:

{
  "mcpServers": {
    "wherobots": {
      "type": "http",
      "url": "https://api.cloud.wherobots.com/mcp/",
      "headers": {
        "x-api-key": "${WHEROBOTS_API_KEY}"
      }
    }
  }
}

Start claude in the folder and approve the server when asked. Claude Code asks once for each server in a project's .mcp.json, as its MCP documentation explains. Then ask: "List the catalogs in my Wherobots organization." The answer should include wherobots_open_data.

To sign in with your browser, run claude mcp add --transport http wherobots https://api.cloud.wherobots.com/mcp/ --scope project with no header. Add --scope user in place of --scope project to use the server in every project. We timed the API key setup twice on 9 November 2026, with Claude Code version 2.1.319. From the claude mcp add command to the agent's first answer took 14 and 20 seconds.

Cursor

Open Cursor Settings, then Tools & MCPs, then Add Custom MCP. Cursor opens .cursor/mcp.json in your project. Paste this and save:

{
  "mcpServers": {
    "wherobots": {
      "url": "https://api.cloud.wherobots.com/mcp/",
      "headers": {
        "x-api-key": "${env:WHEROBOTS_API_KEY}"
      }
    }
  }
}

Cursor reads environment variables with ${env:NAME}, as its MCP documentation explains. The top key must be mcpServers, and Cursor rejects a "type": "http" field, according to the Wherobots editor setup guide. Reload the window. The server should show a green dot in Tools & MCPs. To sign in with your browser, leave out the headers block.

Before you ask a big question

  • Start the runtime first. Ask a small question first, such as a row count, so the SQL runtime is running before the real work. In our run it took 72 seconds to start.
  • Approve only the tools you need. For exploring data, list_catalogs, describe_table, submit_read_query, get_query_results and search_documentation are enough. Leave submit_write_query and submit_destructive_query unapproved unless a task must change tables.
  • Name the boundary. Ask for "the land boundary" or "city limits" when it matters. San Francisco's two boundaries differ by a factor of five in area.

MCP research and what changes at scale

MCP builds on a line of research on language models that call tools. Timo Schick and colleagues trained a model to decide when to call a calculator, a search engine or a calendar in Toolformer (2023). Shunyu Yao and colleagues interleaved reasoning steps with actions in ReAct (ICLR 2023). Shishir Patil and colleagues trained a model to write calls to machine learning APIs from Hugging Face, TorchHub and TensorHub in Gorilla (2023). Yujia Qin and colleagues collected more than 16,000 real APIs in ToolLLM (2023).

Each of these projects wrote its own code to connect a model to its tools. MCP made that connection one shared standard.

Xinyi Hou and colleagues mapped the MCP ecosystem and its security risks in Model Context Protocol (MCP): Landscape, Security Threats, and Future Research Directions (2025). They describe 16 threat scenarios from four sources of threat: malicious developers, outside attackers, malicious users and security flaws. Hosts reduce the risk with approval prompts. Servers reduce it with sign-in and narrow permissions. On the client side, that means approving read tools and leaving write and delete tools off.

The building table in our run holds 2.53 billion rows, too large to send to an agent. The server returns one row of results, and the work happens in a distributed engine, which splits a query across many computers.

Wherobots was founded by the creators of Apache Sedona, an open source project that began as GeoSpark. Jia Yu, Jinxuan Wu and Mohamed Sarwat described it in GeoSpark at the 2015 conference of ACM SIGSPATIAL, the Association for Computing Machinery's peer-reviewed group on geographic information systems. Yu, Zhang and Sarwat extended the design in Spatial data management in Apache Spark: the GeoSpark perspective and beyond (GeoInformatica, 2019). Through the MCP server, an agent's spatial question runs on WherobotsDB, a distributed engine for spatial queries.

Two limits remain at scale. A runtime that has to start adds a minute or more to the first answer. The server limits how much data one response can return. Its instructions tell the agent to ask for totals, filters and fewer columns, and large results come back as a file link. Longer pipelines belong in job runs, as in the geospatial intelligence pipelines built with the Wherobots MCP server.

Conclusions

  1. An MCP server is a program that offers tools to AI agents in one shared format. Hosts such as Claude Code, Cursor and ChatGPT list its tools and call them with JSON-RPC messages, so one server works in every host that supports MCP.
  2. For a measured spatial answer, an agent needs a tool that runs the query. With no tools, Claude Code gave no count of San Francisco's buildings. Through the Wherobots MCP server it returned 162,538, and our rerun reproduced it. This is one test of one question.
  3. The agent's number is only as good as its boundary and its data. If a question names a place, check which boundary the agent used. Buildings missing from the source data are missing from the count. Here the land boundary matched the Census figure within 1%, and the city's own file counts 9% more buildings because it splits them at property lines.
  4. Setting up a remote MCP server takes seconds, and a stopped runtime adds a minute or more. Adding the server took 14 and 20 seconds to a first answer in our runs, not counting the time to create an API key. A first query on a stopped runtime took 72 seconds more to start. If your first question is a large one, start the runtime with a small query first.
  5. Treat every MCP server as code with access to your data. Keep keys in environment variables, approve only the tools a task needs, and prefer servers with sign-in and read-only defaults.
  • Context engine: the system that computes and serves the context AI models receive
  • Context engineering: choosing what information a model receives at each step
  • Geospatial AI: machine learning and AI agents applied to maps and satellite images
  • Physical AI: AI models that take in sensor data about the physical world and output actions
  • Spatial intelligence: AI models that compute positions and shapes in 3D space from images or sensor data
  • Spatial join: matching rows of two tables by where their shapes lie
  • Building footprint: the outline of a building on a map

Read more from Wherobots

Connect your AI agent to Overture Maps and other open data through the Wherobots MCP server. Start a free trial of Wherobots Cloud, then follow the Wherobots MCP server setup guide.

Frequently asked questions

What is an MCP server?

An MCP server is a program that offers tools and data to AI applications through the Model Context Protocol (MCP), an open standard that Anthropic released on 25 November 2024. An AI agent, such as Claude Code or Cursor, connects to the server and asks it for a list of tools. When a question needs one, the agent sends a call with arguments and gets back a result to use in its answer.

How does an MCP server work?

The host is the AI application you use, and it holds one MCP client, its connection to one server, for each server. The client and server exchange JSON-RPC 2.0 messages, a standard way to write requests and replies as text. A local server runs as a program on your computer and exchanges messages through the text channels a program reads from and writes to. A remote server answers HTTPS requests. The client asks for the tool list with tools/list and runs a tool with tools/call.

What is the difference between MCP and an API?

An application programming interface (API) is the set of requests one service accepts, and each API has its own format. MCP is one shared format that any AI agent can use to find and call tools. An MCP server often sits in front of an API. It describes each operation in words and with a formal list of the inputs it accepts, so an agent can choose the right call without code written for that API.

Is an MCP server free or paid?

The protocol is open and free to use, and anyone can write a server. A service behind a server may charge for what it does. The Wherobots MCP server bills only when it runs a query. Each query runs on a runtime, the cloud compute for Structured Query Language (SQL) queries. You pay for that runtime, according to the Wherobots MCP server documentation.

Does ChatGPT use MCP?

Yes. ChatGPT can connect to remote MCP servers as connectors on paid plans. The Wherobots guide to setting up Wherobots in an AI assistant lists ChatGPT Plus, Pro, Business and Enterprise, alongside Claude, Claude Code, Codex and OpenCode.

What are examples of MCP servers?

Anthropic released servers for Google Drive, Slack, GitHub, Git, Postgres and Puppeteer with the protocol in 2024. Companies now run their own, such as the Wherobots MCP server for spatial data. The Wherobots server lists catalogs, describes tables, searches documentation and runs spatial SQL on maps, buildings and satellite data.

How do I add an MCP server to Claude Code?

Run claude mcp add --transport http wherobots https://api.cloud.wherobots.com/mcp/ and sign in with your browser when Claude Code first uses the server. To use an API key, add --header 'x-api-key: ${WHEROBOTS_API_KEY}' with the key in that environment variable. In our two timed runs, setup to the first answer took 14 and 20 seconds.

How do I add an MCP server to Cursor?

Open Cursor Settings, then Tools & MCPs, then Add Custom MCP. Cursor opens .cursor/mcp.json in your project. Paste an mcpServers entry with the server’s URL, save the file, and reload the window. The Wherobots server then appears in the list with a green dot when it is connected.

Can an AI agent answer spatial questions without an MCP server?

In our test on 9 November 2026, it could not give a count. Asked how many buildings Overture Maps records in San Francisco, Claude Code with no tools gave no number and offered a query it could not run. With the Wherobots MCP server it ran that count as a spatial query and returned 162,538 buildings.

Is the Model Context Protocol secure?

The protocol leaves most safety choices to hosts and servers. Its specification says a person should be able to deny any tool call, and remote servers can require OAuth sign-in. Xinyi Hou and colleagues describe 16 threat scenarios in a 2025 survey, from malicious server developers to outside attackers. Allow only the tools an agent needs, and keep keys in environment variables.