companies-house-mcp
Enables AI assistants to search and retrieve UK Companies House data including company profiles, officers, and filing history via the official API.
README
Companies House MCP Server
A Model Context Protocol (MCP) server that provides AI assistants with access to UK Companies House data. This server enables AI tools to search for companies, retrieve detailed company profiles, officer information, and filing history through the official Companies House API.
Features
- Company Search: Search for UK companies by name or keyword
- Company Profiles: Get detailed company information including registration details, addresses, and status
- Officer Information: Retrieve lists of company officers (directors, secretaries, etc.)
- Filing History: Access company filing history and documents
- MCP Compatible: Works with any MCP-compatible AI assistant or client
Prerequisites
- Node.js 18 or higher
- Companies House API key (free registration at Companies House Developer Hub)
Installation
- Clone the repository:
git clone <repository-url>
cd companies-house-mcp
- Install dependencies:
npm install
- Set up environment variables:
cp .env.example .env
# Edit .env and add your Companies House API key
- Build the project:
npm run build
Configuration
Create a .env file in the project root:
COMPANIES_HOUSE_API_KEY=your_api_key_here
COMPANIES_HOUSE_BASE_URL=https://api.company-information.service.gov.uk
Getting a Companies House API Key
- Visit the Companies House Developer Hub
- Create an account or sign in
- Register a new application
- Copy your API key to the
.envfile
Usage
Development
Start the development server with hot reload:
npm run dev
Production
Build and start the production server:
npm run build
npm start
Docker
Run using Docker:
docker build -t companies-house-mcp .
docker run -e COMPANIES_HOUSE_API_KEY=your_api_key_here companies-house-mcp
Or use Docker Compose:
docker-compose up
MCP Client Configuration
Local Development (Stdio Transport)
For local development or direct MCP client usage:
{
"mcpServers": {
"companies-house": {
"command": "node",
"args": ["/absolute/path/to/companies-house-mcp/dist/index.js"],
"env": {
"COMPANIES_HOUSE_API_KEY": "your_api_key_here"
}
}
}
}
Cloud Deployment (HTTP Bridge)
For cloud deployment where the HTTP server runs remotely:
- Start HTTP server on cloud server:
npm run start:http
- Configure client to use HTTP bridge:
{
"mcpServers": {
"companies-house-http": {
"command": "node",
"args": ["/absolute/path/to/companies-house-mcp/simple-http-bridge.js"],
"env": {
"COMPANIES_HOUSE_API_KEY": "your_api_key_here",
"MCP_HTTP_SERVER_URL": "http://your-server:3000"
}
}
}
}
Note: For cloud deployment, see README-HTTP.md for detailed HTTP bridge configuration.
Available Tools
The server provides the following tools for AI assistants:
1. search_companies
Search for UK companies by name or keyword.
Parameters:
query(string, required): Search query for company name or keyworditems_per_page(number, optional): Number of results to return (default: 20)
Example:
{
"name": "search_companies",
"arguments": {
"query": "Apple",
"items_per_page": 10
}
}
2. get_company_profile
Get detailed company profile information.
Parameters:
company_number(string, required): Company number (e.g., "12345678")
Example:
{
"name": "get_company_profile",
"arguments": {
"company_number": "12345678"
}
}
3. get_company_officers
Get list of company officers (directors, secretaries, etc.).
Parameters:
company_number(string, required): Company number (e.g., "12345678")
Example:
{
"name": "get_company_officers",
"arguments": {
"company_number": "12345678"
}
}
4. get_company_filings
Get company filing history.
Parameters:
company_number(string, required): Company number (e.g., "12345678")items_per_page(number, optional): Number of filings to return (default: 25)
Example:
{
"name": "get_company_filings",
"arguments": {
"company_number": "12345678",
"items_per_page": 50
}
}
Development
Scripts
Core MCP Server (Stdio):
npm run dev- Start development server with hot reloadnpm run build- Compile TypeScript to JavaScriptnpm run start- Start production stdio servernpm run type-check- Run TypeScript type checking
HTTP Bridge (Cloud Deployment):
npm run start:http- Start HTTP server for cloud deploymentnpm run dev:http- Start HTTP server in development modenpm run bridge- Start HTTP bridge client
Project Structure
companies-house-mcp/
├── src/
│ ├── index.ts # Stdio MCP server entry point
│ ├── server.ts # Core MCP server implementation
│ ├── http-index.ts # HTTP server entry point
│ ├── http-server.ts # HTTP server implementation
│ ├── types.ts # TypeScript type definitions
│ └── services/
│ └── companies-house.ts # Companies House API client
├── simple-http-bridge.js # HTTP bridge client
├── dist/ # Compiled JavaScript files
├── .env # Environment variables
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── Dockerfile # Docker configuration
├── docker-compose.yml # Docker Compose configuration
├── README.md # Main documentation
└── README-HTTP.md # HTTP bridge documentation
API Rate Limits
The Companies House API has rate limits. Please refer to the official documentation for current limits and best practices.
Error Handling
The server includes comprehensive error handling:
- API errors are wrapped in MCP error format
- Invalid company numbers return appropriate error messages
- Network errors are caught and reported
- Missing API keys are detected at startup
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
This project is licensed under the ISC License.
Support
For issues related to:
- This MCP server: Open an issue in this repository
- Companies House API: Visit the Companies House Developer Hub
- Model Context Protocol: Visit the MCP documentation
Disclaimer
This is an unofficial client for the Companies House API. Please ensure you comply with the Companies House API terms of service and data usage policies.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。