ROCTUP/1c-mcp-toolkit

MCP и REST API сервер для получения метаданных и данных из базы 1С

What this project is

1C MCP Toolkit is a bridge that lets AI agents (like Kiro or Claude) talk to databases built on 1C:Enterprise — a business software platform widely used in Russia and CIS countries. The AI agent can query data, run code, inspect metadata, and more, all through a standard protocol called MCP (Model Context Protocol) or through a plain REST API.

The problem it solves

Normally, connecting external tools to a 1C database is painful: you might need to modify the 1C configuration, publish a 1C server, or use fragile COM connections. This toolkit avoids all of that. It works with 1C versions 8.2.13 and up through 8.3.25, requires no configuration changes, and doesn't need a published server.

How it works — two modes

1. Embedded server (recommended, no Python)

You open a special 1C processing file (MCP_Toolkit.epf) inside 1C, press "Start server," and an HTTP server runs inside the 1C process itself. The AI agent connects directly to that server. No Python, no extra infrastructure.

2. Proxy mode (Python + optional Docker)

A separate Python server (built with FastAPI and the MCP SDK) sits between the AI agent and the 1C processing file. The 1C side communicates with the proxy via HTTP long polling (the 1C side periodically checks for new commands). This mode supports Docker containers and can run on a server without an open 1C client.

What the AI agent can do

The toolkit exposes a set of tools (both via MCP and REST API). Key ones include:

  • execute_query — run queries in the 1C query language
  • execute_code — run arbitrary 1C code
  • get_metadata — inspect the database's metadata structure
  • get_event_log — read the registration log
  • get_object_by_link / get_link_of_object — fetch or generate navigation links to objects
  • find_references_to_object — find everything that references a given object
  • get_access_rights — check access permissions
  • get_bsl_syntax_help — look up BSL (1C's built-in language) syntax
  • get_screenshot — capture the active 1C window as a base64 PNG (Windows only)
  • restart_1c_session / close_1c_session — manage the 1C session (useful after configuration updates or for exclusive-access operations)
  • submit_for_deanonymization — send a final answer for de-anonymization (only when anonymization is enabled)

Setup options

  1. Embedded server — open the .epf file in 1C, choose "Embedded server," press start, point your AI agent at http://<1C-computer-ip>:6003/mcp. Works natively on macOS too (with pre-built universal binaries).
  2. Docker Hub — pull a ready-made proxy image and run it with one docker run command.
  3. Docker Compose — clone the repo and run docker-compose up -d.
  4. Direct Python — create a virtual environment, install dependencies, run python -m onec_mcp_toolkit_proxy. Server listens on http://localhost:6003.

Configuring AI agents

  • Kiro IDE — add a JSON block to .kiro/settings/mcp.json pointing at the server URL.
  • Claude Desktop — this app only supports stdio servers, so you need a bridge called mcp-remote (requires Node.js). The README gives exact config snippets for Windows and macOS. For external HTTPS servers, you can use Claude's Custom Connector feature instead.

Security

  • Token authentication — by default the embedded server requires no auth. You can set a token in the 1C form (or generate one), then clients must send Authorization: Bearer <token> headers. Empty token = auth off.
  • Dangerous operations — blocked by a configurable blacklist. There's an environment variable ALLOW_DANGEROUS_WITH_APPROVAL=true for an approval-based mode.
  • Channel isolation — if multiple 1C clients connect to one proxy, you can isolate command streams by appending ?channel=<id> to the URL (e.g., separate channels for dev vs. production environments).

Data anonymization

The toolkit can automatically anonymize personal/confidential data before sending it to the AI agent. Real values get replaced with stable tokens like [ORG-00001] or [PER-00001]. The agent can pass those tokens back in queries, and the server restores the real values. Configuration differs by mode: in the embedded server it's set up via the 1C form; in proxy mode it's controlled by environment variables (plus optional SpaCy NER and per-channel token isolation).

Extra: Skills for AI agents

The repo includes ready-made "skills" — detailed instruction documents for AI agents. Two are mentioned:

  • calling-1c-rest-api-via-curl — a full guide to using the REST API via curl (endpoints, formats, workflows, error handling)
  • composing-1c-queries — rules for writing correct 1C query-language queries (syntax, optimization, virtual tables, temporary tables, JOINs)

These are meant to be loaded into AI agents that use the REST API, so the agent knows how to interact properly.

REST API alternative

If an AI agent doesn't support MCP, the proxy also exposes the same functionality as a plain REST API at http://localhost:6003/api/. All endpoints follow a uniform response format: {"success": true, "data": ...} on success, {"success": false, "error": "..."} on failure. One exception: submit_for_deanonymization returns {"received": true} instead.

Bottom line

This toolkit makes 1C databases accessible to modern AI agents with minimal setup friction — no config changes, no server publishing, no COM. You pick the deployment style that fits (embedded, Docker, or direct Python), configure your agent, and start querying 1C data conversationally.


Note: This explainer is based solely on the README. Some details (like exact security boundaries or full REST examples) are referenced in a separate README_FULL.md that wasn't provided here.

Related

  • Project
  • Project
  • Project
  • Project
  • Project