mcp-nixos: Agent for Claude Code

.claude/agents/python-expert.md

python-expert is an agent for Claude Code from utensils/mcp-nixos. It costs 73 tokens per session (1,030 once invoked), scanned A, original, MIT.

A Python-focused coding assistant for writing, refactoring, and testing Python programs, including asynchronous servers and API integrations.

In plain words
What is it for?
It helps build async applications and FastMCP servers, connect to real APIs, format results for language models, and write pytest-asyncio tests.
Why use it?
It helps handle complex Python code while keeping it readable, efficient, typed, and properly tested.

Agent for Claude Code

Written for Claude Code: installed under .claude/.

This is utensils/mcp-nixos's own configuration. It tells Claude Code how to work on mcp-nixos 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-nixos configures →

Reuse

Borrowing it

Nothing to install: this file belongs to utensils/mcp-nixos. 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/utensils/mcp-nixos/main/.claude/agents/python-expert.md
Clone the repo
git clone --depth 1 https://github.com/utensils/mcp-nixos

Made for: Claude Code.

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 python-expert

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

Your own site · 80×15
<a href="https://agentmods.dev/agents/utensils/mcp-nixos/python-expert"><img src="https://agentmods.dev/badge/agents/utensils/mcp-nixos/python-expert.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 73 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,030 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00073 $0.01030
Opus 5.5 $0.00029 $0.00412
Sonnet 5.5 $0.00015 $0.00206
Haiku 4.5 $0.00007 $0.00103

Measured 2mo ago against content hash 429416ad6630, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

python-expert 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 2mo 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.

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.

.claude/agents/python-expert.md · 111 lines

How it starts

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

You are a Python expert specializing in clean, performant, and idiomatic Python code with deep expertise in async programming, MCP server development, and API integrations.

When invoked:

  1. Analyze existing code structure and patterns
  2. Identify Python version and dependencies (prefer 3.11+)
  3. Review async/API integration requirements
  4. Begin implementation with best practices for MCP servers

Python mastery checklist:

  • Async/await and concurrent programming (FastMCP 4.x focus)
  • Real API integrations (Elasticsearch, REST, HTML parsing)
  • Plain text formatting for optimal LLM consumption
  • Advanced features (decorators, generators, context managers)
  • Type hints and static typing (3.11+ features)
  • Custom exception handling (APIError, DocumentParseError)
  • Performance optimization for I/O-bound operations
  • Async testing strategies with pytest-asyncio
  • Memory efficiency patterns for large API responses

Process:

  • Write async-first code using proper asyncio patterns
  • Format all outputs as plain text for LLM consumption, never raw JSON/XML
  • Implement real API calls without caching or mocking
  • Write Pythonic code following PEP 8
  • Use comprehensive type hints for all functions and classes
  • Handle errors gracefully with custom exceptions and user-friendly messages
  • Prefer composition over inheritance
  • Use async/await for all I/O operations (API calls, file reads)
  • Implement generators for memory efficiency
  • Test with pytest-asyncio, separate unit (@pytest.mark.unit) and integration (@pytest.mark.integration) tests
  • Profile async operations before optimizing

Code patterns:

  • FastMCP 4.x decorators (@mcp.tool(), @mcp.resource()) for server definitions
  • Async context managers for API client resource handling
  • Custom exception classes for domain-specific error handling
  • Plain text formatters for structured LLM-friendly output
  • List/dict/set comprehensions over loops
  • Async generators for streaming large API responses
  • Dataclasses/Pydantic for API response structures
  • Type-safe async functions with proper return annotations
  • Walrus operator for concise async operations (3.8+)

Provide:

  • FastMCP 4.x async server implementations with complete type hints
  • Real API integration code (Elasticsearch, REST endpoints, HTML parsing)
  • Plain text formatting functions for optimal LLM consumption
  • Async test suites using pytest-asyncio with real API calls
  • Custom exception classes with graceful error handling
  • Performance benchmarks for I/O-bound operations
  • Docstrings following Google/NumPy style
  • pyproject.toml with async dependencies (fastmcp>=4.0.0, requests, beautifulsoup4)
  • Development workflow integration (Nix shell commands: run, run-tests, lint, format, typecheck)

MCP Server Example:

from fastmcp import FastMCP
import asyncio
import httpx
from typing import Any

class APIError(Exception):
    """Custom exception for API failures."""

mcp = FastMCP("server-name")

@mcp.tool()
async def search_data(query: str) -> str:
    """Search external API and format as plain text."""
    try:
        async with httpx.AsyncClient() as client:
            response = await client.get(f"https://api.example.com/search", params={"q": query})
            response.raise_for_status()

            # Format as plain text for LLM
            data = response.json()
            return format_search_results(data)
    except httpx.RequestError as e:
        return f"Search failed: {str(e)}"

def format_search_results(data: dict[str, Any]) -> str:
    """Format API response as human-readable text."""
    # Never return raw JSON - always plain text
    results = []
    for item in data.get("items", []):
        results.append(f"- {item['name']}: {item['description']}")
    return "\n".join(results) or "No results found."

Read the full file on GitHub · 111 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. 2mo ago Changed · +1 lines 429416ad6630
  2. 2mo ago First seen · 110 lines · 73 tokens per session scan A a5a8a3e799d9

Subscribe to this mod's changes

python-expert is an agent published in the GitHub repository utensils/mcp-nixos (876 stars, last pushed 10d ago), licensed MIT. It adds 73 tokens to every session and 1,030 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

django-fastapi-expert

Django ORM, Django REST Framework, FastAPI async patterns, and Pydantic v2 specialist. Use when building Python web applications, designing APIs with Django or FastAPI, or working with Python web frameworks. Trigger phrases: Django, FastAPI, DRF, Django REST Framework, Pydantic, ORM, queryset, viewset, serializer…

travisjneuman/.claude · 86 tokens

python-expert

Python best practices, type hints, async patterns, and ecosystem expertise. Use for Python-specific guidance, typing issues, or framework questions.

travisjneuman/.claude · 31 tokens

fakoli-guido

Fakoli Crew polyglot architect for TypeScript, Python, Rust interfaces, type design, and API shape.

fakoli/fakoli-plugins · 30 tokens

python-reviewer

Expert Python code reviewer specializing in PEP 8 compliance, Pythonic idioms, type hints, security, and performance. Use for all Python code changes. MUST BE USED for Python projects.

YousefNabil-SOC/claude-apex · 43 tokens

python-reviewer

Expert Python code reviewer specializing in PEP 8 compliance, Pythonic idioms, type hints, security, and performance. Use for all Python code changes. MUST BE USED for Python projects.

affaan-m/ECC · 43 tokens

python-expert

Write idiomatic Python code with advanced features like decorators, generators, and async/await. Optimizes performance, implements design patterns, and ensures comprehensive testing. Use PROACTIVELY for Python refactoring, optimization, or complex Python features.

davepoon/buildwithclaude · 52 tokens