Labsco
olgasafonova logo

GLEIF MCP Server

โ˜… 5

from olgasafonova

Access the Global Legal Entity Identifier (LEI) database for company verification, KYC, and corporate ownership research via GLEIF's public API.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeAdvanced setup

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.

Go Report Card

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.

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

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

Tools Reference

Core Lookup Tools

ToolDescriptionParameters
lei_lookupGet full details for a specific LEIlei (required): 20-char LEI code
validate_leiCheck format, check digits, and statuslei (required): LEI to validate
batch_lei_lookupLook up multiple LEIs at onceleis (required): Comma-separated LEIs (max 100)

Search Tools

ToolDescriptionParameters
search_entitySearch by company namequery (required), limit (default 20), page (default 1), fuzzy (default true)
search_by_bicFind LEI from BIC/SWIFTbic (required): 8 or 11 char code
search_by_isinFind issuer LEI from ISINisin (required): 12-char ISIN
search_by_countryList entities by countrycountry (required): ISO 2-letter code, limit (default 20)
autocompleteEntity name suggestionsprefix (required): min 2 chars, limit (default 10)

Relationship Tools

ToolDescriptionParameters
get_relationshipsGet corporate/fund relationshipslei (required), type: direct-parent, ultimate-parent, children, fund-manager, umbrella-fund, sub-funds

LEI Issuer Tools

ToolDescriptionParameters
get_lei_issuerGet details about an LOUissuer_id (required): LOU identifier
list_lei_issuersList all LOUs worldwideNone

Compliance Tools

ToolDescriptionParameters
get_reporting_exceptionsGet Level 2 reporting exceptionslei (required): LEI to check

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 CodeDescriptionRetryable
not_foundLEI/entity not in GLEIF databaseNo
invalid_formatInvalid LEI/BIC/ISIN formatNo
rate_limitedGLEIF API rate limit exceededYes
timeoutRequest timed outYes
server_errorGLEIF API errorDepends on status
network_errorConnection failedYes

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 server

Technical Details

For developers who want the specifics:

SettingValue
Cache duration15 minutes
Cache capacity1000 entities, 500 searches
Rate limit50 req/min (GLEIF allows 60)
Retry strategy3 attempts with exponential backoff
Connection pool100 max idle, 10 per host

API Reference

This server wraps the public GLEIF API:

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 .

More MCP Servers

Check out my other MCP servers:

ServerDescriptionStars
mediawiki-mcp-serverConnect AI to any MediaWiki wiki. Search, read, edit wiki content.
miro-mcp-serverControl Miro whiteboards with AI. Boards, diagrams, mindmaps, and more.
nordic-registry-mcp-serverAccess Nordic business registries. Look up companies across Norway, Denmark, Finland, Sweden.
productplan-mcp-serverTalk to your ProductPlan roadmaps. Query OKRs, ideas, launches.
tilbudstrolden-mcpNordic grocery deal hunting. Find offers, plan meals, track spending.