FastMCP tests
SkillDocs & knowledgepython-tests is a skill that helps an agent write regression tests for FastMCP changes. It uses pytest fixtures, in-memory clients, and protocol boundaries to check that a change behaves as expected. The person using an agent gets tests that exercise the server without a live network connection.
Use FastMCP tests in Claude, ChatGPT or Ahel Desktop
Free. Sign in, add FastMCP tests and connect your AI. About a minute.
Also: Claude Code · Cursor · Codex
Then ask your AI: use the FastMCP tests skill
Details
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; ahel provides instructions and does not run this skill.
No other account needed.
Have a Python project with FastMCP and pytest available.
What your AI can do with it
- Write regression tests for FastMCP changes with pytest
- Use FastMCP pytest fixtures in test files
- Drive an in-memory client against a FastMCP server
- Test behavior at protocol boundaries
- Turn a described FastMCP change into a failing then passing test
Getting started
- Have a Python project with FastMCP and pytest available.
- Add the skill to your agent so it can write test files for FastMCP changes.
- Point the agent at the FastMCP change that needs a regression test.
- Run the generated tests with pytest and check that they fail before the fix and pass after it.
What this skill tells your AI
The instructions your AI receives, as published by prefecthq/fastmcp in .agents/skills/python-tests/SKILL.md and read by ahel’s review.
Read nearby tests and the repository's validation requirements first. Extend the owning test module when it remains readable; use a focused module when the existing one is already too large.
For a bug fix, run the regression against unchanged code and confirm it fails for the reported reason, then run it with the fix. An import error or broken fixture is not a reproduced bug. Include supported adjacent behavior that the same branch could change, especially omitted defaults and explicit overrides.
- Async tests need no marker:
asyncio_mode = "auto"is configured globally. - Use
Client(server)for real MCP dispatch without a network server. Use HTTP transport only when network behavior is the subject. - Mock external boundaries, not the FastMCP functions under test. For OpenAPI requests, capture the outgoing request with
httpx2.MockTransportand assert its bytes, headers, or decoded parameters. - Keep imports at module scope. Prefer function-scoped fixtures and
tmp_pathfor files. - Parameterize variations of one contract; separate unrelated behavior. For JSON, equality alone does not distinguish
Truefrom1: check the resulting type when type preservation matters. - Use existing
inline_snapshotconventions for complex schema assertions. Inspect generated snapshots rather than accepting them blindly. - The default timeout is five seconds. Use the repository's integration conventions for tests that legitimately need more time.
Run focused tests during development, then the full commands required by AGENTS.md before committing. If a failure appears unrelated, reproduce it on the unchanged base; do not call it pre-existing from the test name alone.
Signals
- GitHub stars
- 28k
- Forks
- 2k
- Last commit
- Oct 2026
Questions
- Does this skill write regression tests for FastMCP changes?
- Yes. It writes regression tests for FastMCP changes using pytest fixtures, in-memory clients, and protocol boundaries.
- Does it use pytest fixtures and in-memory clients?
- Yes. The tests it writes use FastMCP pytest fixtures and in-memory clients, so they do not need a live network connection.
- Can it test behavior at protocol boundaries?
- Yes. Protocol boundaries are one of the things the skill uses when writing regression tests for FastMCP changes.
- Do I need a running FastMCP server to run the tests?
- No. The tests use in-memory clients, so they exercise the server without a live network connection.
- What do I need installed before using this skill?
- You need a Python project with FastMCP and pytest available, and the skill added to your agent.
Advanced
- Item type
- skill
- Key
python-tests- Source
- github.com/prefecthq/fastmcp
Related picks
Skill · wshobson
The pick for Pythonpython-pro
Skill · jeffallan
The pick for Pythonfastapi
Skill · fastapi
The pick for FastAPIpython-fastapi-ops
Skill · 0xdarkmatter
The pick for FastAPIhandoff
Skill · mattpocock
More in Docs & knowledgecanvas-design
Skill · anthropics
More in Docs & knowledge