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.
npx -y @stefanoamorelli/companies-house-mcpOverview
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)
# install dependencies (example)
# create .env with required settings
# start
Docker
# Build
# Run
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 name | Purpose | Companies House endpoint |
|---|---|---|
| companies_search | Search companies by name or number | /search/companies |
| company_profile | Fetch company profile by company_number | /company/{company_number} |
| filing_history | Retrieve filing history for a company | /company/{company_number}/filing-history |
| officers_list | List officers for a company | /company/{company_number}/officers |
| registered_office | Get 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
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.
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.
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.
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)
Direct tool GET (developer convenience)
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