MCP-сервер расширения 1C: Platform Tools для AI-агентов VS Code и Cursor: тесты, сборка, профили запуска и работа с базой в проектах конфигуратора, 1С:EDT и OneScript.
接入配置
选择客户端,复制配置,再按项目文档补齐环境变量。
claude mcp add 1c-platform-tools --env ONEC_IPC_PORT='<ONEC_IPC_PORT>' --env ONEC_IPC_TOKEN='<ONEC_IPC_TOKEN>' -- npx -y mcp-1c-platform-tools~/.codex/config.toml
[mcp_servers.1c-platform-tools]
command = "npx"
args = ["-y", "mcp-1c-platform-tools"]
env = { ONEC_IPC_PORT = "<ONEC_IPC_PORT>", ONEC_IPC_TOKEN = "<ONEC_IPC_TOKEN>" }
# codex mcp add 1c-platform-tools --env ONEC_IPC_PORT='<ONEC_IPC_PORT>' --env ONEC_IPC_TOKEN='<ONEC_IPC_TOKEN>' -- npx -y mcp-1c-platform-tools~/.cursor/mcp.json
{
"mcpServers": {
"1c-platform-tools": {
"command": "npx",
"args": [
"-y",
"mcp-1c-platform-tools"
],
"env": {
"ONEC_IPC_PORT": "<ONEC_IPC_PORT>",
"ONEC_IPC_TOKEN": "<ONEC_IPC_TOKEN>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"1c-platform-tools": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mcp-1c-platform-tools"
],
"env": {
"ONEC_IPC_PORT": "<ONEC_IPC_PORT>",
"ONEC_IPC_TOKEN": "<ONEC_IPC_TOKEN>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"1c-platform-tools": {
"command": "npx",
"args": [
"-y",
"mcp-1c-platform-tools"
],
"env": {
"ONEC_IPC_PORT": "<ONEC_IPC_PORT>",
"ONEC_IPC_TOKEN": "<ONEC_IPC_TOKEN>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"1c-platform-tools": {
"command": "npx",
"args": [
"-y",
"mcp-1c-platform-tools"
],
"env": {
"ONEC_IPC_PORT": "<ONEC_IPC_PORT>",
"ONEC_IPC_TOKEN": "<ONEC_IPC_TOKEN>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"1c-platform-tools": {
"command": "npx",
"args": [
"-y",
"mcp-1c-platform-tools"
],
"env": {
"ONEC_IPC_PORT": "<ONEC_IPC_PORT>",
"ONEC_IPC_TOKEN": "<ONEC_IPC_TOKEN>"
}
}
}
}需要的环境变量
ONEC_IPC_PORTONEC_IPC_TOKEN
把占位值换成你自己的密钥;不要把密钥提交到代码仓库。