CO

Companies House MCP Server for UK API Integration

Connect UK Companies House data with ease using the MCP server for seamless API integration and secure, developer-friendly access.

Quick Install
npx -y @stefanoamorelli/companies-house-mcp

Overview

This MCP (Model Context Protocol) server adapts the UK Companies House REST API into an MCP-compatible backend so language models and agents can query company data in a safe, structured way. It exposes a small web service that forwards authenticated requests to Companies House, normalizes responses into tool-like operations, and presents them via the MCP protocol so LLMs or orchestration frameworks can call them as tools.

Use it when you want to integrate Companies House data into an LLM-driven workflow, agent, or automation pipeline without embedding your Companies House API key into model prompts. The server handles authentication, rate guidance, basic caching and request shaping, and exposes a predictable set of tool endpoints for search, company profiles, filings, and officers.

Features

  • MCP-compatible server endpoint to let LLMs call Companies House tools directly
  • Tool wrappers for common Companies House operations: search, company profile, filings, officers
  • Simple configuration via environment variables (.env)
  • Docker support for quick deployment
  • Basic caching and request validation to reduce redundant API calls
  • Authentication and optional token-based access control for the MCP endpoint
  • Small codebase intended for easy inspection and extension

Installation / Configuration

Clone the repository and run locally, or use Docker.

Clone and run (Node.js example)

git clone https://github.com/stefanoamorelli/companies-house-mcp.git
cd companies-house-mcp
# install dependencies (example)
npm install

# create .env with required settings
cat > .env <<'EOF'
COMPANIES_HOUSE_API_KEY=your_companies_house_api_key
PORT=3000
MCP_ACCESS_TOKEN=replace-with-your-server-token
CACHE_TTL=3600
EOF

# start
npm start

Docker

# Build
docker build -t companies-house-mcp .

# Run
docker run -d \
  -e COMPANIES_HOUSE_API_KEY=your_companies_house_api_key \
  -e MCP_ACCESS_TOKEN=replace-with-your-server-token \
  -e PORT=3000 \
  -p 3000:3000 \
  --name ch-mcp companies-house-mcp

Environment variables

  • COMPANIES_HOUSE_API_KEY — (required) API key for developer.company-information.service.gov.uk
  • PORT — port the server listens on (default: 3000)
  • MCP_ACCESS_TOKEN — token for authenticating calls to the MCP endpoint
  • CACHE_TTL — (optional) cache time-to-live in seconds for GET responses

Security and deployment notes

  • Keep COMPANIES_HOUSE_API_KEY and MCP_ACCESS_TOKEN secret; use a secrets manager when deploying.
  • Optionally, restrict incoming access with network controls or an API gateway.
  • Respect Companies House rate limits; the server includes basic guidance but you should monitor usage.

Available Tools / Resources

The server exposes MCP-compatible tools (listed here with their Companies House API equivalents):

Tool namePurposeCompanies House endpoint
companies_searchSearch companies by name or number/search/companies
company_profileFetch company profile by company_number/company/{company_number}
filing_historyRetrieve filing history for a company/company/{company_number}/filing-history
officers_listList officers for a company/company/{company_number}/officers
registered_officeGet registered office address/company/{company_number}/registered-office-address

Typical server endpoints

  • POST /mcp — MCP protocol entrypoint for LLMs/agents (expects MCP-compliant JSON and the access token)
  • GET /tools/companies_search?q=… — quick REST-style access for developers
  • GET /tools/company/{company_number} — fetch profile JSON

External resources

  • GitHub repository: https://github.com/stefanoamorelli/companies-house-mcp
  • Companies House API docs: https://developer.company-information.service.gov.uk/
  • Model Context Protocol (MCP) reference: consult your MCP-compatible LLM/agent framework docs for payload expectations

Use Cases

  1. LLM-driven due diligence assistant

    • Scenario: An internal agent answers questions about a target company.
    • Flow: The model requests “company_profile” and “filing_history” for a company number using the MCP endpoint. The server returns structured JSON, which the model uses to compose a summary.
  2. CRM enrichment

    • Scenario: Enrich CRM records with verified registered office and officer names.
    • Flow: For each company number in the CRM, call the /tools/company/{company_number} and /tools/company/{company_number}/officers endpoints to populate fields automatically.
  3. Compliance monitoring

    • Scenario: Monitor clients for newly-filed documents.
    • Flow: Periodic jobs use the filing_history tool to detect new filings; when an important filing is found, notify compliance teams.
  4. Conversational search bot for corporate data

    • Scenario: Build a chat interface that answers questions like “Who are the directors of X Ltd?” or “Has company Y filed accounts this year?”
    • Flow: The bot routes intent to the proper MCP tool, retrieves the normalized data, and produces an evidence-based answer.

Example requests

MCP-style POST (replace token and host)

curl -X POST https://your-host.example.com/mcp \
  -H "Authorization: Bearer replace-with-your-server-token" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "mcp-enabled-model",
    "input": "Find the registered office for company 01234567",
    "tools": ["company_profile"]
  }'

Direct tool GET (developer convenience)

curl "http://localhost:3000/tools/company/01234567" \
  -H "Authorization: Bearer replace-with-your-server-token"

Troubleshooting

  • 401 Unauthorized: Verify MCP_ACCESS_TOKEN matches and is sent in Authorization header.
  • 403 / 429 from Companies House: Check your API key usage and adhere to rate limits.
  • Missing fields: Companies House may not provide all fields for every