mcp-zero-config-detection

mcp-zero-config-detection is a cursor rule for coding agents from Mr-chen-05/rules-2.1-optimized. It costs 3,132 tokens per session, scanned A, original, MIT.

Rules for detecting whether an MCP configuration is missing. MCP is a way for coding agents to connect to external tools and services.

In plain words
What is it for?
Checking MCP setup at the start of relevant tasks, during file or code work, and for GitHub or project-memory operations, with cached results lasting up to one hour unless a fresh check is requested.
Why use it?
They tell the agent when to check configuration, when to reuse a recent result, and how to avoid repeated scans.

Cursor rule

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/mr-chen-05/rules-2.1-optimized/mcp-zero-config-detection
Clone the repo
git clone --depth 1 https://github.com/Mr-chen-05/rules-2.1-optimized

Wrote 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.

agentmods badge for mcp-zero-config-detection

README.md
[![agentmods](https://agentmods.dev/badge/rules/mr-chen-05/rules-2.1-optimized/mcp-zero-config-detection.svg)](https://agentmods.dev/rules/mr-chen-05/rules-2.1-optimized/mcp-zero-config-detection)
Your own site
<a href="https://agentmods.dev/rules/mr-chen-05/rules-2.1-optimized/mcp-zero-config-detection"><img src="https://agentmods.dev/badge/rules/mr-chen-05/rules-2.1-optimized/mcp-zero-config-detection.svg" alt="Measured on agentmods" height="20"></a>
Per session 3,132 This file is loaded in full into every session.
When invoked 3,132 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.03132 $0.03132
Opus 5 $0.01566 $0.01566
Sonnet 5 $0.00626 $0.00626
Haiku 4.5 $0.00313 $0.00313

Measured 5d ago against content hash 64e888d5ed38, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mcp-zero-config-detection 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 5d 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.

project-rules/mcp-zero-config-detection.mdc · 303 lines

How it starts

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

🔍 MCP零配置检测和提醒策略

主动关怀: 检测用户MCP配置状态,在缺少配置时主动提醒和引导

🎯 检测触发条件

自动检测时机

触发场景:
  任务开始时: 每次接收用户任务时自动检测
  文件操作时: 需要文件系统操作时检测
  代码分析时: 需要代码检索时检测
  项目管理时: 涉及项目记忆时检测
  GitHub操作时: 需要Git协作时检测
  跳过与复用条件:
    系统级启动: 在“启动超级大脑系统”等系统激活阶段不主动触发零配置检测,由系统激活流程统一协调
    最近检测复用: 若最近3600秒内已有检测结果或存在"检测响应"/"MCP平台报告",则复用结果并跳过重复检测
    用户覆盖: 若用户明确要求“重新检测”,则执行检测并更新结果缓存

缓存复用

缓存策略:
  缓存文件位置: 项目根目录/.cache/mcp-status-cache.json
  缓存时间: 默认3600秒(1小时)
  记录内容: 检测时间戳、检测来源、结果摘要
  记录项:
    - 最近检测时间戳
    - 检测来源(mcp-unified-management / zero-config / 其他)
    - 检测结果摘要
  一句话总结:
    - 默认1小时内复用上一次检测结果;超过1小时或你说"重新检测"会重跑;也可以执行 -Action clearCache 手动清空缓存。
  复用策略:
    - 在缓存有效期(≤3600秒)内直接复用检测结果
    - 如 project.context.md 或会话上下文存在“MCP平台报告/检测响应”,优先读取并复用
    - 用户显式“重新检测”时刷新缓存并重新执行检测
  注意:
    - 缓存仅用于避免短时重复扫描;长期变更需强制检测

检测逻辑

检测步骤:
  1. 智能脚本检测:
     - 默认路径(install-ultra.bat生成):mcp-tools/mcp-cross-platform-sync.ps1
     - 兼容路径(新结构):mcp-scripts/mcp-cross-platform-sync.ps1
     - 如果脚本存在,自动执行获取详细配置信息
     - 调用参数: 默认 -Action detect -CacheTTLSeconds 3600;用户明确"重新检测"时添加 -Force
     - 清理缓存: 支持 -Action clearCache 手动清理检测缓存文件(用于极端或调试场景)
     - 解析脚本输出,获得完整的跨平台MCP状态
  
  2. 基础路径扫描:
     # 主流AI编辑器
     - %USERPROFILE%\.claude\mcp_settings.json
     - %USERPROFILE%\AppData\Roaming\Trae\User\mcp.json
     - %USERPROFILE%\AppData\Roaming\Trae CN\User\mcp.json
     - %USERPROFILE%\AppData\Roaming\Cursor\User\globalStorage\cursor.mcp\mcp_settings.json
     
     # 2024-2025年热门AI工具
     - %USERPROFILE%\AppData\Roaming\Windsurf\User\mcp.json
     - %USERPROFILE%\.replit\mcp_config.json
     - %USERPROFILE%\AppData\Roaming\Code\User\globalStorage\sourcegraph.cody-ai\mcp_settings.json
     - %USERPROFILE%\.continue\mcpServers\mcp.json
     
     # IDE集成AI助手
     - %USERPROFILE%\AppData\Roaming\Code\User\mcp.json
     - %USERPROFILE%\.jetbrains\mcp_config.json
     - %USERPROFILE%\AppData\Roaming\TabNine\mcp_config.json
     
     # 云端AI平台
     - %USERPROFILE%\AppData\Roaming\AmazonQ\settings.json
     - %USERPROFILE%\.google\gemini-code-assist\mcp.json
     - %USERPROFILE%\AppData\Roaming\CodeBuddy\mcp_settings.json
     
     # 开源AI工具
     - %USERPROFILE%\.aider\mcp_config.json
     - %USERPROFILE%\.codegeex\mcp_settings.json
     - %USERPROFILE%\.tabby\mcp_config.json
     - %USERPROFILE%\AppData\Roaming\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
  
  3. 配置完整性分析:
     - 配置文件是否存在
     - 是否包含基础MCP服务器
     - 服务器配置是否有效
     - 跨平台配置一致性
  
  4. 功能缺失评估:
     - 缺少文件系统工具
     - 缺少记忆系统
     - 缺少代码检索能力
     - 缺少GitHub集成
     - 跨平台配置差异

Read the full file on GitHub · 303 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. 5d ago First seen · 303 lines · 3,132 tokens per session scan A 64e888d5ed38

Subscribe to this mod's changes

mcp-zero-config-detection is a cursor rule published in the GitHub repository Mr-chen-05/rules-2.1-optimized (172 stars, last pushed 10mo ago), licensed MIT. It adds 3,132 tokens to every session, about $0.0157 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.