mcp

Configuration guidance for MCP, a protocol that lets coding agents connect to external tools and services. It covers server settings, filesystem access, and a memory bank.

In plain words
What is it for?
Setting up MCP servers with version information, working directories, permissions, disabled states, audit logging, and memory-bank backups.
Why use it?
It provides a standard configuration structure and limits which project folders an MCP filesystem server may read or write, while blocking sensitive paths.

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/bestcarly/opc-coding-guide/mcp
Clone the repo
git clone --depth 1 https://github.com/bestcarly/opc-coding-guide
Per session 1,663 This file is loaded in full into every session.
When invoked 1,663 The same file — it is already loaded in full.
Security scan B 1 finding. 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.01663 $0.01663
Opus 5 $0.00831 $0.00831
Sonnet 5 $0.00333 $0.00333
Haiku 4.5 $0.00166 $0.00166

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

Security

Grade B, and why

mcp scanned grade B 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 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.

Reads MCP configurationmediumAgent snooping

mcp.json carries server URLs and auth tokens; reading it lets a mod discover and abuse other integrations.

cat mcp.json | jq '.mcpServers[].permissions'
skills/cursor-rules/mcp.mdc · 291 lines

How it starts

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

MCP 配置规则(2026 年版)

补充人:墨铃 (Mori)
补充日期:2026-02-28
参考章节:第十二章


MCP 服务器配置原则

  • 使用最新版 MCP 服务器(协议版本 2025-11)
  • 配置最小权限原则
  • 启用审计日志
  • 定期更新服务器版本

基础配置结构

{
  "$schema": "https://modelcontextprotocol.io/schema/mcp-config.json",
  "version": "2025-11",
  "mcpServers": {
    "[server-name]": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-[name]@latest"],
      "cwd": "${workspaceFolder}",
      "env": {},
      "permissions": {},
      "disabled": false
    }
  }
}

Filesystem MCP 配置

{
  "filesystem": {
    "command": "npx",
    "args": ["-y", "@modelcontextprotocol/server-filesystem@latest"],
    "cwd": "${workspaceFolder}",
    "permissions": {
      "read": ["./src", "./docs", "./tests"],
      "write": ["./src"],
      "deny": ["./.env", "./config/secrets", "./node_modules"]
    }
  }
}

权限说明

  • read:允许读取的目录
  • write:允许写入的目录
  • deny:禁止访问的目录(优先级最高)

Memory Bank MCP 配置

{
  "memory-bank": {
    "command": "npx",
    "args": ["-y", "@modelcontextprotocol/server-memory-bank@latest"],
    "cwd": "${workspaceFolder}",
    "config": {
      "autoUpdate": true,
      "backupEnabled": true,
      "backupInterval": "24h",
      "backupLocation": "./.backups/memory-bank",
      "files": {
        "product-requirements.md": { "autoUpdate": true },
        "architecture.md": { "autoUpdate": true },
        "progress.md": { "autoUpdate": true },
        "decisions.md": { "autoUpdate": true },
        "learnings.md": { "autoUpdate": true }
      }
    }
  }
}

配置说明

  • autoUpdate:AI 完成任务后自动更新 Memory Bank
  • backupEnabled:启用自动备份
  • backupInterval:备份间隔(支持 hdw

GitHub MCP 配置

{
  "github": {
    "command": "npx",
    "args": ["-y", "@modelcontextprotocol/server-github@latest"],
    "env": {
      "GITHUB_TOKEN": "${GITHUB_TOKEN}"
    },
    "permissions": {
      "repos": ["read"],
      "pullRequests": ["read", "write"],
      "issues": ["read", "write"],
      "actions": ["read"]
    }
  }
}

Read the full file on GitHub · 291 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 · 291 lines · 1,663 tokens per session scan B 11ed8a674a06

Subscribe to this mod's changes

mcp is a cursor rule published in the GitHub repository bestcarly/opc-coding-guide (7 stars, last pushed 5mo ago), licensed MIT. It adds 1,663 tokens to every session, about $0.0083 per session on Opus 5. A static security scan graded it B with 1 finding (reads mcp configuration). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.