1C AI MCP
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@1C AI MCPпроверь этот код на синтаксические ошибки"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
1C AI MCP - MCP server for 1С:Напарник
MCP server (Model Context Protocol) for integrating IDEs with the 1С:Напарник API. Built on FastMCP (Python), packaged in Docker. Works with Cursor, Claude Code, and any MCP-compatible clients.
12 tools: code analysis (check, review, refactoring) and documentation search (ITS, platform, configurations).
Based on the idea of comol/1c-code-checker with API format fixes (422 errors) borrowed from SteelMorgan/spring-mcp-1c-copilot.
Prerequisites
Docker (or Docker Desktop)
1С:Напарник token - get it at code.1c.ai (ITS subscription required)
Related MCP server: 1C_MCP_SERVER_OWN
Quick Start
Option A: Ready-made image from Docker Hub (recommended)
docker run -d --name 1c-ai-mcp -p 8007:8007 \
-e ONEC_AI_TOKEN="ваш-токен" \
desko77/1c-ai-mcp:latestOr via Docker Compose - create a docker-compose.yml file:
services:
1c-ai-mcp:
image: desko77/1c-ai-mcp:latest
container_name: 1c-ai-mcp
ports:
- "8007:8007"
environment:
ONEC_AI_TOKEN: "${ONEC_AI_TOKEN}"
restart: always# Создать .env с токеном (не попадает в git)
echo 'ONEC_AI_TOKEN=ваш-токен' > .env
# Запустить
docker compose up -dOption B: Build from source
git clone https://github.com/Desko77/1c-ai-mcp.git
cd 1c-ai-mcp
# Создать .env с токеном
echo 'ONEC_AI_TOKEN=ваш-токен' > .env
# Собрать и запустить
docker compose up -d --buildChecking functionality
# Должен вернуть HTTP 200
curl http://localhost:8007/mcpConnecting to IDE
Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"1c-naparnik": {
"url": "http://localhost:8007/mcp"
}
}
}Claude Code
Add to ~/.claude/settings.json:
{
"mcpServers": {
"1c-naparnik": {
"url": "http://localhost:8007/mcp"
}
}
}Other MCP clients
Endpoint: http://localhost:8007/mcp
Transport: Streamable HTTP (default) or SSE (USESSE=true).
Tools
Code Analysis
check_1c_code
Checks 1C code: syntax, logic, performance. In direct mode, syntax is checked via the upstream syntax-checker.
Parameter | Type | Description |
| string | 1C code to check |
| string |
|
ask_1c_ai
Arbitrary question to 1С:Напарник. Preserves dialog context between calls.
Parameter | Type | Description |
| string | Question |
| bool | New session (default |
review_1c_code
Code review: style, ITS standards, naming, structure, readability. Does not check syntax.
Parameter | Type | Description |
| string | 1C code for review |
rewrite_1c_code
AI suggests its improved version of the code with an explanation of changes.
Parameter | Type | Description |
| string | 1C code to rewrite |
| string | Direction: |
modify_1c_code
Modifies code according to an explicit instruction. If code is not specified, generates new one.
Parameter | Type | Description |
| string | Description of required changes |
| string | Source code (optional) |
explain_1c_syntax
Explanation of a specific 1C syntax element.
Parameter | Type | Description |
| string | Syntax element |
| string | Usage context (optional) |
Documentation and Help
its_help
Search the ITS knowledge base (standards, methods, articles). Returns document IDs for fetch_its.
Parameter | Type | Description |
| string | Search query |
fetch_its
Read an ITS document by ID. Used after its_help.
Parameter | Type | Description |
| string | Document ID ( |
search_1c_documentation
Search the 1C:Enterprise platform documentation for a specific version.
Parameter | Type | Description |
| string | Search query |
| string | Version (default |
onec_help
Search the platform documentation (latest version). Like search_1c_documentation, but without specifying a version.
Parameter | Type | Description |
| string | Search query |
diff_1c_documentation_versions
Compare platform documentation between two versions.
Parameter | Type | Description |
| string | Earlier version (e.g., |
| string | Later version (e.g., |
| string | Subject area (optional) |
config_help
Search documentation for applied configurations (ERP, Accounting, ZUP, UT, etc.).
Parameter | Type | Description |
| string | Search query |
| string | Configuration name (optional, taken from |
Configuration
All parameters are passed via environment variables.
Variable | Required | Default | Description |
| Yes* | - | 1С:Напарник API token |
| No | - | Path to token file (Docker Secrets) |
| No |
| Base API URL |
| No |
| Skill for discussions ( |
| No |
| Authorization format: |
| No |
| HTTP request timeout (sec) |
| No | - | Configuration for config_help (e.g., |
| No |
| Mode: |
| No |
| Max input length (characters) |
| No |
| MCP server port |
| No |
| Transport: |
| No |
| Limit of concurrent sessions |
| No |
| Session TTL (sec) |
| No |
| Logging level ( |
* Either ONEC_AI_TOKEN or ONEC_AI_TOKEN_FILE is required.
Docker Secrets
For production environments, the token can be passed via a file:
services:
1c-ai-mcp:
image: desko77/1c-ai-mcp:latest
environment:
ONEC_AI_TOKEN_FILE: /run/secrets/onec_token
secrets:
- onec_token
secrets:
onec_token:
file: ./onec_token.txtDirect Mode
With MCP_TOOL_CALL_MODE=direct, documentation tools and check_1c_code (syntax) call 1С:Напарник upstream tools directly by name, instead of text prompts. This gives more accurate results.
Upstream tools:
mcp__knowledge-hub__Search_ITS- forits_helpmcp__knowledge-hub__Fetch_ITS- forfetch_itsmcp__knowledge-hub__Search_Documentation- forsearch_1c_documentation,onec_helpmcp__knowledge-hub__Diff_Documentation_Versions- fordiff_1c_documentation_versionsmcp__syntax-checker__validate- forcheck_1c_code(syntax)
On direct call failure, automatic fallback to prompt mode. Default is standard for backward compatibility.
Architecture
MCP-клиент (Cursor / Claude Code)
-> FastMCP HTTP endpoint (:8007/mcp)
-> mcp_server.py (обработчики инструментов)
-> OneCApiClient (HTTP-клиент)
-> code.1c.ai API (SSE-стриминг)
-> парсинг ответа -> возврат клиентуTwo operation modes
Standard mode (default): tools form text prompts and send them to the API. Documentation tools use a tool chain - the model itself decides which server tool to call.
Direct mode (
MCP_TOOL_CALL_MODE=direct): tools explicitly request a specific upstream tool by name, match the response, and confirm the call. On failure - automatic fallback to standard mode.
SSE parser
Supports three API response formats:
Format | Structure | Type |
Legacy |
| Incremental |
OpenAI-like |
| Incremental |
Completed |
| Final |
Additionally:
Automatic removal of
<thinking>/thinkingblocks from responsesUnicode normalization and cleanup of control characters
Fallback on receiving
tool_calls- repeat request withskill_name="raw"Truncation of input data by
ONEC_AI_INPUT_MAX_LENGTH
Development
Local run without Docker
pip install -r requirements.txt
export ONEC_AI_TOKEN="ваш-токен"
python main.pyProject structure
main.py # Точка входа
src/
mcp_server.py # MCP-инструменты (@mcp.tool)
onec_api_client.py # HTTP-клиент к API 1С:Напарник
Dockerfile # Dockerfile
docker-compose.yml # Compose для сборки из исходников
tests/ # Тестовые скрипты
.github/workflows/
docker-publish.yml # CI: сборка и публикация в Docker HubAcknowledgements
comol/1c-code-checker - original idea (repository closed)
SteelMorgan/spring-mcp-1c-copilot - correct API algorithms
FastMCP - MCP server framework
License
MIT - see LICENSE
This server cannot be installed
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
- AlicenseNot gradedqualityFmaintenanceProvides a RAG-based search system for 1C:Enterprise platform documentation using hybrid BM25 and semantic search across multiple versions. It enables developers to retrieve API signatures, methods, and usage examples directly within IDEs or through a REST API.22MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with 1C:Enterprise databases through natural language, providing metadata retrieval, configuration analysis, and code generation.9
- AlicenseNot gradedqualityAmaintenanceEnables searching through 1C:Enterprise configuration source code (XML+BSL) with full-text indexing, providing tools to find code, metadata objects, procedures, and modules.MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to lint, search documentation, and perform metadata scaffolding for 1C:Element projects.2MIT
Related MCP Connectors
Get up-to-date, version-specific documentation and code examples from official sources directly in…
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Provide AI-powered real-time analysis and intelligence on NPM packages, including security, depend…
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/serezhenkov-lab/1c-ai-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server