Borrowing it
Nothing to install: this file belongs to beixiyo/vsc-lsp-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/beixiyo/vsc-lsp-mcp/main/AGENTS.mdgit clone --depth 1 https://github.com/beixiyo/vsc-lsp-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/beixiyo/vsc-lsp-mcp/agents-md)<a href="https://agentmods.dev/instructions/beixiyo/vsc-lsp-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/beixiyo/vsc-lsp-mcp/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/beixiyo/vsc-lsp-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/beixiyo/vsc-lsp-mcp/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01652 | $0.01652 |
| Opus 5 | $0.00826 | $0.00826 |
| Sonnet 5 | $0.00330 | $0.00330 |
| Haiku 4.5 | $0.00165 | $0.00165 |
Grade A, and why
vsc-lsp-mcp AGENTS.md 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 9d ago.
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.
How it starts
The opening of the file, as written. The whole thing — 115 lines — stays where its author put it; the contents beside it link to each section on GitHub.
项目结构
src/index.ts:VS Code Extension Host 入口,构建为dist/index.jssrc/mcp/index.ts:当前 VS Code 窗口的启动编排,依次启动内部 Instance Server、确保共享 Broker 存在并注册 VS Code MCP providersrc/broker/main.ts:独立 Broker 子进程入口,构建为dist/broker.js,不属于 VS Code Extension Hostsrc/broker/:共享 MCP Broker,负责单实例锁、稳定外部端口、MCP session、实例发现和请求转发src/instance/:每个 VS Code 窗口的内部服务、实例注册表和路由规则src/mcp/:在当前 VS Code 窗口内执行的 MCP/LSP 操作与 VS Code MCP providersrc/protocol.ts:Broker 与内部 Instance Server 之间共享的请求类型和协议描述src/filePermissions.ts:注册表、状态文件和启动锁共用的私有文件权限常量src/lsp/:对 VS Code LSP 能力的封装,负责定义、引用、补全、重命名、调用层级等操作src/transform/:将 VS Code / LSP 返回结果转换成 JSON 或 Markdownsrc/utils/:通用工具,目前主要是日志输出l10n/:运行时代码字符串的本地化资源,配合vscode.l10n.t使用package.nls*.json:package.json中扩展描述、配置项等静态贡献点的本地化资源dist/:tsup构建产物,不手写维护
多实例架构
项目包含两个构建入口和两个独立进程:
VS Code Extension Host
src/index.ts -> src/mcp/index.ts
├─ 启动当前窗口的 Instance Server
├─ 将窗口信息写入共享注册表
├─ 复用或启动独立 Broker
└─ 注册 VS Code MCP provider
独立 Broker 进程
src/broker/main.ts -> src/broker/server.ts
├─ 对外提供单个 /mcp 地址
├─ 从注册表发现所有 VS Code 窗口
├─ 按 instanceId 或最长工作区路径前缀选择实例
└─ 将请求转发到目标窗口的内部 loopback 端点
src/index.ts是 VS Code 直接加载的唯一扩展入口,对应package.json的main: ./dist/index.jssrc/broker/main.ts由src/broker/ensure.ts通过独立 Node 子进程启动,不由 VS Code 直接加载tsup.config.ts必须同时产出dist/index.js和dist/broker.js- 外部 MCP 客户端只连接共享 Broker,不直接连接各窗口的内部端口
- Broker 使用固定外部端口;端口被占用时必须明确失败,不能回退到客户端未知的其他端口
- 每个窗口使用随机内部端口和随机 token,仅监听
127.0.0.1 - Broker 生命周期必须与任意单个 VS Code 窗口解耦,关闭首个窗口不能导致其他窗口断线
- 多实例首版只承诺本机桌面
file:工作区,不要未经设计直接宣称支持 Remote SSH、WSL、Dev Container 或虚拟工作区
推荐阅读顺序
理解启动与请求链路时按以下顺序阅读,不要从工具实现或注册表细节开始:
src/index.tssrc/mcp/index.tssrc/instance/server.tssrc/broker/ensure.tssrc/broker/main.tssrc/broker/server.tssrc/broker/tools.tssrc/instance/router.tssrc/instance/registry.ts
请求链路为:外部 MCP 客户端 -> 共享 Broker -> 实例路由 -> 目标 VS Code Instance Server -> LSP/Workspace 操作 -> Broker 原样返回结果
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.
- 9d ago First seen · 115 lines · 1,652 tokens per session scan A 6314d7902bdd
vsc-lsp-mcp AGENTS.md is an instructions file published in the GitHub repository beixiyo/vsc-lsp-mcp (40 stars, last pushed 1mo ago), licensed MIT. It adds 1,652 tokens to every session, about $0.0083 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.
Other instructions, from other repositories
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.