mcp-server: Instructions file for Codex

AGENTS.md

mcp-server AGENTS.md is an instructions file for Codex, OpenCode from NateYeh/mcp-server. It costs 2,395 tokens per session, scanned A, original, MIT.

Project instructions for an MCP server built with FastAPI, a Python web framework, that exposes a shell-command tool to AI clients. It documents the project structure, authentication, and security model.

In plain words
What is it for?
Understanding the server layout, its bearer-token login, its MCP endpoint, and the limits around executing Linux shell commands.
Why use it?
It gives an agent the rules and background needed to change the server without overlooking how access and command execution work.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions Claude Code; mentions AGENTS.md.

This is NateYeh/mcp-server's own configuration. It tells Codex and OpenCode how to work on mcp-server itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mcp-server configures →

Reuse

Borrowing it

Nothing to install: this file belongs to NateYeh/mcp-server. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/NateYeh/mcp-server/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/NateYeh/mcp-server

Made for: Codex, OpenCode.

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-server AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/nateyeh/mcp-server/agents-md/github.svg)](https://agentmods.dev/instructions/nateyeh/mcp-server/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/nateyeh/mcp-server/agents-md"><img src="https://agentmods.dev/badge/instructions/nateyeh/mcp-server/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.

agentmods 80×15 button for mcp-server AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/nateyeh/mcp-server/agents-md"><img src="https://agentmods.dev/badge/instructions/nateyeh/mcp-server/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,395 This file is loaded in full into every session.
When invoked 2,395 The same file — it is already loaded in full.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.02395 $0.02395
Opus 5.5 $0.00958 $0.00958
Sonnet 5.5 $0.00479 $0.00479
Haiku 4.5 $0.00239 $0.00239

Measured 5d ago against content hash 1c610d5e68ac, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

mcp-server AGENTS.md scanned grade A 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 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -X POST http://127.0.0.1:30096/mcp \
AGENTS.md · 146 lines

How it starts

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

AGENTS.md — mcp-server 專案指南

本檔案供 AI 與開發者快速進入狀況。詳細設計說明見 docs/ARCHITECTURE.md。

專案概述

MCP (Model Context Protocol) Server:以 FastAPI 提供 /mcp HTTP 端點,讓 LLM 客戶端 (如 Claude Code、Claude Desktop)能呼叫本機工具。目前僅提供 execute_shell(Linux Shell 命令執行)。 客戶端連接方式(Claude Code 原生 HTTP;Claude Desktop 需 mcp-remote 橋接)詳見 README 第 4 節。

  • 版本:4.0.0
  • Python:>= 3.10
  • 執行方式:本地直接執行(無容器化部署)
  • 認證:單一 AUTH_KEY(Bearer Token)

目錄結構

mcp-server/
├── src/mcp_server/
│   ├── __main__.py            # 入口:日誌初始化、顯示 AUTH_KEY、啟動 uvicorn
│   ├── app.py                 # FastAPI 應用、/mcp 路由、MCP 協議分發
│   ├── config.py              # 全域配置(AUTH_KEY、路徑、伺服器、執行限制)
│   ├── security.py            # Bearer Token 驗證(hmac.compare_digest)
│   ├── schemas.py             # MCPError(協議層錯誤)
│   ├── utils.py               # format_tool_result()(ExecutionResult → MCP 回應)
│   ├── base/
│   │   └── logging_config.py  # 統一日誌(console 彩色 + RotatingFileHandler)
│   ├── tools/
│   │   ├── __init__.py        # 動態掃描目錄、自動註冊所有工具
│   │   ├── base.py            # ToolRegistry 單例與 @registry.register
│   │   ├── schemas.py         # ExecutionResult(工具回傳格式)
│   │   └── execute_shell/     # 目前唯一的工具
│   └── start.sh               # 啟動腳本(安裝 mcp_server 後執行 python -m mcp_server)
├── docs/
│   ├── ARCHITECTURE.md        # 詳細架構與開發範式
│   └── SELF_HEALING_MEMO.md   # 故障排除備忘錄
├── .env.example               # 環境變數範本
├── pyproject.toml             # 套件依賴與工具設定(ruff / pyright);版本號唯一來源
└── workspace/                 # 執行工作目錄(服務啟動時建立並清空,不進版控)

認證機制

  • 金鑰來源:環境變數 AUTH_KEY。
  • 未設定時:config.py 以 secrets.token_urlsafe(32) 隨機產生,僅存在於記憶體, __main__.py 會於啟動時在 console 顯示;重啟即變更。
  • 客戶端必須帶:Authorization: Bearer <AUTH_KEY>。
    • 缺少或格式錯誤 → 401
    • 金鑰不符 → 403
  • 驗證邏輯在 security.py 的 verify_api_key(),使用 hmac.compare_digest 常數時間比較。
  • 失敗次數限制:同一來源 IP 於 60 秒內失敗達 10 次即回 429(Retry-After: 60),避免暴力嘗試。
  • 已移除多金鑰(MCP_API_KEYS)、Tool 權限白名單/排除清單與 Gmail 帳號綁定機制。

安全模型

  • 唯一的存取控制是 AUTH_KEY(加上監聽位址)。本服務的設計目的就是執行任意 shell, 因此不提供命令黑名單——子字串黑名單容易被引號、變數、$IFS 等方式繞過,只會給人錯誤的安全感。
  • 因此:AUTH_KEY 等同於機器上的 shell 權限,務必只使用於可信任網段(建議 MCP_HOST=127.0.0.1), 且不得寫進版控。
  • 日誌不記錄金鑰本身(Authorization 格式錯誤時僅記錄 scheme)。

Read the full file on GitHub · 146 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 Changed 1c610d5e68ac
  2. 10d ago First seen · 146 lines · 2,395 tokens per session scan A d45df933a5fd

Subscribe to this mod's changes

mcp-server AGENTS.md is an instructions file published in the GitHub repository NateYeh/mcp-server (0 stars, last pushed 6d ago), licensed MIT. It adds 2,395 tokens to every session, about $0.0096 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-07.

Related

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

microsoft/vscode · 9,649 tokens

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.

vercel/next.js · 7,257 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

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.

langchain-ai/langchain · 4,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 4,159 tokens