Content
1CP - MCP Server forC:Enterprise
An 1C:Enterprise that turns an information database into anCP Server** (Model Context Protocol) for integration with AI assistants: Cursor, Claude Desktop, and other MCP clients.
Repository: [github.com/Deker/1C](https://github.com/DarkVaneker/1C_MThe project is based on [vladimir-kharin/1cp](https://github.com/vladimir-kharin/1c_mcp) and extends it with two tools for **executing and checking in the 1C embedded language directly in the context of your## Differences from the base project
| Feature | [1c](https://github.com/vladimir-kharin/1c) | 1C_MCP (this repository) |
|| MCP Tools / Resourcespts | ✓ | ✓ |
with configuration metadata | ✓ || **`execute_1_simple`** — quick execution of a code fragment | — | ✓ |
| **`execute_1c_code_complex`** — building and executing a module | — | ✓ Asynchronous queue for building `.ep via scheduled job | — |
## How it works
Client (Cursor) ←→ Python MCP Proxy ←→ HTTP service mcp_APIB ←→ Container processes
The **HTTP servicemcp_APIBackend` implements the JSON-RPC the MCP protocol (`tools `tools/call`,/*`, `prompts/*`).
- **Container processes** through the `mcp_ToolContainers` subsystem.
- To AI client, it is recommended to use a **Python proxy** from the base project — it solves authentication and `stdio` transport issues.
details about the architecture, see.md](agents.md).
Tools
### From the base| Tool | Description---|---|
| `list_metadata | List of metadata objects and name mask |
| `_structure` | Structure of metadata object |
| `get_report_details` | SKD and a report variant object |
###
#### `execute_1c_code_simple`
Synchronous a simple, self-contained 1C code in the current session.
**Parameters:**
| Type | Required | Description---|---|---|---|
| `code string | yes | Code in the 1C embedded language `context` | string | no with variables declared before execution (default: `{}`) |
**Features:**
- Supports no more than one procedure or function.
- If the code contains `Return`, returned in the response Changes in the database are performed in a transaction with rollback.
**Example call:**
```json
{
"code": "Result = 2 + 2;\nReturn "context": "{}```
#### `execute_1c_code_complex`
Asynchronous building of code into an external process (`.epf`) and calling a specified entry point. Use when the code contains multiple procedures/functions and cannot be split into several calls of `execute_code_simple`.
**Parameters:**
| Parameter | Type | Required | Description |
|---|---|---|---|
| `code` | string | yes | Module code with multiple procedures/functions |
| `entry_point` | string | yes | Name of the exported procedure or function to call |
| `context` | string | no | JSON with context variables and method parameters (default: `{}`**Execution architectureexecute_1c_code_complex
│
▼ mcp_CodeCheck ──► Scheduled job mcp_CodeCheck
│
│ epf (1cv)
│ Executing entry_point
▼ Polling result ◄──────────── Writing result
```
> **Important:** for `1c_code_complex` to work, the `mcp` scheduled job must be the 1C server the user/ras must have run `1cv8.exe` to build external processes.
## Repository structure
```
1C_MCP/
├── README.md # This file
├── LICENSE # License (non-commercial use of additional components)
├── agents.md # Guide to developing MCP tools bslrules.mdc # Rules for AI assistants ( when working with 1C
├── MCP_Server.cfe -made extension for installation
└── MCP_Server_Выгрузка # XML dump of the extension (EDT / Configurator ├── Configuration.xml
ervices/mcp_APIB/
├── CommonModules/
├── DataProcessors/
Registers/mcp_CodeCheckQueue/
└── ScheduledJobs/mcp_CodeCheck/
```
## Quick start
### Requirements
- 1Enterprise platform **8.3.20** and higher ( mode: 8.3.20)
- Published HTTPmcp_APIBackend` on a web server
MCP Proxy — see [documentation of the base project](https.com/vladimir-khar1c_mcp)
1. Installing the extension
1. Download the ready [MCP_Server.cfe](MCP_Server.cfe the repository root.
2. Connect the **MCP_Server to your information database via **Configuration → Extensions → Add from file**.
3. Ensure that the user is assigned the `mcp_Main role.
For development and building from sources, use the `MCP_Server_Выгрузка/`### Step 2 the scheduled job
Forexecute_1c_code tool:
1. Open **Administration → Scheduled and background jobs**.
2. Find the **Mcp** (`mcp`) job.
3. Enable the job and configure the schedule: every **10–**).
4. Ensure1cv8.exe` on the 1C server (used for building `.epf`).
### Step 3 the HTTP service
Publish thecp_APIBack HTTP service on a web server.
> **Important:** the the database name in the **exactly** match the (e.g., `base`, not `Base`). M cases lead to redirects that turn POST requests into GET requests URL: `http://server/base/hs/mcp/ Step 4. Connecting client
It is recommended a Python proxy fromladimir-kharin/1c_mcp](https://github.com/vladimir-kharin/1c_mcp):
```
AI Client ←→ Python MCP Proxy ←→ 1C HTTP service
```
Examples of MCP client configurations are in the [mcp_client_settings](https://github.com/vladimir-kharin/1c_mcp/tree/main/mcp_client_settings) directory of the base repository.
**Example for Cursor** (`~/.cursor/mcp.json`):
```json "mcp {
"1c-server-direct": {
": "http:PORT/mcp",
headers": {}
}
}
}
```
The specific method of launching the proxy are described in the documentation of the in the base project.
## Security
The `execute__code_simple` and_1c_code_complex **execute arbitrary code** in the context of the information database is a powerful but potentially.
**Recommendations:**
not publish the HTTP authentication in production.
- Python proxy with OAuth2 / Basic Auth.
- Limit access only to trusted users and.
- Do not productive databases without an explicit## Developing custom tools
Create a process with themcp_Tool2. Include it inmcp_ToolContainers.
3. Implement the `AddTools()` and `Execute methods in the manager module.
A detailed guide is in.md](agents.md).
The project is based-source solution [vladimir-kharin/1cp](https://github.com/vladimir-kharin/cp) ().
## License
MIT see the [LICENSE](LICENSE.
When publishing the attribution of the base Vladimir Kharin.