This directory contains examples of how to use the Stadia Maps MCP server.
anthropic-sdk-demo.ts demonstrates how to use the MCP server with the Anthropic SDK.
This lets you create applications combining Claude's generalist abilities
with the spatial intelligence of the Stadia Maps API.
The example code demonstrates the basics of an integration, including selecting a subset of tools to use, initializing a local MCP server, and handling tools in an interaction which can span multiple turns back and forth.
Refer to the Anthropic documentation for current best practices.
You must these environment variables before running the demo:
STADIA_MAPS_API_KEY: Your Stadia Maps API keyANTHROPIC_API_KEY: Your Anthropic API key
Set these in your IDE run window (e.g. WebStorm)
or via the command line (i.e. export STADIA_MAPS_API_KEY=YOUR-API-KEY in most shells).
You can get a Stadia Maps API key for free to try out the APIs used in this example. Just click the link above for more info. You will also need an Anthropic API key, and you can find more info on their website. As of June 2025, running this demo will cost approximately $0.15 worth of Anthropic API credits.
We'll use bun as it's fast and able to execute TypeScript scripts directly.
-
First, build the main MCP server:
cd .. && bun run build
-
Then the demo:
bun run start:anthropic-demo