{ "openapi": "3.0.3", "info": { "title": "1C AI Dev Environment — MCP Tools API", "description": "MCP (Model Context Protocol) tools for 1C development.\n\nКаждый endpoint соответствует MCP tool. Параметры передаются в JSON body.", "version": "7.0.0", "contact": { "name": "Pradushkoai", "url": "https://github.com/Pradushkoai/1c-ai-dev-env" }, "license": { "name": "MIT", "url": "https://opensource.org/licenses/MIT" } }, "servers": [ { "url": "stdio://1c-ai-mcp", "description": "MCP server (stdio transport)" } ], "paths": { "/tools/data_status": { "post": { "summary": "data_status", "description": "Статус данных проекта: что доступно (платформа, конфигурации), что нужно перестроить, доступен ли autosave пакет. Возвращает: has_platform_index, has_platform_methods, configs[], autosave_available. Пример: data_status().", "operationId": "data_status", "tags": [ "MCP Tools" ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": {}, "required": [] } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object" } } } }, "400": { "description": "Bad request — missing required parameters" }, "500": { "description": "Internal server error" } } } }, "/tools/explain": { "post": { "summary": "explain", "description": "R1: Объяснить существующий код или найти использование. Если file_path — анализирует код (metrics, architecture). Если query — ищет где используется метод/объект. Пример: explain(file_path='/tmp/module.bsl'). Пример: explain(query='где используется ЗаписьЖурналаРегистрации').", "operationId": "explain", "tags": [ "MCP Tools" ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "file_path": { "type": "string", "description": "Optional parameter: file_path" }, "query": { "type": "string", "description": "Optional parameter: query" } }, "required": [] } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object" } } } }, "400": { "description": "Bad request — missing required parameters" }, "500": { "description": "Internal server error" } } } }, "/tools/gather": { "post": { "summary": "gather", "description": "R1: Собрать контекст для решения задачи (cached). Использует plan из session для source selection. Кэширует результат — повторный вызов возвращает кэш без повторного поиска. Включает safe_methods для target_context (pre-hoc guidance). Пример: gather(plan_id='uuid-from-plan', limit=5). force_refresh=true для принудительного пересбора.", "operationId": "gather", "tags": [ "MCP Tools" ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "plan_id": { "type": "string", "description": "Optional parameter: plan_id" }, "limit": { "type": "string", "description": "Optional parameter: limit" }, "force_refresh": { "type": "string", "description": "Optional parameter: force_refresh" } }, "required": [] } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object" } } } }, "400": { "description": "Bad request — missing required parameters" }, "500": { "description": "Internal server error" } } } }, "/tools/generate": { "post": { "summary": "generate", "description": "R1: Сгенерировать BSL код / запрос / DSL + inline validation. CR-1: BSL генерация через Ollama LLM с контекстом из session. CR-7: fix_violations_from — auto-fix с violations из validate(). Возвращает artifact_id для использования в validate(). Если validation_passed=false — вызовите validate(artifact_id). Пример: generate(task='запрос остатков', target_context='server', type='query'). Пример auto-fix: generate(task='...', fix_violations_from='artifact_1').", "operationId": "generate", "tags": [ "MCP Tools" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "task": { "type": "string", "description": "Required parameter: task" }, "target_context": { "type": "string", "description": "Optional parameter: target_context" }, "type": { "type": "string", "description": "Optional parameter: type" }, "fix_violations_from": { "type": "string", "description": "Optional parameter: fix_violations_from" } }, "required": [ "task" ] } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object" } } } }, "400": { "description": "Bad request — missing required parameters" }, "500": { "description": "Internal server error" } } } }, "/tools/plan": { "post": { "summary": "plan", "description": "R1: Классифицировать intent задачи и вернуть план действий. ВЫЗЫВАЙТЕ ПЕРВЫМ для любой задачи. Возвращает: intent, target_context_hint, required_sources, plan_id. Не собирает контекст — используйте gather(plan_id) для сбора. Пример: plan(query='создай справочник для учёта товаров', config='ut11').", "operationId": "plan", "tags": [ "MCP Tools" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "query": { "type": "string", "description": "Required parameter: query" }, "config": { "type": "string", "description": "Optional parameter: config" } }, "required": [ "query" ] } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object" } } } }, "400": { "description": "Bad request — missing required parameters" }, "500": { "description": "Internal server error" } } } }, "/tools/run_cli": { "post": { "summary": "run_cli", "description": "R10: Proxy для доступа к 44 hidden MCP tools через один visible tool. Позволяет вызывать call_graph, dsl_compile_*, cfe_*, skd_trace и др. Whitelist разрешённых команд — security. Пример: run_cli(command='call_graph', args={'config_name': 'ut11', 'action': 'stats'}). Без аргументов — возвращает список разрешённых команд.", "operationId": "run_cli", "tags": [ "MCP Tools" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "command": { "type": "string", "description": "Required parameter: command" }, "args": { "type": "string", "description": "Optional parameter: args" } }, "required": [ "command" ] } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object" } } } }, "400": { "description": "Bad request — missing required parameters" }, "500": { "description": "Internal server error" } } } }, "/tools/validate": { "post": { "summary": "validate", "description": "R1: Полная валидация кода. Если artifact_id — берёт код из session (state-aware). Если file_path — проверяет файл. Запускает solve_check (7-9 анализаторов) + check_bsl_context. Возвращает приоритизированный результат: must_fix, top_3_priority, grouped_violations. Пример: validate(artifact_id='artifact_1'). Пример: validate(file_path='/tmp/module.bsl', level='standard').", "operationId": "validate", "tags": [ "MCP Tools" ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "artifact_id": { "type": "string", "description": "Optional parameter: artifact_id" }, "file_path": { "type": "string", "description": "Optional parameter: file_path" }, "level": { "type": "string", "description": "Optional parameter: level" } }, "required": [] } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object" } } } }, "400": { "description": "Bad request — missing required parameters" }, "500": { "description": "Internal server error" } } } } }, "tags": [ { "name": "MCP Tools", "description": "All MCP tools for 1C AI Dev Environment" } ] }