Ordnance Survey National Geographic Database MCP server

Provides a bridge to the Ordnance Survey National Geographic Database, enabling queries of UK geographic data for applications like urban planning, transportation analysis, and location-based services.
Back to servers
Setup instructions
Provider
Chris Carlon
Release date
May 06, 2025
Stats
2 stars

The Ordnance Survey MCP server provides access to OS APIs through a standardized protocol, creating a bridge between MCP clients and OS DataHub APIs for querying national geographic data. It supports both STDIO mode (ideal for Claude Desktop and local tool integration) and HTTP streamable mode.

Installation Options

Docker Installation (for Claude Desktop)

  1. Build the Docker image:
docker build -t os-mcp-server .
  1. Configure Claude Desktop by adding this to your configuration:
{
  "mcpServers": {
    "os-mcp-server": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-e",
        "STDIO_KEY=your-key-here",
        "-e",
        "OS_API_KEY=ADD_KEY",
        "os-mcp-server"
      ]
    }
  }
}

Note: Replace ADD_KEY with your actual OS API key from the OS Data Hub.

STDIO Mode Installation (for Claude Desktop)

  1. Configure your MCP host in Claude Desktop's configuration:
{
  "mcpServers": {
    "os-ngd-api": {
      "command": "/Users/username/.local/bin/uv",
      "args": ["--directory", "src/", "run", "server.py"],
      "env": {
        "OS_API_KEY": "your_api_key_here",
        "STDIO_KEY": "your_api_key_here"
      }
    }
  }
}
  1. For manual testing, start the server:
export OS_API_KEY=your_api_key_here
export STDIO_KEY=your_stdio_key_here
python server.py --transport stdio  # or just python server.py

HTTP (Streamable) Mode Installation

  1. Set environment variables and start the server:
export OS_API_KEY=your_api_key_here
export BEARER_TOKEN=dev-token
python server.py --transport streamable-http --host 0.0.0.0 --port 8000
  1. Test using the provided client script:
python src/client_test.py

Available Tools

The MCP server provides these tools in both STDIO and HTTP modes:

  • hello_world - Test connectivity
  • check_api_key - Verify API key configuration
  • list_collections - List available feature collections
  • get_collection_info - Get details about a specific collection
  • get_collection_queryables - Get filterable properties for a collection
  • search_features - Search features by various criteria
  • get_feature - Retrieve a specific feature by ID
  • get_linked_identifiers - Find related identifiers
  • get_bulk_features - Retrieve multiple features in a single call
  • get_bulk_linked_features - Get linked features in bulk
  • get_prompt_templates - Get standard prompt templates for common operations
  • search_by_uprn - Search for addresses by UPRN
  • search_by_post_code - Search for addresses by POSTCODE
  • get_map_tile - Get a map tile in EPSG:27700 projection (currently not working)

Using Prompt Templates

The service provides pre-configured prompt templates for geospatial analysis workflows. Ask Claude "show me available prompt templates" to access these templates.

Template Categories

Basic USRN Analysis

  • usrn_breakdown - Break down USRN into component road links
  • usrn_network_connections - Find connected USRNs through the road network
  • usrn_named_road_analysis - Analyze named roads including the USRN

Routing & Navigation

  • route_between_usrns - Build topological route between two USRNs
  • usrn_to_address_routing - Route from USRN to specific address
  • usrn_junction_analysis - Analyze junctions involving USRN

Accessibility & Mobility

  • usrn_accessibility_analysis - Analyze accessibility routing options
  • usrn_path_integration - Find pedestrian/cycle path integration points
  • cycling_routing_usrn - Plan cycling routes involving USRN

Multimodal Transport

  • usrn_multimodal_access - Find all transport access points
  • usrn_rail_connections - Find railway connections near USRN
  • usrn_tram_analysis - Analyze tram connections

Network Analysis

  • build_usrn_network_graph - Build routing network graph centered on USRN
  • usrn_road_link_analysis - Analyze Road Links within USRN

Emergency & Specialized Routing

  • emergency_services_routing - Plan emergency services routing
  • freight_routing_usrn - Plan freight/HGV routing
  • usrn_traffic_optimization - Plan traffic-optimized routes

Spatial Analysis

  • usrn_spatial_analysis - Comprehensive spatial analysis
  • usrn_compound_structure_analysis - Find compound structures affecting routing
  • route_compound_structures_analysis - Find structures along routes between USRNs
  • route_bridge_tunnel_analysis - Analyze bridges and tunnels along route
  • route_infrastructure_obstacles - Identify obstacles along route
  • route_multimodal_crossings - Find multimodal crossings along route
  • freight_route_structure_clearances - Analyze clearances for freight routing

Linked Identifiers

  • uprn_to_road_infrastructure - Connect property addresses to road infrastructure

Example Template Usage

You can ask Claude to use specific templates:

  • "Use the route_between_usrns template to find a route from USRN 12345 to USRN 67890"
  • "Apply the emergency_services_routing template for USRN 12345"
  • "Run the freight_routing_usrn analysis for USRN 12345"

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "os-mcp-server" '{"command":"docker","args":["run","--rm","-i","-e","STDIO_KEY=your-key-here","-e","OS_API_KEY=ADD_KEY","os-mcp-server"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "os-mcp-server": {
            "command": "docker",
            "args": [
                "run",
                "--rm",
                "-i",
                "-e",
                "STDIO_KEY=your-key-here",
                "-e",
                "OS_API_KEY=ADD_KEY",
                "os-mcp-server"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "os-mcp-server": {
            "command": "docker",
            "args": [
                "run",
                "--rm",
                "-i",
                "-e",
                "STDIO_KEY=your-key-here",
                "-e",
                "OS_API_KEY=ADD_KEY",
                "os-mcp-server"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later