fastmcp: Instructions file for Codex

AGENTS.md

fastmcp AGENTS.md is an instructions file for Codex, OpenCode from PrefectHQ/fastmcp. It costs 4,339 tokens per session, scanned A, a copy of skills AGENTS.md, Apache-2.0.

Repository instructions for FastMCP, a Python framework for building MCP servers and clients.

In plain words
What is it for?
Use them when changing, testing, or reviewing the FastMCP codebase.
Why use it?
They give a coding agent project-specific rules for working in FastMCP rather than only general Python advice.

Instructions file for CodexOpenCode

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

This is PrefectHQ/fastmcp's own configuration. It tells Codex and OpenCode how to work on fastmcp 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 fastmcp configures →

About the project

FastMCP is a Python framework for building Model Context Protocol applications, which connect language models with tools and data through servers and clients. Developers use it to expose Python functions as tools, connect to local or remote MCP servers, and build interactive tool interfaces. The catalogue includes eight skills, three instructions, two rules, one setting, and one hook for FastMCP.

PrefectHQ/fastmcp · 28,322 stars · on GitHub · gofastmcp.com

Reuse

Borrowing it

Nothing to install: this file belongs to PrefectHQ/fastmcp. 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/PrefectHQ/fastmcp/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/PrefectHQ/fastmcp

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/prefecthq/fastmcp/agents-md"><img src="https://agentmods.dev/badge/instructions/prefecthq/fastmcp/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4,339 This file is loaded in full into every session.
When invoked 4,339 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod 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.04339 $0.04339
Opus 5.5 $0.01736 $0.01736
Sonnet 5.5 $0.00868 $0.00868
Haiku 4.5 $0.00434 $0.00434

Measured today against content hash cd73d57f1abb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

fastmcp 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 today.

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.

Origin

This is a copy

100% identical to skills AGENTS.md — 225 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

AGENTS.md · 224 lines

How it starts

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

FastMCP Development Guidelines

Audience: LLM-driven engineering agents and human developers

FastMCP is a comprehensive Python framework (Python ≥3.10) for building Model Context Protocol (MCP) servers and clients.

Required Development Workflow

Install dependencies before running local checks:

uv sync                              # Install dependencies

Run the tests relevant to the behavior you changed, including neighboring paths that share the implementation. For example:

uv run pytest tests/skills tests/utilities/test_skills.py -n 0

Broaden the selection when a concrete dependency or failure warrants it and the check is expedient. Full-suite and platform-matrix testing belong in CI; do not run the full suite locally by default or repeat it for each commit or PR in a stack. Run it locally only when explicitly requested or when investigating a failure that requires it.

In addition, you must pass static checks. These generally run as pre-commit hooks with prek. To check changed files before committing:

uv run prek run --files path/to/changed_file.py

For repository-wide configuration changes, run:

uv run prek run --all-files          # Ruff + Prettier + ty + gitleaks

The gitleaks hook needs the gitleaks binary on PATH (brew install gitleaks, or see gitleaks releases) — it isn't a uv-managed dependency, so uv sync alone won't provide it.

Relevant tests and applicable static checks must pass before committing.

Repository Structure

Path Purpose
fastmcp_slim/fastmcp/ Library source code
├─server/ Server implementation
│ ├─auth/ Authentication providers
│ └─middleware/ Error handling, logging, rate limiting
├─client/ Client SDK
│ └─auth/ Client authentication
├─tools/ Tool definitions
├─resources/ Resources and resource templates
├─prompts/ Prompt templates
├─cli/ CLI commands
└─utilities/ Shared utilities
tests/ Pytest suite
docs/ Mintlify docs (gofastmcp.com)

Read the full file on GitHub · 224 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. today Changed · +44 tokens per session cd73d57f1abb
  2. 6d ago Changed · +1 lines · +20 tokens per session 4c381465a7fb
  3. 9d ago Changed · +19 lines · +177 tokens per session dab6031dccaa
  4. 18d ago Changed · -15 tokens per session 1f434b84cec9
  5. 1mo ago Changed · +2 lines · +69 tokens per session 7bf0943d1be6
  6. 1mo ago Changed · +4 lines · +353 tokens per session 85aa5a141135
  7. 1mo ago Changed · +5 lines · +162 tokens per session ee1bafd0f167
  8. 1mo ago Changed · +192 lines · +3,525 tokens per session f939f33f94b3
  9. 2mo ago First seen · 1 lines · 4 tokens per session scan A 6ebdb617a810

Subscribe to this mod's changes

fastmcp AGENTS.md is an instructions file published in the GitHub repository PrefectHQ/fastmcp (28,322 stars, last pushed today), licensed Apache-2.0. It adds 4,339 tokens to every session, about $0.0174 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to skills AGENTS.md, differing in 225 lines, and is treated as a copy.

Related

fastmcp AGENTS.md compared with instructions from other repositories

fastmcp AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
fastmcp AGENTS.mdPrefectHQ/fastmcpInstructions file28ktodayApache-2.0A4,339Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode