ON

onec-mcp

Активный
@ruslan-hutИнтеграция с базой данныхДобавлен: 30 апр. 2026 г.

Go-шлюз между LLM/MCP-клиентом и 1C ERP через HTTP. Специализирован на операциях продаж: поиск контрагентов, определение склада, отчёт по продажам.

4
views
0
comments
goerpпродажиhttp

MCP tools

resolve_customerresolve_warehousesales_report

Описание

Go-шлюз между LLM/MCP-клиентом и 1C ERP через HTTP. Специализирован на операциях продаж: поиск контрагентов, определение склада, отчёт по продажам.

README

OneC MCP

Go MCP JSON-RPC 1C License

A Go service that acts as a gateway between an LLM/MCP client and 1C ERP via HTTP.

Features

  • Customer resolution - search customers by free-text query with disambiguation support
  • Warehouse resolution - search warehouses by free-text query with disambiguation support
  • Sales reporting - fetch sales data with filters, grouping, and sorting
  • MCP protocol support - JSON-RPC 2.0 endpoint for LLM integration

Requirements

  • Go 1.23+
  • 1C HTTP service (or mock server for development)

Quick Start

# Run the server
go run ./cmd/server

# Test health endpoint
curl http://localhost:8088/health

# Test MCP endpoint
curl -X POST http://localhost:8088/mcp \\
  -H 'Content-Type: application/json' \\
  -H 'Authorization: Bearer your-secret-token' \\
  -d '{"jsonrpc":"2.0","method":"tools/list","id":1}'

Configuration

Copy and edit the config file:

cp configs/config.yml configs/config.local.yml
OptionDescriptionDefault
server.hostServer bind address0.0.0.0
server.portServer port8088
onec.base_url1C API base URL-
onec.timeout_msRequest timeout in ms8000
onec.auth.typeAuth type (basic / bearer)-
limits.resolve_limitMax resolve results10
limits.max_rowsMax report rows5000
mcp.enabledEnable MCP endpointtrue
mcp.bearer_tokenBearer token for MCP auth-
api.bearer_tokenBearer token for REST API auth-

Documentation

DocumentDescription
API ReferenceREST and MCP endpoint specifications
Testing GuideWhat can be tested without 1C backend
1C IntegrationExpected 1C endpoints and formats

Project Structure

├── cmd/server/          # Application entry point
├── configs/             # Configuration files
├── docs/                # Documentation
├── internal/
│   ├── api/             # HTTP handlers and router
│   ├── config/          # Configuration loader
│   ├── mcp/             # MCP JSON-RPC handler
│   └── onec/            # 1C HTTP client
├── go.mod
└── go.sum

Endpoints

EndpointMethodDescription
/healthGETHealth check
/resolve/customerPOSTSearch customers
/resolve/warehousePOSTSearch warehouses
/reports/salesPOSTSales report
/mcpPOSTMCP JSON-RPC 2.0

MCP Tools

ToolDescription
resolve_customerSearch customers by name, phone, etc.
resolve_warehouseSearch warehouses by name or code
sales_reportGet sales with filters and grouping

Комментарии

Войдите, чтобы оставить комментарий

Войти

Загрузка...