mcp-egrul
This server provides access to Russian Federal Tax Service (FNS) public registries — EGRUL (legal entities) and EGRIP (individual entrepreneurs) — allowing you to look up and retrieve company/entrepreneur data.
Search & Lookup:
search_by_inn: Find a legal entity (10-digit INN) or individual entrepreneur (12-digit INN) by INN.search_by_ogrn: Find an entity by OGRN (13 digits) or OGRNIP (15 digits).search_by_name: Fuzzy full-text search (FTS5) across entity names, with optional result limit (1–50, default 10) and filtering by active status.
Data Retrieval:
get_full_card: Retrieve a complete profile including requisites, OKVED activity codes, founders, and director — using either INN or OGRN.get_founders: Get the list of founders with ownership shares for a legal entity (10-digit INN only).get_director: Get the current director of a legal entity (10-digit INN only).
Bulk Operations:
bulk_cards: Fetch up to 100 entity cards in a single request by INN list; returns successful cards and per-INN errors separately so one bad INN doesn't break the whole batch.
Diagnostics:
ping: Check that the server is alive and retrieve its current version and local data snapshot size.
Hosting & Data:
Supports self-hosting via SQLite with official FNS open-data dumps (imported manually or via daily automated updates).
When an
ATOMNO_API_KEYis provided, all tools are proxied to a hosted API (api.atomno-mcp.ru) for more up-to-date data and additional Pro features.
mcp-egrul
MCP server (Model Context Protocol — an open protocol for connecting AI assistants to external tools) for working with EGRUL (Unified State Register of Legal Entities of the Russian Federation) and EGRIP (Unified State Register of Individual Entrepreneurs). Source — official open-data dumps from the FTS (Federal Tax Service).
Status: v0.1.2 — open version (self-host via SQLite) is fully ready + hosted Pro client side (HTTP client HostedClient for api.atomno.ru). Published on PyPI, indexed in Glama and Smithery. The hosted Pro infrastructure itself is in active development. Coverage 100.00% (345 tests, ruff clean, fastmcp 3.2.4, enforced via --cov-fail-under=100).
Companion project: mcp-fns-check (risk-check layer over EGRUL).
What it is
Seven MCP tools visible to an AI assistant (Cursor, Claude Desktop, Cline, any MCP client):
Tool | Description | Arguments |
| Search by INN (10 digits — legal entity, 12 — IE) |
|
| Search by OGRN (13) or OGRNIP (15) |
|
| Fuzzy search by name (FTS5) |
|
| Full card with all sections |
|
| Founders with shares only |
|
| Current director only |
|
| Bulk check (up to 100 INNs) |
|
Plus a diagnostic ping to check if the server is alive.
Full payload specification — in src/mcp_egrul/schemas.py (Pydantic models CompanyCard, IECard, SearchResult, BulkResult).
Related MCP server: onec-meta-mcp
Installation
Option 1 — via PyPI (recommended for users)
# Без локального clone — работает «из коробки»
uvx atomno-mcp-egrul
# Или установка глобально
pipx install atomno-mcp-egrul
atomno-mcp-egrul
# Или классический pip в venv
pip install atomno-mcp-egrul
atomno-mcp-egrulOption 2 — dev-mode (for developers)
Requires Python 3.11+ and uv (fast pip replacement, optional).
git clone https://github.com/atomno-labs/mcp-egrul
cd mcp-egrul
uv venv
uv pip install -e ".[dev]"Alternatively via pip:
python -m venv .venv
.venv/Scripts/activate # Windows
# source .venv/bin/activate # Linux/macOS
pip install -e ".[dev]"Running
atomno-mcp-egrulDefault transport is stdio (standard input/output JSON-RPC). Suitable for connecting to Cursor / Claude Desktop / Claude Code.
Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"egrul": {
"command": "uvx",
"args": ["atomno-mcp-egrul"]
}
}
}Cursor (.cursor/mcp.json in the project or ~/.cursor/mcp.json globally)
{
"mcpServers": {
"egrul": {
"command": "uvx",
"args": ["atomno-mcp-egrul"]
}
}
}If you are not using
uv, replace"command": "uvx", "args": ["atomno-mcp-egrul"]with"command": "atomno-mcp-egrul"(requirespip install atomno-mcp-egrulorpipx install atomno-mcp-egrul).
Docker (self-host) — quick start
# 1. Скачайте дампы ФНС (acceptance на сайте ФНС — раз в жизни).
# Источники:
# ЕГРЮЛ — https://www.nalog.gov.ru/opendata/7707329152-egrul/
# ЕГРИП — https://www.nalog.gov.ru/opendata/7707329152-egrip/
# Положите их в структуру:
mkdir -p dumps/egrul/2026-04-24 dumps/egrip/2026-04-24
cp ~/Downloads/EGRUL_*.zip dumps/egrul/2026-04-24/
cp ~/Downloads/EGRIP_*.zip dumps/egrip/2026-04-24/
# 2. Первоначальный полный импорт (однократно, ~30-60 минут):
docker compose --profile import run --rm \
mcp-egrul-import atomno-mcp-egrul-import --registry egrul --full
docker compose --profile import run --rm \
mcp-egrul-import atomno-mcp-egrul-import --registry egrip --full
# 3. Запустите сервер + фоновый cron-демон:
docker compose up -d
docker compose logs -f mcp-egrul-schedulerAbout 10 minutes after import, all tools (search_by_inn, search_by_name, etc.) will respond with data from the local FTS snapshot.
Volume schema /data inside the container:
/data/
├── mcp_egrul_data.sqlite # SQLite + FTS5
└── dumps/ # read-only монтируется из ./dumps
├── egrul/
│ └── YYYY-MM-DD/*.zip
└── egrip/
└── YYYY-MM-DD/*.zipCron-daemon (atomno-mcp-egrul-scheduler) automatically fetches the freshest dump after you place it in dumps/<registry>/<YYYY-MM-DD>/ — at night at 03:00 Europe/Moscow. If there is nothing new, the job will finish with nothing_to_import and will not make any unnecessary entries in import_log.
Importing FTS dumps (manual mode)
Sources:
EGRUL open-data:
https://www.nalog.gov.ru/opendata/7707329152-egrul/EGRIP open-data:
https://www.nalog.gov.ru/opendata/7707329152-egrip/
Format: daily XML archives in ZIP, ~15 GB for a full snapshot. Legally, you must download them from the FTS website after accepting the license — the server does not download archives itself (strictly).
CLI:
# Полный первоначальный импорт (однократно):
atomno-mcp-egrul-import --registry egrul --full
atomno-mcp-egrul-import --registry egrip --full
# Инкремент (cron / ручной): загружается только если появилась более
# свежая YYYY-MM-DD-папка, чем последний успешный `import_log.source_dump_date`.
# Если новее нет — exit-code 5 и сообщение `nothing_to_import`.
atomno-mcp-egrul-import --registry egrul --incremental
# Фоновой cron-демон с ежедневным 03:00 MSK (вызывать вручную редко;
# обычно запускается сервисом mcp-egrul-scheduler в docker-compose).
atomno-mcp-egrul-scheduler --run-nowExit-codes atomno-mcp-egrul-import:
Code | Meaning |
0 | Import successful |
2 | Invalid config / CLI argument |
4 | Ingest error (corrupt XML, missing dumps directory, DB error) |
5 |
|
Pro / hosted-mode (proxy to api.atomno.ru)
When the user sets ATOMNO_API_KEY, all seven tools are automatically proxied to the hosted Pro API (SPEC §5.4, §5.4.1). Local SQLite is not used in this mode — hosted Pro provides:
Up-to-date data for today (without the daily delay of open-data dumps): direct scrape of
egrul.nalog.ru+ Dadata fallback on the server side.Bulk-endpoint without rate-limit (
POST /companies/bulk) — one request instead of N local gathers.AI-summary of the card, change history, search by director's full name (Pro-only tools — arrive with the hosted server in Phase 2, see §5.4.1).
Price: Pro — $10/mo separately or $15/mo bundled with mcp-fns-check (bundle-key). Free tier: 30 requests/day/IP without registration (SPEC §1).
Configuration in Cursor (.cursor/mcp.json):
{
"mcpServers": {
"egrul": {
"command": "uvx",
"args": ["atomno-mcp-egrul"],
"env": {
"ATOMNO_API_KEY": "your-pro-key-here"
}
}
}
}Behavior and errors — no silent fallback: if the hosted API is unavailable, the client raises a typed exception instead of silently returning data from an outdated local dump. Mapping HTTP ↔ MCP error code — in SPEC §5.4.1:
HTTP-response hosted API | Client exception |
|
200 | — | — |
400 |
|
|
401 |
|
|
403 |
|
|
404 (code=not_found) |
|
|
404 (wrong route) |
|
|
413 |
|
|
429 |
|
|
5xx |
|
|
timeout / DNS fail |
|
|
INN/OGRN validation remains client-side (check digits are verified before the HTTP request — saving round-trip on invalid identifiers).
Configuration (environment variables)
Variable | Description | Default |
| Path to SQLite file with EGRUL/EGRIP snapshot |
|
| HTTP client User-Agent |
|
| HTTP timeout in seconds |
|
| Directory with FTS dumps, structure |
|
| Logging level |
|
| Timezone for scheduler (cron 03:00) |
|
| (Pro) hosted-subscription key — enables proxying to | not set |
| (Pro) hosted-API base URL |
|
Example — see .env.example.
Structure
apps/mcp-egrul/
├── pyproject.toml
├── LICENSE # MIT
├── README.md # ЭТОТ ФАЙЛ
├── Dockerfile
├── docker-compose.yml
├── .env.example
├── .gitignore
├── src/mcp_egrul/
│ ├── __init__.py
│ ├── server.py # FastMCP entrypoint, регистрация 7 тулзов + ping
│ ├── context.py # ServiceContext (DI: SQLiteStore + HTTP-клиент)
│ ├── config.py # Чтение env-vars в типизированные поля
│ ├── constants.py # Все магические числа и enum'ы
│ ├── validators.py # Контрольные цифры ИНН (10/12) и ОГРН (13/15)
│ ├── schemas.py # Pydantic-модели CompanyCard/IECard/SearchResult/...
│ ├── errors.py # McpEgrulError и подклассы
│ ├── db/
│ │ ├── __init__.py
│ │ └── sqlite.py # Async-клиент (aiosqlite), init/query/upsert/search + import_log
│ ├── sources/
│ │ ├── __init__.py
│ │ ├── base.py # Абстрактный интерфейс Source
│ │ ├── opendata.py # ФНС open-data адаптер (read-local → SQLite upsert)
│ │ ├── opendata_parser.py # Потоковый lxml.iterparse парсер ЕГРЮЛ/ЕГРИП XML
│ │ └── hosted_adapter.py # HTTP-клиент hosted Pro API (SPEC §5.4.1)
│ ├── tools/
│ │ ├── __init__.py
│ │ ├── search_by_inn.py
│ │ ├── search_by_ogrn.py
│ │ ├── search_by_name.py
│ │ ├── get_full_card.py
│ │ ├── get_founders.py
│ │ ├── get_director.py
│ │ └── bulk_cards.py
│ └── scripts/
│ ├── __init__.py
│ ├── import_opendata.py # CLI `atomno-mcp-egrul-import` (ручной / одноразовый)
│ └── scheduler.py # CLI `atomno-mcp-egrul-scheduler` (apscheduler cron 03:00 MSK)
└── tests/
├── __init__.py
├── conftest.py
├── fixtures/
│ ├── egrul_sample.xml # Мини-ЕГРЮЛ (2 валидных + 1 skip на неизвестный статус)
│ └── egrip_sample.xml # Мини-ЕГРИП (active + closed)
├── test_validators.py
├── test_schemas.py
├── test_config.py # Config.from_env + _parse_float_env (валидация env)
├── test_sqlite_store.py
├── test_cards.py # _cards.py: parse_iso_date/datetime + build_*card
├── test_server_ping.py # FastMCP tool-layer + server.main()
├── test_tools.py # 7 тулзов: happy-path + validation + not_found
├── test_opendata_parser.py # XML-парсер (zip, xml, skip-на-неизвестный-статус)
├── test_opendata_source.py # OpenDataSource.run_ingest (full/incremental)
├── test_integration_import.py # Полный цикл import → search → get_card
├── test_import_cli.py # CLI `atomno-mcp-egrul-import`
├── test_scheduler_cli.py # CLI `atomno-mcp-egrul-scheduler` + _run_scheduler
└── test_hosted_adapter.py # HostedClient + маршрутизация тулзов (respx-моки)Tests
pytest -v --cov=src/mcp_egrulCurrent coverage: 100.00% (345 tests passed, ruff clean, 1529 statements + 382 branches, 0 misses). Enforced by --cov-fail-under=100 policy — any regression will break CI. Tests cover:
INN/OGRN/OGRNIP validators (check digits);
Config.from_env+ float-env-variable parser (validation, not silent fallback);all 7 MCP tools (happy-path + validation + not_found + bulk partial);
SQLite store + FTS5 +
import_log;XML-parser for EGRUL/EGRIP (zip, xml, skip-record with unknown status);
OpenDataSource.run_ingest(full/incremental/nothing_to_import);full integration cycle
import fixture → search → get_card → bulk;both CLIs (
atomno-mcp-egrul-import,atomno-mcp-egrul-scheduler) — cron-job registration, argument parsing,_run_daily_ingeston all-happy/nothing_to_import/McpEgrulError, full cycle_run_schedulerwith mock-edasyncio.Event;FastMCP tool-layer via
mcp.call_tool()— error serialization into structured dicts,server.main()with valid and invalid env;HostedClient(hosted Pro API proxy) — happy-path of all 7 methods, all HTTP errors from SPEC §5.4.1 (401/403/404/413/429/5xx), timeout/ConnectError, invalid JSON/payload from server, client-side bulk validation,async with-context; plus routing from tools in hosted-mode (whenATOMNO_API_KEYis set — request goes toapi.atomno.ru, not SQLite, INN validation before HTTP);edge-cases of XML-parser (75 separate unit-tests on
_parse_company/_parse_ie/_parse_share/_parse_director/_parse_founders/address fallbacks/legacy-attributes/invalid INN/OGRN/KPP lengths);private SQLite-store helpers (
_wrap,_prepare_row,_row_to_dict,_normalize_bm25, auto-init via_ensure, rejecting invalidfinish_importstatuses);ServiceContextreentry-idempotency,atexit-cleanup,Config.from_envValidationError → exit-code 2 fromatomno-mcp-egrul-importCLI.
External APIs are never called directly from tests — only via respx (HTTP-mocking) and local XML-fixtures (tests/fixtures/).
Security and legal status
All sources are publicly open FTS data (EGRUL / EGRIP open-datasets), the distribution of which is permitted by the Federal Law "On Information..." and EGRUL-specific norms (see SPEC §8).
Legal entities do not fall under 152-FZ (On Personal Data).
Full names of individual directors and founders are published by the FTS itself in the open registry — forwarding this data is legal.
No write-operations to any external API.
Secrets — only via environment variables, in the repository —
.env.examplewithout values.
Disclaimer
The service is an aggregator and a convenient interface over public FTS data. Not affiliated with the FTS. Use at your own risk. Information in the service's responses is not a substitute for a full legal or financial assessment.
License
MIT. LICENSE file in the root folder.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityBmaintenanceMCP server for verifying Russian counterparties (legal entities and individual entrepreneurs) via public Federal Tax Service data: EGRUL/EGRIP, bankruptcy registry (EFRSB), Transparent Business, bailiff service (FSSP), and arbitration courts (KAD).815MIT
- FlicenseNot gradedqualityCmaintenanceMCP server for searching and analyzing 1C enterprise metadata and BSL code using a SQLite backend. Enables querying configuration structure, code routines, and performing compliance checks via natural language.
- AlicenseAqualityAmaintenanceMCP server for Russian court practice (Sudact): full-text case search by law article, court, instance and dates, with access to full decision texts.22MIT
- AlicenseAqualityAmaintenanceMCP server for checking Russian FSSP (Federal Bailiff Service) debts, enabling AI agents to look up enforcement proceedings for individuals and legal entities through MCP clients like Cursor and Claude Desktop.4MIT
Related MCP Connectors
MCP server for nonprofit financials via ProPublica — IRS Form 990 data for 1.8M+ nonprofits.
MCP server for Brazilian Federal Senate open data (legislative, administrative, e-Cidadania).
Hosted MCP server for Mini Accountant: invoices, expenses, customers, analytics, tax estimates.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/atomno-mcp/mcp-egrul'
If you have feedback or need assistance with the MCP directory API, please join our Discord server