{
  "markdown": "# GLEIF MCP Server\n\nVerify 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.\n\n[![CI](https://github.com/olgasafonova/gleif-mcp-server/actions/workflows/ci.yml/badge.svg)](https://github.com/olgasafonova/gleif-mcp-server/actions/workflows/ci.yml)\n![lint](https://github.com/olgasafonova/gleif-mcp-server/actions/workflows/lint.yml/badge.svg)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![CodeScene Average Code Health](https://codescene.io/projects/83041/status-badges/average-code-health)](https://codescene.io/projects/83041)\n\n**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.\n\n## Use Cases\n\n- **KYC & Onboarding**: Verify counterparty identities before signing contracts\n- **Compliance Checks**: Validate LEIs for MiFID II, EMIR, or DORA reporting\n- **Due Diligence**: Research corporate ownership chains and ultimate parents\n- **Financial Analysis**: Cross-reference securities (ISIN) and banks (BIC/SWIFT) with their legal entities\n- **Data Enrichment**: Batch-process company lists to add LEI data\n\n## What is LEI?\n\nThe 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.\n\n**LEI Format (ISO 17442):**\n- Characters 1-4: LOU (Local Operating Unit) prefix\n- Characters 5-18: Entity-specific identifier\n- Characters 19-20: Check digits (mod 97 validation)\n\nExample: `HWUPKR0MPOU8FGXBT394` (Apple Inc.)\n\n## Features\n\n### Core Capabilities\n- **LEI Lookup**: Get full entity details by LEI code\n- **Batch Lookup**: Look up multiple LEIs in a single request (up to 100)\n- **Entity Search**: Find companies by name with fuzzy matching and pagination\n- **LEI Validation**: Verify format, check digits (ISO 17442), and registration status\n\n### Financial Identifiers\n- **BIC/SWIFT Lookup**: Find bank LEIs from BIC codes\n- **ISIN Lookup**: Find security issuer LEIs from ISIN codes\n- **Country Browse**: List entities by jurisdiction\n\n### Relationships & Compliance\n- **Corporate Ownership**: Parent companies, subsidiaries, ultimate parents\n- **Fund Relationships**: Fund managers, umbrella funds, sub-funds\n- **Reporting Exceptions**: Level 2 data exceptions with reasons\n- **LEI Issuers**: List and details of all Local Operating Units (LOUs)\n\n### Performance & Reliability\n- **Fast Responses**: Results are cached locally, so repeat queries return instantly\n- **No API Key Needed**: Works out of the box with GLEIF's public API\n- **Handles Errors Gracefully**: Automatic retries on timeouts or temporary failures\n- **Stays Within Limits**: Built-in rate limiting prevents hitting GLEIF's quotas\n\n## Installation\n\n### Download Binary\n\nPre-built binaries for all platforms on the [releases page](https://github.com/olgasafonova/gleif-mcp-server/releases):\n\n| Platform | Binary |\n|----------|--------|\n| macOS (Apple Silicon) | `gleif-mcp-server-darwin-arm64` |\n| macOS (Intel) | `gleif-mcp-server-darwin-amd64` |\n| Linux (x64) | `gleif-mcp-server-linux-amd64` |\n| Linux (ARM64) | `gleif-mcp-server-linux-arm64` |\n| Windows (x64) | `gleif-mcp-server-windows-amd64.exe` |\n\n```bash\n# macOS/Linux - download and make executable\nchmod +x gleif-mcp-server-darwin-arm64\n```\n\n### Build from Source\n\nRequires Go 1.25+:\n\n```bash\ngit clone https://github.com/olgasafonova/gleif-mcp-server.git\ncd gleif-mcp-server\ngo build -o gleif-mcp-server .\n```\n\n### Install via Go\n\n```bash\ngo install github.com/olgasafonova/gleif-mcp-server@latest\n```\n\n## AI Agent Setup\n\n> **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.\n\n### Claude Desktop\n\n#### Step 1: Download the binary\n\nGo to the [releases page](https://github.com/olgasafonova/gleif-mcp-server/releases) and download the binary for your system:\n- **Mac (Apple Silicon M1/M2/M3/M4):** `gleif-mcp-server-darwin-arm64`\n- **Mac (Intel):** `gleif-mcp-server-darwin-amd64`\n- **Windows:** `gleif-mcp-server-windows-amd64.exe`\n\n#### Step 2: Mac only - allow the file to run\n\nmacOS blocks downloaded files. Open Terminal and run:\n\n```bash\nchmod +x ~/Downloads/gleif-mcp-server-darwin-arm64\nxattr -d com.apple.quarantine ~/Downloads/gleif-mcp-server-darwin-arm64\n```\n\n#### Step 3: Open the config file\n\n**Mac:** Open Finder, press `Cmd + Shift + G`, paste this path:\n```\n~/Library/Application Support/Claude/\n```\n\n**Windows:** Press `Win + R`, paste this path:\n```\n%APPDATA%\\Claude\n```\n\nOpen `claude_desktop_config.json`. If it doesn't exist, create it.\n\n#### Step 4: Add the config\n\n**Mac** (replace YOUR_USERNAME with your actual username):\n```json\n{\n  \"mcpServers\": {\n    \"gleif\": {\n      \"command\": \"/Users/YOUR_USERNAME/Downloads/gleif-mcp-server-darwin-arm64\"\n    }\n  }\n}\n```\n\n**Windows** (replace YOUR_USERNAME - note the double backslashes):\n```json\n{\n  \"mcpServers\": {\n    \"gleif\": {\n      \"command\": \"C:\\\\Users\\\\YOUR_USERNAME\\\\Downloads\\\\gleif-mcp-server-windows-amd64.exe\"\n    }\n  }\n}\n```\n\nTo find your username: Mac - open Terminal and type `whoami`. Windows - look at `C:\\Users\\`.\n\n#### Step 5: Restart Claude Desktop\n\nQuit completely (`Cmd + Q` on Mac) and reopen.\n\n#### Step 6: Test it\n\nType in Claude Desktop:\n```\nLook up Apple's LEI using GLEIF\n```\n\nYou should see Claude call the GLEIF tool and return company data.\n\n### Claude Code (CLI)\n\n```bash\n# Add the server\nclaude mcp add gleif /path/to/gleif-mcp-server\n\n# Or with scope for all projects\nclaude mcp add --scope user gleif /path/to/gleif-mcp-server\n```\n\n### Cursor IDE\n\nAdd to `.cursor/mcp.json` in your project or `~/.cursor/mcp.json` for global config:\n\n```json\n{\n  \"mcpServers\": {\n    \"gleif\": {\n      \"command\": \"/path/to/gleif-mcp-server\"\n    }\n  }\n}\n```\n\n### VS Code with Continue Extension\n\nAdd to `.continue/config.json`:\n\n```json\n{\n  \"experimental\": {\n    \"modelContextProtocolServers\": [\n      {\n        \"name\": \"gleif\",\n        \"transport\": {\n          \"type\": \"stdio\",\n          \"command\": \"/path/to/gleif-mcp-server\"\n        }\n      }\n    ]\n  }\n}\n```\n\n### Windsurf\n\nAdd to `~/.codeium/windsurf/mcp_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"gleif\": {\n      \"command\": \"/path/to/gleif-mcp-server\"\n    }\n  }\n}\n```\n\n### Cline (VS Code Extension)\n\nAdd via Cline's MCP settings or in `.vscode/cline_mcp_settings.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"gleif\": {\n      \"command\": \"/path/to/gleif-mcp-server\",\n      \"args\": []\n    }\n  }\n}\n```\n\n### Antigravity\n\nAdd to `~/.antigravity/mcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"gleif\": {\n      \"command\": \"/path/to/gleif-mcp-server\"\n    }\n  }\n}\n```\n\n> **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.\n\n## Tools Reference\n\n### Core Lookup Tools\n\n| Tool | Description | Parameters |\n|------|-------------|------------|\n| `lei_lookup` | Get full details for a specific LEI | `lei` (required): 20-char LEI code |\n| `validate_lei` | Check format, check digits, and status | `lei` (required): LEI to validate |\n| `batch_lei_lookup` | Look up multiple LEIs at once | `leis` (required): Comma-separated LEIs (max 100) |\n\n### Search Tools\n\n| Tool | Description | Parameters |\n|------|-------------|------------|\n| `search_entity` | Search by company name | `query` (required), `limit` (default 20), `page` (default 1), `fuzzy` (default true) |\n| `search_by_bic` | Find LEI from BIC/SWIFT | `bic` (required): 8 or 11 char code |\n| `search_by_isin` | Find issuer LEI from ISIN | `isin` (required): 12-char ISIN |\n| `search_by_country` | List entities by country | `country` (required): ISO 2-letter code, `limit` (default 20) |\n| `autocomplete` | Entity name suggestions | `prefix` (required): min 2 chars, `limit` (default 10) |\n\n### Relationship Tools\n\n| Tool | Description | Parameters |\n|------|-------------|------------|\n| `get_relationships` | Get corporate/fund relationships | `lei` (required), `type`: direct-parent, ultimate-parent, children, fund-manager, umbrella-fund, sub-funds |\n\n### LEI Issuer Tools\n\n| Tool | Description | Parameters |\n|------|-------------|------------|\n| `get_lei_issuer` | Get details about an LOU | `issuer_id` (required): LOU identifier |\n| `list_lei_issuers` | List all LOUs worldwide | None |\n\n### Compliance Tools\n\n| Tool | Description | Parameters |\n|------|-------------|------------|\n| `get_reporting_exceptions` | Get Level 2 reporting exceptions | `lei` (required): LEI to check |\n\n## Usage Examples\n\n### Basic LEI Lookup\n\n**Prompt:** \"Look up LEI HWUPKR0MPOU8FGXBT394\"\n\n**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.\n\n### Company Search with Pagination\n\n**Prompt:** \"Search for Deutsche Bank, show page 2\"\n\n**Tool call:**\n```json\n{\n  \"name\": \"search_entity\",\n  \"arguments\": {\n    \"query\": \"Deutsche Bank\",\n    \"limit\": 20,\n    \"page\": 2,\n    \"fuzzy\": true\n  }\n}\n```\n\n**Returns:** List of matching entities with pagination info (total results, current page, has more).\n\n### Batch LEI Lookup\n\n**Prompt:** \"Look up these LEIs: HWUPKR0MPOU8FGXBT394, 5493006MHB84DD0ZWV18, 549300GKFG0RYRRQ1414\"\n\n**Returns:** Summary of all three entities with LEI, legal name, country, city, and status.\n\n### Find Bank by BIC\n\n**Prompt:** \"Find the LEI for BIC DEUTDEFF\"\n\n**Returns:** Deutsche Bank AG's LEI record with full details.\n\n### Find Security Issuer\n\n**Prompt:** \"Who issued ISIN US0378331005?\"\n\n**Returns:** Apple Inc. (the issuer of AAPL stock).\n\n### Corporate Structure\n\n**Prompt:** \"Who is the ultimate parent of this subsidiary?\"\n\n**Tool call:**\n```json\n{\n  \"name\": \"get_relationships\",\n  \"arguments\": {\n    \"lei\": \"549300GKFG0RYRRQ1414\",\n    \"type\": \"ultimate-parent\"\n  }\n}\n```\n\n### LEI Validation\n\n**Prompt:** \"Is LEI HWUPKR0MPOU8FGXBT394 valid?\"\n\n**Returns:**\n```json\n{\n  \"lei\": \"HWUPKR0MPOU8FGXBT394\",\n  \"valid\": true,\n  \"status\": \"ISSUED\",\n  \"entityStatus\": \"ACTIVE\",\n  \"nextRenewal\": \"2025-08-15\"\n}\n```\n\n### Check Reporting Exceptions\n\n**Prompt:** \"Why is parent info missing for this company?\"\n\n**Tool call:**\n```json\n{\n  \"name\": \"get_reporting_exceptions\",\n  \"arguments\": {\n    \"lei\": \"5493006MHB84DD0ZWV18\"\n  }\n}\n```\n\n**Returns:** Exception categories and reasons (e.g., NON_CONSOLIDATING, NATURAL_PERSONS).\n\n### List All LEI Issuers\n\n**Prompt:** \"Show me all LEI issuers\"\n\n**Returns:** Complete list of LOUs (Local Operating Units) with name, country, status, and number of sponsored LEIs.\n\n## Response Format\n\nAll tools return JSON with relevant fields. Example entity record:\n\n```json\n{\n  \"lei\": \"HWUPKR0MPOU8FGXBT394\",\n  \"legalName\": \"Apple Inc.\",\n  \"country\": \"US\",\n  \"city\": \"Cupertino\",\n  \"status\": \"ACTIVE\",\n  \"regStatus\": \"ISSUED\"\n}\n```\n\nSearch results include pagination:\n\n```json\n{\n  \"count\": 20,\n  \"results\": [...],\n  \"pagination\": {\n    \"currentPage\": 1,\n    \"perPage\": 20,\n    \"total\": 156,\n    \"lastPage\": 8\n  },\n  \"hasMore\": true\n}\n```\n\n## Error Handling\n\nThe server returns structured errors:\n\n| Error Code | Description | Retryable |\n|------------|-------------|-----------|\n| `not_found` | LEI/entity not in GLEIF database | No |\n| `invalid_format` | Invalid LEI/BIC/ISIN format | No |\n| `rate_limited` | GLEIF API rate limit exceeded | Yes |\n| `timeout` | Request timed out | Yes |\n| `server_error` | GLEIF API error | Depends on status |\n| `network_error` | Connection failed | Yes |\n\nExample error response:\n```json\n{\n  \"code\": \"not_found\",\n  \"message\": \"LEI not found in GLEIF database\",\n  \"statusCode\": 404,\n  \"retryable\": false\n}\n```\n\n## Architecture\n\n```\ngleif-mcp-server/\n├── main.go                 # Entry point, MCP server setup\n├── internal/gleif/\n│   ├── client.go          # GLEIF API client with caching & rate limiting\n│   ├── client_test.go     # Client and validation tests\n│   ├── cache.go           # LRU cache with TTL\n│   ├── types.go           # Data structures for API responses\n│   └── errors.go          # Structured error types\n└── tools/\n    ├── definitions.go     # Tool metadata and parameter specs\n    ├── handlers.go        # MCP tool implementations\n    └── handlers_test.go   # Handler tests with mock server\n```\n\n### Technical Details\n\nFor developers who want the specifics:\n\n| Setting | Value |\n|---------|-------|\n| Cache duration | 15 minutes |\n| Cache capacity | 1000 entities, 500 searches |\n| Rate limit | 50 req/min (GLEIF allows 60) |\n| Retry strategy | 3 attempts with exponential backoff |\n| Connection pool | 100 max idle, 10 per host |\n\n## API Reference\n\nThis server wraps the public GLEIF API:\n- **Base URL**: https://api.gleif.org/api/v1\n- **Authentication**: None required\n- **Rate Limit**: 60 requests/minute\n- **Documentation**: https://www.gleif.org/en/lei-data/gleif-api\n\n## Troubleshooting\n\n### Server won't start\n- Check the binary has execute permissions: `chmod +x gleif-mcp-server`\n- Verify the path in your MCP config is absolute, not relative\n\n### \"Rate limit exceeded\" errors\n- The server automatically handles rate limiting with retries\n- If persistent, reduce concurrent requests or wait a few minutes\n\n### \"LEI not found\" for valid LEI\n- The GLEIF database updates daily; recently issued LEIs may not appear immediately\n- Verify the LEI format (exactly 20 alphanumeric characters)\n\n### Slow responses\n- First requests may be slower (cache warming)\n- GLEIF API occasionally has latency spikes; retries handle this automatically\n\n### Claude Desktop doesn't show the server\n- Restart Claude Desktop after editing config\n- Check JSON syntax in config file\n- Verify the binary path exists and is executable\n\n## Development\n\n```bash\n# Run tests\ngo test ./...\n\n# Run tests with coverage\ngo test -coverprofile=coverage.out ./...\ngo tool cover -html=coverage.out\n\n# Run tests with race detector\ngo test -race ./...\n\n# Build\ngo build -o gleif-mcp-server .\n```\n\n## Contributing\n\nContributions welcome. Please open an issue first to discuss proposed changes.\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n\n## More MCP Servers\n\nCheck out my other MCP servers:\n\n| Server | Description | Stars |\n|--------|-------------|-------|\n| [mediawiki-mcp-server](https://github.com/olgasafonova/mediawiki-mcp-server) | Connect AI to any MediaWiki wiki. Search, read, edit wiki content. | ![GitHub stars](https://img.shields.io/github/stars/olgasafonova/mediawiki-mcp-server?style=flat) |\n| [miro-mcp-server](https://github.com/olgasafonova/miro-mcp-server) | Control Miro whiteboards with AI. Boards, diagrams, mindmaps, and more. | ![GitHub stars](https://img.shields.io/github/stars/olgasafonova/miro-mcp-server?style=flat) |\n| [nordic-registry-mcp-server](https://github.com/olgasafonova/nordic-registry-mcp-server) | Access Nordic business registries. Look up companies across Norway, Denmark, Finland, Sweden. | ![GitHub stars](https://img.shields.io/github/stars/olgasafonova/nordic-registry-mcp-server?style=flat) |\n| [productplan-mcp-server](https://github.com/olgasafonova/productplan-mcp-server) | Talk to your ProductPlan roadmaps. Query OKRs, ideas, launches. | ![GitHub stars](https://img.shields.io/github/stars/olgasafonova/productplan-mcp-server?style=flat) |\n| [tilbudstrolden-mcp](https://github.com/olgasafonova/tilbudstrolden-mcp) | Nordic grocery deal hunting. Find offers, plan meals, track spending. | ![GitHub stars](https://img.shields.io/github/stars/olgasafonova/tilbudstrolden-mcp?style=flat) |\n\n---\n\n## Acknowledgments\n\n- [GLEIF](https://www.gleif.org/) for the public LEI API\n- [Model Context Protocol](https://modelcontextprotocol.io/) for the MCP specification\n",
  "bytes": 16014,
  "sha": "af0fc9f13b2a49157e5139ced2484f11c656308b5bc4b688c58177f750568c68",
  "repo_slug": "olgasafonova/gleif-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_olgasafonova_gleif_mcp_server_8fa3665d/readme"
}