gleif-mcp-server
A Model Context Protocol server that provides access to the GLEIF REST API for querying legal entity information, LEI records, issuer details, and organizational relationships.
README
GLEIF MCP Server
A Model Context Protocol (MCP) server that provides seamless access to the GLEIF (Global Legal Entity Identifier Foundation) REST API. This server enables AI assistants and other MCP-compatible applications to query legal entity information, including LEI records, issuer details, and hierarchical relationships between organizations.
Features
🔍 LEI Record Management
- Search & Retrieve: Find LEI records by various criteria (legal name, LEI code, jurisdiction)
- Fuzzy Matching: Approximate search with auto-completion for entity discovery
- Live Data: Real-time access to the most current GLEIF database
🏢 Entity Information
- Legal Entity Details: Complete legal name, jurisdiction, status, and registration info
- Address Data: Headquarters and legal addresses with full geographical details
- Entity Relationships: Parent-subsidiary relationships and ownership structures
🌍 Reference Data
- Country Codes: ISO 3166 country code lookups and validation
- Legal Forms: Entity Legal Form (ELF) code reference data
- Issuer Network: Information about LEI issuing organizations (LOUs)
🔧 Developer Tools
- Field Metadata: Comprehensive API field documentation and filtering capabilities
- Pagination: Efficient handling of large result sets
- Type Safety: Full Python type hints and Pydantic validation
Quick Start
Installation
pip install gleif-mcp-server
Start the MCP Server
# Start server on default port (8000)
gleif-mcp-server
# Or specify custom port
gleif-mcp-server --port 8080
Use as Python Client
from gleif_mcp import client
# Get specific LEI record
lei_data = client.get_lei_record("529900T8BM49AURSDO55")
print(f"Entity: {lei_data['entity']['legalName']}")
# Search for entities
results = client.search_lei_records("entity.legalName", "Citibank")
for record in results['data']:
print(f"Found: {record['entity']['legalName']}")
# Fuzzy search with suggestions
suggestions = client.fuzzy_completions("entity.legalName", "Apple Inc")
MCP Integration
This server is compatible with any MCP client, including:
- Claude Desktop: Add to your
claude_desktop_config.json - Cline/Windsurf: Configure as an MCP server
- Custom Applications: Use the standard MCP protocol
Configuration Example
{
"mcpServers": {
"gleif": {
"command": "gleif-mcp-server",
"args": []
}
}
}
API Coverage
The server provides access to all major GLEIF API endpoints:
| Category | Endpoint | Description |
|---|---|---|
| LEI Records | /lei-records |
Search and retrieve LEI records |
| LEI Records | /lei-records/{lei} |
Get specific LEI record by code |
| Search | /lei-records/fuzzy-completions |
Fuzzy matching for entity names |
| Search | /lei-records/auto-completions |
Auto-complete suggestions |
| Issuers | /lei-issuers |
List accredited LEI issuers |
| Issuers | /lei-issuers/{id} |
Get specific issuer details |
| Reference | /countries |
ISO 3166 country codes |
| Reference | /entity-legal-forms |
ELF codes and descriptions |
| Metadata | /fields |
API field catalog and filtering options |
Development
Setup Development Environment
# Clone the repository
git clone https://github.com/GenAICPA/gleif-mcp-server.git
cd gleif-mcp-server
# Install in development mode
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
Run Tests
# Run all tests
pytest
# Run tests with coverage
pytest --cov=gleif_mcp
# Skip live API tests (for CI)
pytest -m "not live"
# Run only integration tests
pytest -m integration
Code Quality
# Format code
black gleif_mcp tests
# Lint code
ruff check gleif_mcp tests
# Type checking
mypy gleif_mcp
Examples
Find Entity by Name
# Search for entities containing "Microsoft"
results = client.search_lei_records("entity.legalName", "*Microsoft*")
for entity in results['data'][:5]: # Show first 5 results
print(f"LEI: {entity['lei']}")
print(f"Name: {entity['entity']['legalName']}")
print(f"Country: {entity['entity']['jurisdiction']}")
print("---")
Get Entity Hierarchy
# Get parent company information
lei = "529900T8BM49AURSDO55" # Example LEI
record = client.get_lei_record(lei)
if record['entity'].get('parent'):
parent_lei = record['entity']['parent']['lei']
parent_data = client.get_lei_record(parent_lei)
print(f"Parent: {parent_data['entity']['legalName']}")
Country and Legal Form Lookup
# Get country information
country = client.get_country("US")
print(f"Country: {country['name']} ({country['code']})")
# List available legal forms
legal_forms = client.list_entity_legal_forms()
for form in legal_forms['data'][:10]:
print(f"{form['code']}: {form['name']}")
Contributing
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes and add tests
- Ensure all tests pass and code is formatted
- Submit a pull request
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Acknowledgments
- GLEIF for providing the comprehensive LEI database and API
- Model Context Protocol for the standard protocol specification
- FastAPI for the excellent web framework
Support
Note: This is an unofficial implementation. GLEIF does not endorse or maintain this server.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。