Skip to content

docs: modernize development guidelines and rename to AGENTS.md#2413

Open
maxisbey wants to merge 6 commits intomainfrom
docs/modernize-agents-md
Open

docs: modernize development guidelines and rename to AGENTS.md#2413
maxisbey wants to merge 6 commits intomainfrom
docs/modernize-agents-md

Conversation

@maxisbey
Copy link
Copy Markdown
Contributor

@maxisbey maxisbey commented Apr 9, 2026

Modernizes the development guidelines (was 174 lines, now 132) and renames CLAUDE.md to AGENTS.md to align with the rest of the modelcontextprotocol org.

Motivation and Context

The existing CLAUDE.md had accumulated guidance that was outdated, factually wrong (line length stated as 88, pre-commit instructions referenced a ruff rev that doesn't exist), or generic enough to add no value ("functions must be focused and small", "test thoroughly"). At the same time it was missing project-specific context that causes recurring review churn, most notably the V2 branching model and the policy on coverage pragmas.

Separately, most repos in this org (modelcontextprotocol, kotlin-sdk, ruby-sdk, go-sdk, inspector) have already moved to AGENTS.md as the canonical, tool-agnostic guidelines file per the agents.md convention. python-sdk and typescript-sdk were the remaining outliers.

Removed

  • "Error Resolution" section (generic CI/type-checking advice)
  • Ruff "Critical issues" and "Line wrapping" sub-lists (ruff format handles these; "88 chars" was wrong)
  • Pre-commit "Ruff updates: update config rev" (ruff runs via repo: local, there is no rev)
  • Reported-by: / Github-Issue:# commit trailers (not used in practice)
  • Generic Code Quality bullets and the duplicated Pull Requests prose

Added

  • Branching Model: main is currently the V2 rework (no @deprecated shims), v1.x is the release line, README.md is frozen
  • Dependency floor policy (refs Upgrade h11 due to vulnerability Kludex/uvicorn#2643, mitigate CVE-2025-62727 for starlette #1552)
  • src/mcp/__init__.py __all__ defines the public API surface
  • Guidance against adding new # pragma/# type: ignore/# noqa, with an audit grep
  • filterwarnings = ["error"] context for the no-warning-silencing rule
  • --frozen on all uv commands; --python <ver> for cross-version testing
  • Tests should be in-memory and deterministic; threads only when necessary, subprocesses last resort

Rename

CLAUDE.mdAGENTS.md via git mv (history preserved with --follow). A new one-line CLAUDE.md containing @AGENTS.md is added so Claude Code continues to load the file. The @-import is used rather than a symlink for Windows checkout compatibility, matching ruby-sdk and inspector.

How Has This Been Tested?

uv run --frozen pre-commit run --files CLAUDE.md AGENTS.md passes (markdownlint, end-of-file-fixer). Verified git log --follow AGENTS.md traces back through the full CLAUDE.md history. Factual claims cross-checked against pyproject.toml, .pre-commit-config.yaml, and scripts/test.

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Split into two commits so git log --follow AGENTS.md works: the content rewrite changed too much for git's rename detection to track it in a single commit, so commit 1 modernizes the content in place and commit 2 is a pure rename plus the import stub.

maxisbey added 2 commits April 9, 2026 13:41
Remove outdated and generic guidance, add project-specific context that
prevents real review churn.

Removed:
- Error Resolution section (generic 'add None checks / test thoroughly')
- Ruff line-wrapping advice (ruff format handles it) and wrong '88 chars'
- Stale pre-commit guidance ('update config rev' - ruff is repo: local)
- Reported-by / Github-Issue commit trailers (unused in practice)
- Duplicate co-authored-by note and generic PR prose
- Generic Code Quality bullets ('focused and small', 'follow patterns')

Added:
- Branching Model: main is the V2 rework, no @deprecated shims, README.md
  is frozen (edit README.v2.md), [v1.x] backport prefix
- Dependency floor policy: don't raise floors for CVEs alone (refs
  Kludex/uvicorn#2643, #1552)
- __all__ in src/mcp/__init__.py defines the public API surface
- Avoid new pragma/type:ignore/noqa; assert isinstance in tests; audit grep
- filterwarnings=['error'] context for the no-silence-warnings rule
- --frozen on all uv commands; --python <ver> for cross-version testing
- Tests: in-memory > threads > subprocesses; Client(server) for E2E

Restructured numbered-list-in-list into flat H2 sections with a dedicated
Coverage subsection.
AGENTS.md is the emerging tool-agnostic convention (agents.md spec) and is
already canonical in the spec repo, kotlin-sdk, ruby-sdk, go-sdk, and
inspector. python-sdk and typescript-sdk were the remaining outliers.

CLAUDE.md becomes a one-line @AGENTS.md import so Claude Code continues to
load the guidelines (Claude Code reads CLAUDE.md, not AGENTS.md natively).
Using @-import rather than a symlink for Windows checkout compatibility,
matching ruby-sdk and inspector.
@maxisbey maxisbey marked this pull request as ready for review April 9, 2026 13:44
@maxisbey maxisbey requested a review from felixweinberger April 9, 2026 13:44
- Fix test-mirror example to use a path that actually exists
  (src/mcp/client/stdio.py -> tests/client/test_stdio.py)
- Add upstream-library carve-out to the filterwarnings rule, since
  pyproject.toml already has scoped ignore:: entries for websockets/pywin32
- Document Raises: sections for public APIs that raise catchable exceptions
Copy link
Copy Markdown
Contributor

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — all prior review feedback has been addressed.

Extended reasoning...

Overview

Docs-only PR: renames CLAUDE.mdAGENTS.md with modernized content, adds a one-line CLAUDE.md import stub, and removes a stale filterwarnings entry from pyproject.toml. No production code paths are touched.

Security risks

None. Documentation and a removed dead test-warning suppression entry carry no security surface.

Level of scrutiny

Low. All changes are either instructional prose or the removal of a vestigial pyproject.toml entry (mcp.server.lowlevel filterwarnings) that the author confirmed is absent from the V2 source tree.

Other factors

Four rounds of prior inline comments identified documentation inaccuracies (wrong test-mirror example, incomplete filterwarnings description, missing CI matrix dimension, Windows strict-no-cover caveat, missing UV_FROZEN=1 explanation). All are marked resolved, and the git log confirms corresponding fix commits. The bug hunting system found no new issues in this revision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant