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.
npx agentmods add instructions/shiningsugar35/mcp-devbridge/agents-mdgit clone --depth 1 https://github.com/ShiningSugar35/mcp-devbridgeWrote 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/shiningsugar35/mcp-devbridge/agents-md)<a href="https://agentmods.dev/instructions/shiningsugar35/mcp-devbridge/agents-md"><img src="https://agentmods.dev/badge/instructions/shiningsugar35/mcp-devbridge/agents-md.svg" alt="Measured on agentmods" 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 | $0.10497 | $0.10497 |
| Opus 5 | $0.05248 | $0.05248 |
| Sonnet 5 | $0.02099 | $0.02099 |
| Haiku 4.5 | $0.01050 | $0.01050 |
Grade C, and why
mcp-devbridge AGENTS.md scanned grade C with 1 finding 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 4d 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.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
`rm -rf /`、`del /s C:`、`Remove-Item -Recurse C:\Windows` 等递归删盘/系统目录命令。 How it starts
The opening of the file, as written. The whole thing — 372 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md — 项目引导
本项目为多角色开发。请 AI(各类 agent,包括 opencode/Claude/Copilot)以及参与开发的工程师阅读本文件。
一、先读什么(上下文受限时的速览路径)
当上下文被压缩后,按以下顺序阅读以快速恢复项目知识:
- AGENTS.md(本文件) — 快速定位与约定
- 项目架构.md — 代码结构、模块职责、数据流、关键实现细节
- 开发计划.md — 完整开发计划 + 每个 Phase 的验收标准
- 进度验收.md — 当前开发进度、已完成 Phase、遗留事项(写操作前必须读)
若本文件与上述任一文档冲突,以 项目架构.md 为准并同步修 AGENTS.md。
二、项目一句话
MCP DevBridge(原 LocalDev MCP Bridge):一款 Windows / Linux(含 SteamOS Desktop Mode)桌面程序(PySide6 单窗口),让用户在桌面选定一个本地开发项目, 一键启动独立的 MCP Server 子进程(仅监听 127.0.0.1),并通过 Cloudflare Named Tunnel 提供一个 长期固定、永不变化的 HTTPS MCP 地址,供 ChatGPT / Gemini 等支持自定义 MCP 的客户端接入。
三、开发约定(必须遵守)
- 不修改外部项目:禁止修改
D:\AStockMultiAgent及其它非本项目的目录(测试一律写在.test-workspace)。 - 不删除原型与旧的
.venv:D:\Environment\mcp\backups-prototype\dev-mcp.py为原型备份;D:\Environment\mcp\.venv保留。 - 合并/文档优先:任何“并发/压缩上下文”场景,先写 进度验收.md 再继续开发。
- 认证与 URL 分离:公开 MCP URL 必须固定(Named Tunnel),令牌(Bearer)由用户在客户端单独配置,绝不允许把随机密钥拼进 URL。
- 本机匿名放行:仅允许 127.0.0.1 / ::1 / localhost 的本地连接匿名访问
/mcp;/control/*一律要求 Bearer。 - 公网必须 Bearer:经 Cloudflare 转发(Host 为公网域名)的请求必须携带有效 Bearer;
默认 MCP SDK 2.0.0 的
streamable_http_app()会自动加 DNS rebinding 防护,只放行 localhost, 公网隧道接入时需显式禁用/调整 rebinding(见 项目架构.md「安全模型」)。 - 桌面默认完全访问:桌面新项目默认
system + full_system(“完全访问(危险)”);不做逐次写操作确认,但第一次实际启动完全访问模式仍需要一次性风险确认。后端/CLI 的兼容默认值不等同于桌面产品默认值。 - 不泄漏密钥:日志必须脱敏(文件名/参数含 KEY/TOKEN/SECRET/PASSWORD/COOKIE/AUTH 时整值遮罩)。
四、环境与依赖(复现命令)
# 进入项目
cd D:\Environment\mcp\mcp-devBridge
# 创建 venv(Windows)并安装开发依赖
python -m venv .venv
.venv\Scripts\activate
uv pip install -e ".[dev,package]"
# 测试(必须在项目根执行,保证导入路径)
PYTHONIOENCODING=utf-8 .venv\Scripts\python.exe -m pytest tests/ -q
# 运行后端命令入口
.venv\Scripts\python.exe -m local_dev_mcp_bridge.standalone_server # 单一入口(CLI 简化)
.venv\Scripts\python.exe -m local_dev_mcp_bridge.server_main --config ... # 子进程后端入口(正式路径)
已锁定:Python 3.12.10、mcp==2.0.0、pydantic 2.13.4、starlette 1.4.1、uvicorn 0.52.1、PySide6 6.11.1、pytest 9.1.1、pywin32 312。
Windows-MCP 版本锁定在 `engines.py` 的 `WINDOWS_MCP_PINNED_VERSION`(当前 `0.8.2`,
`uvx --from windows-mcp==0.8.2 windows-mcp serve`);升级必须先实测兼容再人工改常量。
(其余依赖见 `pyproject.toml`)
## 五、目录结构
mcp-devBridge/
├── pyproject.toml # 包定义、脚本入口、ruff/pyright/pytest 配置
├── README.md # 一句话 + 文档索引
├── AGENTS.md # ← 本文件
├── 项目架构.md # 架构说明
├── 开发计划.md # 计划 + 验收
├── 进度验收.md # 进度
├── src/
│ └── local_dev_mcp_bridge/
│ ├── init.py # version、APP_NAME、APP_IDENT
│ ├── constants.py # 目录/默认值/错误码常量;配置目录 default %LOCALAPPDATA%\LocalDevMCPBridge(LOCALDEV_MCP_CONFIG_DIR 可覆盖)
│ ├── models.py # ProjectConfig / AppConfig / RuntimeConfig / TunnelState(pydantic)
│ ├── config_store.py # 读/写这些 JSON;功能探测;命令建议
│ ├── secrets.py # Bearer 令牌(Win CredManager + DPAPI 回退文件 secrets.dpapi.json)
│ ├── audit.py # 审计日志 + 密钥脱敏
│ ├── agent_pool.py # v0.9 本地并发 Agent 池:OpenCode/Claude Code + worktree + bounded queue
│ ├── agent_runtime.py # v0.10 Persistent Runtime:TaskState/checkpoint/validator/retry/restart resume
│ ├── agent_orchestrator.py # logical Agent/Team 与 Runtime/Pool 接线
│ ├── agent_gateway.py # Agent MCP 参数规范化与本机分派
│ ├── shell.py # PowerShell 命令执行、进程树终止、环境探测
│ ├── processes.py # 受管进程注册(dev server 等)
│ ├── permissions.py # 权限:read_only / workspace / system
│ ├── execution_profile.py # Shell 执行档位:safe / developer(默认)/ full_system + 危险命令拦截
│ ├── project_manager.py # 多项目:ProjectUnit(每项目引擎对)+ ProjectManager(编目/独立端口/生命周期;enabled 仅兼容旧配置)
│ ├── tools.py # 37 个 MCP 工具实现(含 list_projects / switch_workspace / shell_info / shell_self_test)
│ ├── server_factory.py # MCPServer + Starlette app + 认证/审计/限速中间件
│ ├── server_main.py # 后端 CLI(--config / --port),被桌面进程拉起
│ ├── standalone_server.py# 简化 CLI 单进程入口
│ ├── selftest.py # 本地 MCP 客户端自测(桌面“测试连接”按钮)
│ ├── engines.py # 引擎进程管理:CodexProManager / WindowsBridgeManager / 脱敏 / 就绪检测
│ ├── tunnel_manager.py # 隧道进程:Cloudflare Named / Quick / ngrok / 仅本机;固定 URL 解析
│ ├── oauth_provider.py # Phase 8 OAuth:LocalOAuthProvider(SDK Provider 实现,单 scope / code / refresh 轮换)
│ ├── gateway.py # Phase 8 OAuth 网关:uvicorn 8786,OAuth 路由 + 同意页 + /mcp 反向代理
│ ├── app_state.py # 服务协调状态机 ServiceCoordinator(顺序、URL 固定性、故障清理;无 Qt)
│ ├── backend_manager.py # 后端子进程管理 /health 轮询(已归档,桌面改走 ServiceCoordinator)
│ └── desktop_main.py # Phase 3 桌面 UI(PySide6 单窗口,已接线 ServiceCoordinator)
├── tests/ # pytest 测试(Phase 12 当前 304 项全绿,以实际 pytest 输出为准)
│ ├── conftest.py
│ ├── test_fs.py · test_commands.py · test_git.py · test_config.py
│ ├── test_mcp_integration.py · test_selftest.py
│ ├── test_engines.py · test_tunnel_manager.py · test_app_state.py
│ ├── test_oauth.py # OAuth 2.1 发现/注册/PKCE/刷新/撤销/网关代理(27 项)
│ ├── test_project_manager.py # 多项目:编目/端口唯一/并行启停/自动恢复/真机双引擎
│ └── test_workspace_switch.py# 会话级 switch_workspace 隔离 + shell_info
├── .test-workspace/ # 测试用临时工作区
└── .tools/ # cloudflared.exe(2026.7.3)等二进制
## 六、常用命令(结果为准)
部分命令必须在 PowerShell 下运行(`$env:PYTHONIOENCODING="utf-8"`),否则 GBK 编码报错。
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.
- 4d ago First seen · 372 lines · 10,497 tokens per session scan C df6b8d4c93a4
mcp-devbridge AGENTS.md is an instructions file published in the GitHub repository ShiningSugar35/mcp-devbridge (0 stars, last pushed 2d ago), licensed MIT. It adds 10,497 tokens to every session, about $0.0525 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
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).
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.
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 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.
deepseek-harness AGENTS.md
AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-release stance: foundation over blast radius, repository layout, commands and host sandbox failures.