project-context

Technical context for a VS Code extension that exposes 1C Platform Tools to AI agents through an MCP server. The extension communicates with the standalone server over IPC, while the server registers one agent tool for each available 1C command.

In plain words
What is it for?
Understanding the extension entry point, starting the standalone Node server, listing and executing 1C commands, passing port and token settings, and shortening tool names to meet platform limits.
Why use it?
It explains how the extension, MCP server, IPC connection, and tool names fit together. This helps developers change the project without overlooking its runtime dependencies.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/yellow-hammer/mcp-1c-platform-tools/project-context
Clone the repo
git clone --depth 1 https://github.com/yellow-hammer/mcp-1c-platform-tools

Made for: Cursor.

Per session 959 This file is loaded in full into every session.
When invoked 959 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00959 $0.00959
Opus 5 $0.00479 $0.00479
Sonnet 5 $0.00192 $0.00192
Haiku 4.5 $0.00096 $0.00096

Measured yesterday against content hash 8fbe97c06bb1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

project-context scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/project-context.mdc · 38 lines

How it starts

The opening of the file, as written. The whole thing — 38 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Контекст проекта

Расширение VS Code, которое предоставляет MCP-сервер (Model Context Protocol), чтобы агенты Cursor/VS Code могли вызывать команды 1c-platform-tools по IPC. Зависит от yellow-hammer.1c-platform-tools; расширение должно быть установлено, IPC включён (1c-platform-tools.ipc.enabled).

Архитектура

  • Точка входа: src/extension.ts регистрирует определение MCP-сервера и передаёт настройки IPC (порт, токен) через переменные окружения; процесс MCP запускает хост (Cursor/VS Code), выполняется out/index.js (Node).
  • MCP-сервер (standalone): src/index.ts — создаёт McpServer (версия из package.json), получает список команд расширения по IPC (listCommands()), регистрирует один инструмент на команду. Транспорт: stdio.
  • IPC-клиент: src/ipcClient.ts — TCP-клиент к IPC-серверу расширения (хост/порт из env или по умолчанию). Методы: listCommands(), executeCommand(commandId, args, projectPath).
  • Имена инструментов: src/toolName.tscommandIdToToolName(commandId) преобразует command ID расширения (например 1c-platform-tools.configuration.loadFromSrc) в имена MCP-инструментов с сокращениями так, чтобы суммарная длина «имя сервера + имя инструмента» не превышала 60 символов (ограничение платформы). Допустимые сокращения (1Cpt, 1cpt) и правило 60 символов — в .cursor/rules/naming-abbreviations.mdc.
  • Логирование: src/logger.ts — собственный LogOutputChannel расширения (канал «1C: Platform Tools MCP»; уровень, таймстемп и фильтрацию задаёт VS Code); src/loggerServer.ts — вывод в stderr для standalone-процесса MCP (уровень из env MCP_1C_LOG_LEVEL).
  • Иконка: resources/1c-icon.png — иконка расширения, указывается в package.json.

Динамическая регистрация инструментов

Инструменты не захардкожены. При старте MCP-сервер вызывает ipcClient.listCommands(), получает список command ID от расширения (IPC-метод listCommands). Для каждого ID регистрирует server.tool(toolName, baseParamsShape, handler). Имя инструмента вычисляется из commandId через commandIdToToolName(). Добавление новой команды в 1c-platform-tools (и её отдача в listCommands) автоматически добавляет новый MCP-инструмент; в mcp-1c-platform-tools менять ничего не нужно, кроме возможного обновления сокращений в toolName.ts при превышении лимита длины.

Read the full file on GitHub · 38 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 38 lines · 959 tokens per session scan A 8fbe97c06bb1

Subscribe to this mod's changes

project-context is a cursor rule published in the GitHub repository yellow-hammer/mcp-1c-platform-tools (35 stars, last pushed 13d ago), licensed MIT. It adds 959 tokens to every session, about $0.0048 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.