gleif-mcp-server
This server provides comprehensive tools to look up, validate, search, and analyze Legal Entity Identifiers (LEIs) using the official GLEIF database (2.8M+ entities across 200+ jurisdictions), supporting KYC, compliance, due diligence, and financial analysis.
Core LEI Lookup & Validation
Look up a specific LEI: Retrieve full entity details (legal name, address, jurisdiction, status, managing LOU, renewal dates)
Validate an LEI: Check format, ISO 17442 check digits, and registration status
Batch LEI lookup: Query up to 100 LEIs in a single request
Search
Search by name: Find companies using fuzzy matching and pagination
Autocomplete: Get name suggestions from a prefix (min 2 characters)
Search by BIC/SWIFT: Find a bank's LEI from its BIC/SWIFT code
Search by ISIN: Find a security issuer's LEI from an ISIN code
Search by country: List entities registered in a specific country using ISO 2-letter codes
Corporate Ownership & Relationships
Get relationships: Explore direct parent, ultimate parent, subsidiaries, fund manager, umbrella fund, and sub-fund structures
Get reporting exceptions: Understand why parent/ownership data may be missing (e.g., NON_CONSOLIDATING, NATURAL_PERSONS)
LEI Issuers (LOUs)
List all LEI issuers: Directory of all Local Operating Units worldwide
Get LEI issuer details: Retrieve detailed info about a specific LOU
The server also includes local caching, graceful error handling with retries, and built-in rate limiting to stay within GLEIF API quotas.
GLEIF MCP Server
Verify any company's legal identity in one question. Look up LEI codes, validate counterparties, and trace corporate ownership structures using the official GLEIF database. Covers 2.8M+ entities across 200+ jurisdictions.
12 tools for LEI lookup, entity search, BIC/SWIFT cross-referencing, corporate ownership, and batch validation. Works with Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, and other MCP-compatible tools.
Use Cases
KYC & Onboarding: Verify counterparty identities before signing contracts
Compliance Checks: Validate LEIs for MiFID II, EMIR, or DORA reporting
Due Diligence: Research corporate ownership chains and ultimate parents
Financial Analysis: Cross-reference securities (ISIN) and banks (BIC/SWIFT) with their legal entities
Data Enrichment: Batch-process company lists to add LEI data
Related MCP server: ch-eli-mcp
What is LEI?
The Legal Entity Identifier (LEI) is a 20-character alphanumeric code that uniquely identifies legal entities participating in financial transactions worldwide. It's mandated by 200+ regulations including MiFID II, EMIR, Dodd-Frank, and DORA.
LEI Format (ISO 17442):
Characters 1-4: LOU (Local Operating Unit) prefix
Characters 5-18: Entity-specific identifier
Characters 19-20: Check digits (mod 97 validation)
Example: HWUPKR0MPOU8FGXBT394 (Apple Inc.)
Features
Core Capabilities
LEI Lookup: Get full entity details by LEI code
Batch Lookup: Look up multiple LEIs in a single request (up to 100)
Entity Search: Find companies by name with fuzzy matching and pagination
LEI Validation: Verify format, check digits (ISO 17442), and registration status
Financial Identifiers
BIC/SWIFT Lookup: Find bank LEIs from BIC codes
ISIN Lookup: Find security issuer LEIs from ISIN codes
Country Browse: List entities by jurisdiction
Relationships & Compliance
Corporate Ownership: Parent companies, subsidiaries, ultimate parents
Fund Relationships: Fund managers, umbrella funds, sub-funds
Reporting Exceptions: Level 2 data exceptions with reasons
LEI Issuers: List and details of all Local Operating Units (LOUs)
Performance & Reliability
Fast Responses: Results are cached locally, so repeat queries return instantly
No API Key Needed: Works out of the box with GLEIF's public API
Handles Errors Gracefully: Automatic retries on timeouts or temporary failures
Stays Within Limits: Built-in rate limiting prevents hitting GLEIF's quotas
Installation
Download Binary
Pre-built binaries for all platforms on the releases page:
Platform | Binary |
macOS (Apple Silicon) |
|
macOS (Intel) |
|
Linux (x64) |
|
Linux (ARM64) |
|
Windows (x64) |
|
# macOS/Linux - download and make executable
chmod +x gleif-mcp-server-darwin-arm64Build from Source
Requires Go 1.25+:
git clone https://github.com/olgasafonova/gleif-mcp-server.git
cd gleif-mcp-server
go build -o gleif-mcp-server .Install via Go
go install github.com/olgasafonova/gleif-mcp-server@latestAI Agent Setup
Quickest start: Using Claude Desktop? Just add the config below and restart. Using an IDE like Cursor? Same idea, different config file. Pick your tool below.
Claude Desktop
Step 1: Download the binary
Go to the releases page and download the binary for your system:
Mac (Apple Silicon M1/M2/M3/M4):
gleif-mcp-server-darwin-arm64Mac (Intel):
gleif-mcp-server-darwin-amd64Windows:
gleif-mcp-server-windows-amd64.exe
Step 2: Mac only - allow the file to run
macOS blocks downloaded files. Open Terminal and run:
chmod +x ~/Downloads/gleif-mcp-server-darwin-arm64
xattr -d com.apple.quarantine ~/Downloads/gleif-mcp-server-darwin-arm64Step 3: Open the config file
Mac: Open Finder, press Cmd + Shift + G, paste this path:
~/Library/Application Support/Claude/Windows: Press Win + R, paste this path:
%APPDATA%\ClaudeOpen claude_desktop_config.json. If it doesn't exist, create it.
Step 4: Add the config
Mac (replace YOUR_USERNAME with your actual username):
{
"mcpServers": {
"gleif": {
"command": "/Users/YOUR_USERNAME/Downloads/gleif-mcp-server-darwin-arm64"
}
}
}Windows (replace YOUR_USERNAME - note the double backslashes):
{
"mcpServers": {
"gleif": {
"command": "C:\\Users\\YOUR_USERNAME\\Downloads\\gleif-mcp-server-windows-amd64.exe"
}
}
}To find your username: Mac - open Terminal and type whoami. Windows - look at C:\Users\.
Step 5: Restart Claude Desktop
Quit completely (Cmd + Q on Mac) and reopen.
Step 6: Test it
Type in Claude Desktop:
Look up Apple's LEI using GLEIFYou should see Claude call the GLEIF tool and return company data.
Claude Code (CLI)
# Add the server
claude mcp add gleif /path/to/gleif-mcp-server
# Or with scope for all projects
claude mcp add --scope user gleif /path/to/gleif-mcp-serverCursor IDE
Add to .cursor/mcp.json in your project or ~/.cursor/mcp.json for global config:
{
"mcpServers": {
"gleif": {
"command": "/path/to/gleif-mcp-server"
}
}
}VS Code with Continue Extension
Add to .continue/config.json:
{
"experimental": {
"modelContextProtocolServers": [
{
"name": "gleif",
"transport": {
"type": "stdio",
"command": "/path/to/gleif-mcp-server"
}
}
]
}
}Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"gleif": {
"command": "/path/to/gleif-mcp-server"
}
}
}Cline (VS Code Extension)
Add via Cline's MCP settings or in .vscode/cline_mcp_settings.json:
{
"mcpServers": {
"gleif": {
"command": "/path/to/gleif-mcp-server",
"args": []
}
}
}Antigravity
Add to ~/.antigravity/mcp.json:
{
"mcpServers": {
"gleif": {
"command": "/path/to/gleif-mcp-server"
}
}
}Not working? Tell us what made it hard — even one sentence helps.
Tools Reference
Core Lookup Tools
Tool | Description | Parameters |
| Get full details for a specific LEI |
|
| Check format, check digits, and status |
|
| Look up multiple LEIs at once |
|
Search Tools
Tool | Description | Parameters |
| Search by company name |
|
| Find LEI from BIC/SWIFT |
|
| Find issuer LEI from ISIN |
|
| List entities by country |
|
| Entity name suggestions |
|
Relationship Tools
Tool | Description | Parameters |
| Get corporate/fund relationships |
|
LEI Issuer Tools
Tool | Description | Parameters |
| Get details about an LOU |
|
| List all LOUs worldwide | None |
Compliance Tools
Tool | Description | Parameters |
| Get Level 2 reporting exceptions |
|
Usage Examples
Basic LEI Lookup
Prompt: "Look up LEI HWUPKR0MPOU8FGXBT394"
Returns: Full entity details for Apple Inc. including legal name, headquarters address, jurisdiction (US-CA), entity status, registration status, managing LOU, and next renewal date.
Company Search with Pagination
Prompt: "Search for Deutsche Bank, show page 2"
Tool call:
{
"name": "search_entity",
"arguments": {
"query": "Deutsche Bank",
"limit": 20,
"page": 2,
"fuzzy": true
}
}Returns: List of matching entities with pagination info (total results, current page, has more).
Batch LEI Lookup
Prompt: "Look up these LEIs: HWUPKR0MPOU8FGXBT394, 5493006MHB84DD0ZWV18, 549300GKFG0RYRRQ1414"
Returns: Summary of all three entities with LEI, legal name, country, city, and status.
Find Bank by BIC
Prompt: "Find the LEI for BIC DEUTDEFF"
Returns: Deutsche Bank AG's LEI record with full details.
Find Security Issuer
Prompt: "Who issued ISIN US0378331005?"
Returns: Apple Inc. (the issuer of AAPL stock).
Corporate Structure
Prompt: "Who is the ultimate parent of this subsidiary?"
Tool call:
{
"name": "get_relationships",
"arguments": {
"lei": "549300GKFG0RYRRQ1414",
"type": "ultimate-parent"
}
}LEI Validation
Prompt: "Is LEI HWUPKR0MPOU8FGXBT394 valid?"
Returns:
{
"lei": "HWUPKR0MPOU8FGXBT394",
"valid": true,
"status": "ISSUED",
"entityStatus": "ACTIVE",
"nextRenewal": "2025-08-15"
}Check Reporting Exceptions
Prompt: "Why is parent info missing for this company?"
Tool call:
{
"name": "get_reporting_exceptions",
"arguments": {
"lei": "5493006MHB84DD0ZWV18"
}
}Returns: Exception categories and reasons (e.g., NON_CONSOLIDATING, NATURAL_PERSONS).
List All LEI Issuers
Prompt: "Show me all LEI issuers"
Returns: Complete list of LOUs (Local Operating Units) with name, country, status, and number of sponsored LEIs.
Response Format
All tools return JSON with relevant fields. Example entity record:
{
"lei": "HWUPKR0MPOU8FGXBT394",
"legalName": "Apple Inc.",
"country": "US",
"city": "Cupertino",
"status": "ACTIVE",
"regStatus": "ISSUED"
}Search results include pagination:
{
"count": 20,
"results": [...],
"pagination": {
"currentPage": 1,
"perPage": 20,
"total": 156,
"lastPage": 8
},
"hasMore": true
}Error Handling
The server returns structured errors:
Error Code | Description | Retryable |
| LEI/entity not in GLEIF database | No |
| Invalid LEI/BIC/ISIN format | No |
| GLEIF API rate limit exceeded | Yes |
| Request timed out | Yes |
| GLEIF API error | Depends on status |
| Connection failed | Yes |
Example error response:
{
"code": "not_found",
"message": "LEI not found in GLEIF database",
"statusCode": 404,
"retryable": false
}Architecture
gleif-mcp-server/
├── main.go # Entry point, MCP server setup
├── internal/gleif/
│ ├── client.go # GLEIF API client with caching & rate limiting
│ ├── client_test.go # Client and validation tests
│ ├── cache.go # LRU cache with TTL
│ ├── types.go # Data structures for API responses
│ └── errors.go # Structured error types
└── tools/
├── definitions.go # Tool metadata and parameter specs
├── handlers.go # MCP tool implementations
└── handlers_test.go # Handler tests with mock serverTechnical Details
For developers who want the specifics:
Setting | Value |
Cache duration | 15 minutes |
Cache capacity | 1000 entities, 500 searches |
Rate limit | 50 req/min (GLEIF allows 60) |
Retry strategy | 3 attempts with exponential backoff |
Connection pool | 100 max idle, 10 per host |
API Reference
This server wraps the public GLEIF API:
Base URL: https://api.gleif.org/api/v1
Authentication: None required
Rate Limit: 60 requests/minute
Documentation: https://www.gleif.org/en/lei-data/gleif-api
Troubleshooting
Server won't start
Check the binary has execute permissions:
chmod +x gleif-mcp-serverVerify the path in your MCP config is absolute, not relative
"Rate limit exceeded" errors
The server automatically handles rate limiting with retries
If persistent, reduce concurrent requests or wait a few minutes
"LEI not found" for valid LEI
The GLEIF database updates daily; recently issued LEIs may not appear immediately
Verify the LEI format (exactly 20 alphanumeric characters)
Slow responses
First requests may be slower (cache warming)
GLEIF API occasionally has latency spikes; retries handle this automatically
Claude Desktop doesn't show the server
Restart Claude Desktop after editing config
Check JSON syntax in config file
Verify the binary path exists and is executable
Development
# Run tests
go test ./...
# Run tests with coverage
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out
# Run tests with race detector
go test -race ./...
# Build
go build -o gleif-mcp-server .Contributing
Contributions welcome. Please open an issue first to discuss proposed changes.
License
MIT License - see LICENSE for details.
More MCP Servers
Check out my other MCP servers:
Server | Description | Stars |
Connect AI to any MediaWiki wiki. Search, read, edit wiki content. | ||
Control Miro whiteboards with AI. Boards, diagrams, mindmaps, and more. | ||
Access Nordic business registries. Look up companies across Norway, Denmark, Finland, Sweden. | ||
Talk to your ProductPlan roadmaps. Query OKRs, ideas, launches. | ||
Nordic grocery deal hunting. Find offers, plan meals, track spending. |
Acknowledgments
GLEIF for the public LEI API
Model Context Protocol for the MCP specification
Available Tools
12 toolsautocompleteARead-onlyIdempotent
Get entity name suggestions from a prefix (min 2 characters). USE WHEN: "suggest companies starting with X", "autocomplete company name", user is typing a name and needs quick suggestions. For full search results with pagination, use search_entity instead. Returns name suggestions with LEI and legal name for each match. FAILS WHEN: prefix is shorter than 2 characters. Falls back to fuzzy search automatically if the autocomplete endpoint is unavailable.
Inputs: prefix (required), limit. Returns: prefix, suggestions
batch_lei_lookupARead-onlyIdempotent
Look up multiple LEI records in one request (max 100). USE WHEN: "look up these LEIs", "batch lookup", user provides 2+ LEI codes. Faster than calling lei_lookup repeatedly. FAILS WHEN: list is empty (provide at least one LEI), more than 100 LEIs (split into multiple calls), any individual LEI has invalid format (fix that specific LEI; the error message includes its position).
Inputs: leis (required). Returns: found, results, notFound, requested
get_lei_issuerARead-onlyIdempotent
Get details about a specific LEI issuer (Local Operating Unit / LOU) by ID. USE WHEN: "details on this LOU", "issuer info". Returns issuer name, country, status, website, and count of sponsored LEIs. For all issuers worldwide, use list_lei_issuers. FAILS WHEN: issuer ID not found (use list_lei_issuers to get valid IDs).
Inputs: issuer_id (required). Returns: id, lei, name, status, +6 more
get_relationshipsARead-onlyIdempotent
Get corporate ownership and fund relationships for an entity.
USE WHEN: "who owns X?", "parent company", "subsidiaries", "fund manager"
Types: direct-parent, ultimate-parent, children, fund-manager, umbrella-fund, sub-funds. Returns relationship records with related entity LEI, legal name, relationship type, and status.
FAILS WHEN: LEI format invalid (must be 20 alphanumeric chars), no relationships of requested type exist (entity may have no parent; check get_reporting_exceptions for why ownership data is missing).
Inputs: lei (required), type. Returns: lei, type, relationships
get_reporting_exceptionsARead-onlyIdempotent
Explains why parent/ownership data may be missing for an entity. USE WHEN: "why no parent info?", "reporting exceptions", "missing ownership data". Returns list of Level 2 exceptions, each with type (NON_CONSOLIDATING, NO_KNOWN_PERSON, NATURAL_PERSONS, NON_PUBLIC), category, and reference entity. Empty list when entity has no exceptions (parent data is complete). FAILS WHEN: LEI format invalid (must be 20 alphanumeric chars).
Inputs: lei (required). Returns: lei, count, exceptions
lei_lookupARead-onlyIdempotent
Get full details for a specific LEI code (legal name, address, jurisdiction, status, managing LOU, renewal dates). USE WHEN: "look up LEI", "LEI details", "who is HWUPKR0MPOU8FGXBT394?" For validating format and status only, use validate_lei. For multiple LEIs at once, use batch_lei_lookup. FAILS WHEN: LEI is not exactly 20 alphanumeric characters (fix format and retry), LEI not found in GLEIF database (entity may not have an LEI; try search_entity by name instead).
Inputs: lei (required). Returns: lei, entity, registration
list_lei_issuersARead-onlyIdempotent
List all LEI issuers (Local Operating Units / LOUs) worldwide. USE WHEN: "show all LOUs", "which organizations issue LEIs?", "LEI issuer directory". Returns all issuers with name, country, status, and sponsored LEI count. For one specific issuer, use get_lei_issuer.
Inputs: limit. Returns: count, total, issuers, truncated
search_by_bicARead-onlyIdempotent
Find a bank's LEI from its BIC/SWIFT code (8 or 11 characters). USE WHEN: "find LEI from BIC", "BIC to LEI", "SWIFT code lookup", user provides a BIC code. Returns matching entity with LEI, legal name, country, and registration status. FAILS WHEN: BIC is not 8 or 11 characters (fix input), no entity mapped to this BIC (not all banks have LEIs; try search_entity with the bank name instead).
Inputs: bic (required). Returns: count, found, message, results
search_by_countryARead-onlyIdempotent
List entities registered in a specific country. USE WHEN: "companies in Germany", "LEIs from US", "entities in country X". Pass ISO 2-letter code (US, GB, DE). Returns entity list with LEI, legal name, and status for each. Returns up to 'limit' results (max 100); this tool does not page, so raise 'limit' to get more rather than requesting a next page. FAILS WHEN: country code is not a 2-letter ISO 3166-1 alpha-2 code (use "US" not "USA", "GB" not "UK").
Inputs: country (required), limit. Returns: count, country, results
search_by_isinARead-onlyIdempotent
Find the issuer's LEI from a securities ISIN code (12 characters). USE WHEN: "who issued ISIN US0378331005?", "ISIN to LEI", user provides an ISIN. Returns issuer entity with LEI, legal name, country, and registration status. FAILS WHEN: ISIN is not 12 characters (fix input), no issuer found for this ISIN (some securities lack LEI mapping).
Inputs: isin (required). Returns: count, found, message, results
search_entityARead-onlyIdempotent
Search for legal entities by name with fuzzy matching and pagination. For quick name suggestions, use autocomplete instead.
USE WHEN: "find company X", "search for X", "look up company X"
FAILS WHEN: no results found (try autocomplete for name suggestions, or check spelling; fuzzy matching is on by default).
Inputs: query (required), page, fuzzy, limit. Returns: count, hasMore, results, pagination
validate_leiARead-onlyIdempotent
Check if an LEI code is valid and active. USE WHEN: "is this LEI valid?", "verify LEI", "check LEI format". Performs format (20 chars), check digit (ISO 17442), and database status checks. For full entity details, use lei_lookup instead. NOTE: Never returns an error for invalid LEIs; returns valid=false with a reason message instead. Safe to call on untrusted input.
Inputs: lei (required). Returns: lei, valid, status, message, +2 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Each tool targets a distinct resource or action, and the descriptions explicitly clarify boundaries (e.g., autocomplete vs search_entity, lei_lookup vs validate_lei, get_lei_issuer vs list_lei_issuers). The only potential overlaps are well-differentiated by input type or purpose, so an agent can reliably select the right tool.
Most tools follow a clear verb_noun pattern (get_*, list_*, search_*, validate_*), but a few deviate: 'autocomplete' is a bare verb, 'lei_lookup' and 'batch_lei_lookup' use noun_lookup phrasing. Still, all names are snake_case and readable, with only minor inconsistencies.
With 12 tools, the set is well-scoped for a GLEIF LEI data server. Each tool earns its place by covering a distinct lookup, search, or validation task, and there are no redundant or trivial tools.
The surface covers the domain comprehensively: single and batch LEI lookup, validation, multiple search axes (name, country, BIC, ISIN, autocomplete), relationships, reporting exceptions, and issuer discovery. No obvious gaps exist for a read-only LEI data service.
Maintenance
Related MCP Connectors
GLEIF MCP — Global Legal Entity Identifier Foundation (free, no auth)
Search Global Legal Entity Identifier (GLEIF LEI) records for corporate KYB and entity verification.
GLEIF LEI and legal entity lookup for AI agents. 20K entities.
Read-only MCP server for Belarusian company verification by UNP, legal status, and knowledge graph.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server for EU company and business data. 9 tools: company search (GLEIF, 2M+ entities), LEI lookup, corporate structures (parent/subsidiaries), trade register search, EU VAT validation (VIES), GDP, unemployment, inflation, and business demography (Eurostat). All APIs free, no keys required.96MIT
- AlicenseAqualityCmaintenanceMCP server for Swiss federal legislation metadata via Fedlex, enabling search and retrieval of act details with ELI URIs, SR numbers, and multilingual support.3Apache 2.0
- AlicenseNot gradedqualityBmaintenanceProvides access to Global Legal Entity Identifier (LEI) data from GLEIF, enabling queries about legal entities and their identifiers via natural language.97 npmMIT
- AlicenseAqualityDmaintenanceMCP server for the Norwegian Central Coordinating Register for Legal Entities (Enhetsregisteret), providing tools to search companies, get full register records, list recent registrations, and retrieve registered roles.4MIT