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. 29 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,
Add this skill
npx mdskills install olgasafonova/gleif-mcp-serverComprehensive MCP server with 29 well-documented tools for LEI/entity verification and corporate structure analysis
1# GLEIF MCP Server23Verify 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.45[](https://github.com/olgasafonova/gleif-mcp-server/actions/workflows/ci.yml)6[](https://goreportcard.com/report/github.com/olgasafonova/gleif-mcp-server)7[](https://opensource.org/licenses/MIT)89**29 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.1011## Use Cases1213- **KYC & Onboarding**: Verify counterparty identities before signing contracts14- **Compliance Checks**: Validate LEIs for MiFID II, EMIR, or DORA reporting15- **Due Diligence**: Research corporate ownership chains and ultimate parents16- **Financial Analysis**: Cross-reference securities (ISIN) and banks (BIC/SWIFT) with their legal entities17- **Data Enrichment**: Batch-process company lists to add LEI data1819## What is LEI?2021The 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.2223**LEI Format (ISO 17442):**24- Characters 1-4: LOU (Local Operating Unit) prefix25- Characters 5-18: Entity-specific identifier26- Characters 19-20: Check digits (mod 97 validation)2728Example: `HWUPKR0MPOU8FGXBT394` (Apple Inc.)2930## Features3132### Core Capabilities33- **LEI Lookup**: Get full entity details by LEI code34- **Batch Lookup**: Look up multiple LEIs in a single request (up to 100)35- **Entity Search**: Find companies by name with fuzzy matching and pagination36- **LEI Validation**: Verify format, check digits (ISO 17442), and registration status3738### Financial Identifiers39- **BIC/SWIFT Lookup**: Find bank LEIs from BIC codes40- **ISIN Lookup**: Find security issuer LEIs from ISIN codes41- **Country Browse**: List entities by jurisdiction4243### Relationships & Compliance44- **Corporate Ownership**: Parent companies, subsidiaries, ultimate parents45- **Fund Relationships**: Fund managers, umbrella funds, sub-funds46- **Reporting Exceptions**: Level 2 data exceptions with reasons47- **LEI Issuers**: List and details of all Local Operating Units (LOUs)4849### Performance & Reliability50- **Fast Responses**: Results are cached locally, so repeat queries return instantly51- **No API Key Needed**: Works out of the box with GLEIF's public API52- **Handles Errors Gracefully**: Automatic retries on timeouts or temporary failures53- **Stays Within Limits**: Built-in rate limiting prevents hitting GLEIF's quotas5455## Installation5657### Download Binary5859Pre-built binaries for all platforms on the [releases page](https://github.com/olgasafonova/gleif-mcp-server/releases):6061| Platform | Binary |62|----------|--------|63| macOS (Apple Silicon) | `gleif-mcp-server-darwin-arm64` |64| macOS (Intel) | `gleif-mcp-server-darwin-amd64` |65| Linux (x64) | `gleif-mcp-server-linux-amd64` |66| Linux (ARM64) | `gleif-mcp-server-linux-arm64` |67| Windows (x64) | `gleif-mcp-server-windows-amd64.exe` |6869```bash70# macOS/Linux - download and make executable71chmod +x gleif-mcp-server-darwin-arm6472```7374### Build from Source7576Requires Go 1.25+:7778```bash79git clone https://github.com/olgasafonova/gleif-mcp-server.git80cd gleif-mcp-server81go build -o gleif-mcp-server .82```8384### Install via Go8586```bash87go install github.com/olgasafonova/gleif-mcp-server@latest88```8990## AI Agent Setup9192> **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.9394### Claude Desktop9596#### Step 1: Download the binary9798Go to the [releases page](https://github.com/olgasafonova/gleif-mcp-server/releases) and download the binary for your system:99- **Mac (Apple Silicon M1/M2/M3/M4):** `gleif-mcp-server-darwin-arm64`100- **Mac (Intel):** `gleif-mcp-server-darwin-amd64`101- **Windows:** `gleif-mcp-server-windows-amd64.exe`102103#### Step 2: Mac only - allow the file to run104105macOS blocks downloaded files. Open Terminal and run:106107```bash108chmod +x ~/Downloads/gleif-mcp-server-darwin-arm64109xattr -d com.apple.quarantine ~/Downloads/gleif-mcp-server-darwin-arm64110```111112#### Step 3: Open the config file113114**Mac:** Open Finder, press `Cmd + Shift + G`, paste this path:115```116~/Library/Application Support/Claude/117```118119**Windows:** Press `Win + R`, paste this path:120```121%APPDATA%\Claude122```123124Open `claude_desktop_config.json`. If it doesn't exist, create it.125126#### Step 4: Add the config127128**Mac** (replace YOUR_USERNAME with your actual username):129```json130{131 "mcpServers": {132 "gleif": {133 "command": "/Users/YOUR_USERNAME/Downloads/gleif-mcp-server-darwin-arm64"134 }135 }136}137```138139**Windows** (replace YOUR_USERNAME - note the double backslashes):140```json141{142 "mcpServers": {143 "gleif": {144 "command": "C:\\Users\\YOUR_USERNAME\\Downloads\\gleif-mcp-server-windows-amd64.exe"145 }146 }147}148```149150To find your username: Mac - open Terminal and type `whoami`. Windows - look at `C:\Users\`.151152#### Step 5: Restart Claude Desktop153154Quit completely (`Cmd + Q` on Mac) and reopen.155156#### Step 6: Test it157158Type in Claude Desktop:159```160Look up Apple's LEI using GLEIF161```162163You should see Claude call the GLEIF tool and return company data.164165### Claude Code (CLI)166167```bash168# Add the server169claude mcp add gleif /path/to/gleif-mcp-server170171# Or with scope for all projects172claude mcp add --scope user gleif /path/to/gleif-mcp-server173```174175### Cursor IDE176177Add to `.cursor/mcp.json` in your project or `~/.cursor/mcp.json` for global config:178179```json180{181 "mcpServers": {182 "gleif": {183 "command": "/path/to/gleif-mcp-server"184 }185 }186}187```188189### VS Code with Continue Extension190191Add to `.continue/config.json`:192193```json194{195 "experimental": {196 "modelContextProtocolServers": [197 {198 "name": "gleif",199 "transport": {200 "type": "stdio",201 "command": "/path/to/gleif-mcp-server"202 }203 }204 ]205 }206}207```208209### Windsurf210211Add to `~/.codeium/windsurf/mcp_config.json`:212213```json214{215 "mcpServers": {216 "gleif": {217 "command": "/path/to/gleif-mcp-server"218 }219 }220}221```222223### Cline (VS Code Extension)224225Add via Cline's MCP settings or in `.vscode/cline_mcp_settings.json`:226227```json228{229 "mcpServers": {230 "gleif": {231 "command": "/path/to/gleif-mcp-server",232 "args": []233 }234 }235}236```237238### Antigravity239240Add to `~/.antigravity/mcp.json`:241242```json243{244 "mcpServers": {245 "gleif": {246 "command": "/path/to/gleif-mcp-server"247 }248 }249}250```251252> **Not working?** [Tell us what made it hard](https://github.com/olgasafonova/gleif-mcp-server/issues/new?template=bug_report.yml) — even one sentence helps.253254## Tools Reference255256### Core Lookup Tools257258| Tool | Description | Parameters |259|------|-------------|------------|260| `lei_lookup` | Get full details for a specific LEI | `lei` (required): 20-char LEI code |261| `validate_lei` | Check format, check digits, and status | `lei` (required): LEI to validate |262| `batch_lei_lookup` | Look up multiple LEIs at once | `leis` (required): Comma-separated LEIs (max 100) |263264### Search Tools265266| Tool | Description | Parameters |267|------|-------------|------------|268| `search_entity` | Search by company name | `query` (required), `limit` (default 20), `page` (default 1), `fuzzy` (default true) |269| `search_by_bic` | Find LEI from BIC/SWIFT | `bic` (required): 8 or 11 char code |270| `search_by_isin` | Find issuer LEI from ISIN | `isin` (required): 12-char ISIN |271| `search_by_country` | List entities by country | `country` (required): ISO 2-letter code, `limit` (default 20) |272| `autocomplete` | Entity name suggestions | `prefix` (required): min 2 chars, `limit` (default 10) |273274### Relationship Tools275276| Tool | Description | Parameters |277|------|-------------|------------|278| `get_relationships` | Get corporate/fund relationships | `lei` (required), `type`: direct-parent, ultimate-parent, children, fund-manager, umbrella-fund, sub-funds |279280### LEI Issuer Tools281282| Tool | Description | Parameters |283|------|-------------|------------|284| `get_lei_issuer` | Get details about an LOU | `issuer_id` (required): LOU identifier |285| `list_lei_issuers` | List all LOUs worldwide | None |286287### Compliance Tools288289| Tool | Description | Parameters |290|------|-------------|------------|291| `get_reporting_exceptions` | Get Level 2 reporting exceptions | `lei` (required): LEI to check |292293## Usage Examples294295### Basic LEI Lookup296297**Prompt:** "Look up LEI HWUPKR0MPOU8FGXBT394"298299**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.300301### Company Search with Pagination302303**Prompt:** "Search for Deutsche Bank, show page 2"304305**Tool call:**306```json307{308 "name": "search_entity",309 "arguments": {310 "query": "Deutsche Bank",311 "limit": 20,312 "page": 2,313 "fuzzy": true314 }315}316```317318**Returns:** List of matching entities with pagination info (total results, current page, has more).319320### Batch LEI Lookup321322**Prompt:** "Look up these LEIs: HWUPKR0MPOU8FGXBT394, 5493006MHB84DD0ZWV18, 549300GKFG0RYRRQ1414"323324**Returns:** Summary of all three entities with LEI, legal name, country, city, and status.325326### Find Bank by BIC327328**Prompt:** "Find the LEI for BIC DEUTDEFF"329330**Returns:** Deutsche Bank AG's LEI record with full details.331332### Find Security Issuer333334**Prompt:** "Who issued ISIN US0378331005?"335336**Returns:** Apple Inc. (the issuer of AAPL stock).337338### Corporate Structure339340**Prompt:** "Who is the ultimate parent of this subsidiary?"341342**Tool call:**343```json344{345 "name": "get_relationships",346 "arguments": {347 "lei": "549300GKFG0RYRRQ1414",348 "type": "ultimate-parent"349 }350}351```352353### LEI Validation354355**Prompt:** "Is LEI HWUPKR0MPOU8FGXBT394 valid?"356357**Returns:**358```json359{360 "lei": "HWUPKR0MPOU8FGXBT394",361 "valid": true,362 "status": "ISSUED",363 "entityStatus": "ACTIVE",364 "nextRenewal": "2025-08-15"365}366```367368### Check Reporting Exceptions369370**Prompt:** "Why is parent info missing for this company?"371372**Tool call:**373```json374{375 "name": "get_reporting_exceptions",376 "arguments": {377 "lei": "5493006MHB84DD0ZWV18"378 }379}380```381382**Returns:** Exception categories and reasons (e.g., NON_CONSOLIDATING, NATURAL_PERSONS).383384### List All LEI Issuers385386**Prompt:** "Show me all LEI issuers"387388**Returns:** Complete list of LOUs (Local Operating Units) with name, country, status, and number of sponsored LEIs.389390## Response Format391392All tools return JSON with relevant fields. Example entity record:393394```json395{396 "lei": "HWUPKR0MPOU8FGXBT394",397 "legalName": "Apple Inc.",398 "country": "US",399 "city": "Cupertino",400 "status": "ACTIVE",401 "regStatus": "ISSUED"402}403```404405Search results include pagination:406407```json408{409 "count": 20,410 "results": [...],411 "pagination": {412 "currentPage": 1,413 "perPage": 20,414 "total": 156,415 "lastPage": 8416 },417 "hasMore": true418}419```420421## Error Handling422423The server returns structured errors:424425| Error Code | Description | Retryable |426|------------|-------------|-----------|427| `not_found` | LEI/entity not in GLEIF database | No |428| `invalid_format` | Invalid LEI/BIC/ISIN format | No |429| `rate_limited` | GLEIF API rate limit exceeded | Yes |430| `timeout` | Request timed out | Yes |431| `server_error` | GLEIF API error | Depends on status |432| `network_error` | Connection failed | Yes |433434Example error response:435```json436{437 "code": "not_found",438 "message": "LEI not found in GLEIF database",439 "statusCode": 404,440 "retryable": false441}442```443444## Architecture445446```447gleif-mcp-server/448├── main.go # Entry point, MCP server setup449├── internal/gleif/450│ ├── client.go # GLEIF API client with caching & rate limiting451│ ├── client_test.go # Client and validation tests452│ ├── cache.go # LRU cache with TTL453│ ├── types.go # Data structures for API responses454│ └── errors.go # Structured error types455└── tools/456 ├── definitions.go # Tool metadata and parameter specs457 ├── handlers.go # MCP tool implementations458 └── handlers_test.go # Handler tests with mock server459```460461### Technical Details462463For developers who want the specifics:464465| Setting | Value |466|---------|-------|467| Cache duration | 15 minutes |468| Cache capacity | 1000 entities, 500 searches |469| Rate limit | 50 req/min (GLEIF allows 60) |470| Retry strategy | 3 attempts with exponential backoff |471| Connection pool | 100 max idle, 10 per host |472473## API Reference474475This server wraps the public GLEIF API:476- **Base URL**: https://api.gleif.org/api/v1477- **Authentication**: None required478- **Rate Limit**: 60 requests/minute479- **Documentation**: https://www.gleif.org/en/lei-data/gleif-api480481## Troubleshooting482483### Server won't start484- Check the binary has execute permissions: `chmod +x gleif-mcp-server`485- Verify the path in your MCP config is absolute, not relative486487### "Rate limit exceeded" errors488- The server automatically handles rate limiting with retries489- If persistent, reduce concurrent requests or wait a few minutes490491### "LEI not found" for valid LEI492- The GLEIF database updates daily; recently issued LEIs may not appear immediately493- Verify the LEI format (exactly 20 alphanumeric characters)494495### Slow responses496- First requests may be slower (cache warming)497- GLEIF API occasionally has latency spikes; retries handle this automatically498499### Claude Desktop doesn't show the server500- Restart Claude Desktop after editing config501- Check JSON syntax in config file502- Verify the binary path exists and is executable503504## Development505506```bash507# Run tests508go test ./...509510# Run tests with coverage511go test -coverprofile=coverage.out ./...512go tool cover -html=coverage.out513514# Run tests with race detector515go test -race ./...516517# Build518go build -o gleif-mcp-server .519```520521## Contributing522523Contributions welcome. Please open an issue first to discuss proposed changes.524525## License526527MIT License - see [LICENSE](LICENSE) for details.528529## More MCP Servers530531Check out my other MCP servers:532533| Server | Description | Stars |534|--------|-------------|-------|535| [mediawiki-mcp-server](https://github.com/olgasafonova/mediawiki-mcp-server) | Connect AI to any MediaWiki wiki. Search, read, edit wiki content. |  |536| [miro-mcp-server](https://github.com/olgasafonova/miro-mcp-server) | Control Miro whiteboards with AI. Boards, diagrams, mindmaps, and more. |  |537| [nordic-registry-mcp-server](https://github.com/olgasafonova/nordic-registry-mcp-server) | Access Nordic business registries. Look up companies across Norway, Denmark, Finland, Sweden. |  |538| [productplan-mcp-server](https://github.com/olgasafonova/productplan-mcp-server) | Talk to your ProductPlan roadmaps. Query OKRs, ideas, launches. |  |539540---541542## Acknowledgments543544- [GLEIF](https://www.gleif.org/) for the public LEI API545- [Model Context Protocol](https://modelcontextprotocol.io/) for the MCP specification546
Full transparency — inspect the skill content before installing.