Content
# MCP Server Development in 1C
The tool for creating MCP (Model Context Protocol) servers on the 1C:Enterprise platform. Allows you to develop 1C extensions that provide data and functionality for AI assistants (chats with language models, Claude Desktop, Cursor, and other AI clients).
Detailed video about the project and its capabilities:
[VK Video](https://vkvideo.ru/video-219359576_456239024) | [Youtube](https://youtu.be/ZEla85JsfCo) | [Rutube](https://rutube.ru/video/ba1c64432d1a5b6cfd2335b83bf47071/)
The project contains a ready-made extension for 1C, which takes on all the technical routine of the MCP protocol. You only need to implement the business logic of your tools. Tools for working with 1C configuration metadata are available "out of the box".
## How it works: MCP Concept
The quality of the language model's (LLM) response directly depends on the quality of the context provided to it. Preparing such context manually can be laborious.
**Model Context Protocol (MCP)** is an open standard that allows the model to request necessary data through special "tools" provided by your server. Thus, the context for solving the problem is collected automatically.
## Project Components
1. **`src/1c_ext/`** - **1C Extension:** The core of the solution. Implements the MCP server and tools.
2. **`src/py_server/`** - **Python Proxy:** An optional but recommended component for solving infrastructure problems.
## Quick Start
### Step 1: Installing the 1C Extension
Connect the ready-made, compiled extension from the `build/MCP_Сервер.cfe` directory to your configuration.
### Step 2: Publishing the HTTP Service
Publish the `mcp_APIBackend` HTTP service, which is located in the extension, on a web server.
> **Important:** The case of the base name in the URL must exactly match the name of the publication (e.g., `base`, not `Base`). Mismatched case leads to redirects that turn POST requests into GET requests.
> **Important:** For direct connection of the AI client to 1C (without a proxy), it is required to publish the base without the need for authentication ("embed" the access credentials to the base in default.vrd), which is unsafe. A solution to this problem is described in the "Connection Options" section.
### Step 3: Connecting the AI Client
Connect the MCP client (e.g., Cursor) to the published HTTP service (`.../your_base/hs/mcp/`). Examples of settings for different clients are located in the [`mcp_client_settings/`](./mcp_client_settings/) directory.
## Connection Options
### Option 1: Direct Connection to 1C
- **How it works:** `AI-client ←→ 1C HTTP service`
- **Limitations:**
- Requires publishing the 1C HTTP service without authentication.
- It is impossible to connect clients that require the `stdio` transport.
- Limited compatibility with some HTTP clients due to protocol nuances.
### Option 2: Connection through Python Proxy (Recommended)
- **How it works:** `AI-client ←→ MCP proxy (Python) ←→ 1C HTTP service`
- **Why is it needed?** The proxy solves key infrastructure problems:
- **Transport problem:** Allows connecting clients that work via `stdio`.
- **Authentication problem:** Implements the `OAuth2` protocol (standard authentication method in MCP) and passes authorization to 1C via `Basic Auth`. This allows **not to disable** 1C authentication on the web server. The proxy supports two modes: working on behalf of one fixed user or "passing through" authentication of each user under their own account credentials.
- **Setting up and launching the proxy:**
- Detailed instructions on requirements, installation, configuration, and launch are in the [Python proxy documentation](./src/py_server/README.md).
### Option 3: Running the Proxy in Docker
For isolated launch of the proxy server in a container:
```bash
# Copy the example configuration
cp .env.docker.example .env
# Edit .env (specify URL, login, password)
# Launch the container
docker-compose up -d
```
> **Important:** If 1C is on the same host, use `host.docker.internal` instead of `localhost` in `MCP_ONEC_URL`.
Read more in the [Python proxy documentation](./src/py_server/README.md#docker).
## Developing Custom Tools
Functionality is extended by adding custom tools for interacting with 1C data.
- **Step 1:** In the extension, create a new processing and include it in the `mcp_КонтейнерыИнструментов` subsystem.
- **Step 2:** In the manager module of this processing, implement two export methods:
```bsl
// Method for describing tools and their parameters
Procedure AddTools(Tools) Export
// ... here you describe what tools your processing provides
EndProcedure
// Method for executing tool logic
Function ExecuteTool(ToolName, Arguments) Export
// ... here you implement the logic that will be called by the AI model
EndFunction
```
A detailed guide to development is in the [`src/1c_ext/agents.md`](./src/1c_ext/agents.md) file.
## Other MCP Primitives
In addition to **Tools**, the project also supports **Resources** for providing static context (e.g., files) and **Prompts** for prepared message templates.
## Documentation
- **[Python Proxy Documentation](./src/py_server/README.md)** — detailed description of setting up and launching the proxy server.
- **[Guide to Development in 1C](./src/1c_ext/agents.md)** — details on implementing tools, resources, and prompts on the 1C side. Can be connected to code generators (AI agents).
- **[Examples of Client Settings](./mcp_client_settings/)** — ready-made configurations for different AI clients.
## License
MIT License
## Support and Development
The project is actively developing. Questions and suggestions for improvement are welcome through Issues.
Connection Info
You Might Also Like
everything-claude-code
Complete Claude Code configuration collection - agents, skills, hooks,...
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
firecrawl
Firecrawl MCP Server enables web scraping, crawling, and content extraction.
cc-switch
All-in-One Assistant for Claude Code, Codex & Gemini CLI across platforms.
servers
Model Context Protocol Servers
servers
Model Context Protocol Servers