Skip to main content
Glama

Ordnance Survey MCP Server

by CHRISCARLON

Ordnance Survey - MCP Server

VERSION: 0.1.1

A Python-based MCP server that provides access to the Ordnance Survey APIs, supporting both STDIO and HTTP (streamable) modes.

Overview

This service creates a bridge between MCP clients and OS DataHub APIs - making it easy to query national geographic data through a standardised protocol.

It can run in two modes:

  • STDIO mode: Ideal for Claude Desktop and local tool integration such as Cursor
  • HTTP (streamable) mode: Perfect for web clients/applications

Project Structure

  • api_service - Asynchronous HTTP client implementation for the OS APIs
    • Handles authentication, request formatting, and response processing
    • Manages rate limiting and error handling
    • Provides a clean interface to the external API endpoints
  • mcp_service - Exposes OS APIs functionality as MCP tools
    • Converts API responses to MCP-compatible formats
    • Implements business logic for feature operations
    • Provides a standardised interface
  • middleware - Middleware for the MCP server
    • stdio_middleware.py: Handles authentication for STDIO transport
    • http_middleware.py: Handles authentication for HTTP transport
  • prompt_templates - Prompt templates for common operations
    • Provides pre-configured prompt templates to help you get started with some common operations
  • config_docs - Documentation for OS APIs
    • Provides documentation for the OS APIs
  • utils - Utility functions for the MCP server
    • Provides utility functions for the MCP server such as logging

Features

  • Collection management (listing and querying collections)
  • Feature search with spatial and attribute filters
  • Individual feature retrieval by ID
  • Linked identifier operations
  • Bulk feature operations

Requirements

  • Python 3.11+
  • OS API Key (set as environment variable OS_API_KEY)
  • You will need to register for an OS Data Hub account to get an API key

Running the Server

1. STDIO Mode (for Claude Desktop)

This is the default mode, ideal for integration with Claude Desktop or other MCP hosts that use STDIO.

  1. Configure your MCP host (e.g., 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. Start the server manually (for testing):
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

2. HTTP (Streamable) Mode

This mode is ideal for web clients or when you need to stream large datasets.

You will need to set the OS_API_KEYand BEARER_TOKEN environment variables.

Each request to the MCP server will need to be authenticated with a bearer token - it's currently set to dev-token in the client test script.

  1. Start the server:
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

Note: The client test script (client_test.py) is a great way to verify your server setup and see example code for programmatic interaction with the API. It uses the mcp.client.streamable_http library to demonstrate proper connection handling and tool calling.

The client script demonstrates:

  • Connecting to the MCP server
  • Initialising a session
  • Listing available tools
  • Making test calls (e.g., hello_world tool)

Available Tools

All tools are available 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 - THIS DOES NOT WORK - NEED TO FIX

Using Prompt Templates

This service provides pre-configured prompt templates to help you get started.

To access these templates ask Claude "show me available prompt templates"

Current prompt templates are:

  • connected_usrns - Find all USRNs that are directly connected to a given USRN

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

This project does not have the endorsement of Ordnance Survey.

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

A Python-based MCP server that provides access to Ordnance Survey APIs, allowing querying of geographic data through a standardized protocol with features like collection management, feature search, and spatial filtering.

  1. Overview
    1. Project Structure
      1. Features
        1. Requirements
          1. Running the Server
            1. STDIO Mode (for Claude Desktop)
            2. HTTP (Streamable) Mode
          2. Available Tools
            1. Using Prompt Templates
              1. Contributing
                1. License

                  Related MCP Servers

                  • A
                    security
                    A
                    license
                    A
                    quality
                    The MCP server provides an interface to the Datadog API, enabling seamless management of incidents, monitoring, logs, dashboards, metrics, traces, and hosts. Its extensible design allows easy integration of additional Datadog APIs for future expansions.
                    Last updated -
                    14
                    322
                    36
                    TypeScript
                    Apache 2.0
                    • Apple
                  • A
                    security
                    F
                    license
                    A
                    quality
                    An MCP server implementation that enables interaction with the Unstructured API, providing tools to list, create, update, and manage sources, destinations, and workflows.
                    Last updated -
                    39
                    28
                    • Apple
                  • -
                    security
                    F
                    license
                    -
                    quality
                    An MCP server that provides access to Paylocity API endpoints, allowing retrieval of employee data, earnings, company codes, local taxes, and pay statements.
                    Last updated -
                    Python
                    • Apple
                  • -
                    security
                    F
                    license
                    -
                    quality
                    A Python-based server that helps users easily install and configure other MCP servers across different platforms.
                    Last updated -
                    2
                    Python
                    • Apple
                    • Linux

                  View all related MCP servers

                  MCP directory API

                  We provide all the information about MCP servers via our MCP API.

                  curl -X GET 'https://glama.ai/api/mcp/v1/servers/CHRISCARLON/os-mcp'

                  If you have feedback or need assistance with the MCP directory API, please join our Discord server