lifesciences-research: Command for Claude Code

.claude/commands/scaffold-fastmcp-v2.md

scaffold-fastmcp-v2 is a command for Claude Code from donbr/lifesciences-research. It costs 19 tokens per session (2,547 once invoked), scanned A, original, MIT.

A command for creating the starting files of a FastMCP server, which is a service that exposes tools for AI agents, for a life-sciences API.

In plain words
What is it for?
Given an API name such as UniProt, ChEMBL, or Open Targets, it validates the name, checks for an existing server, reads project patterns, and creates client, server, unit-test, and integration-test stubs.
Why use it?
It avoids manually setting up the repeated client, server, and test folders needed for a new API integration.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

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

Reuse

Borrowing it

Nothing to install: this file belongs to donbr/lifesciences-research. 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/donbr/lifesciences-research/main/.claude/commands/scaffold-fastmcp-v2.md
Clone the repo
git clone --depth 1 https://github.com/donbr/lifesciences-research

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 scaffold-fastmcp-v2

README.md
[![agentmods](https://agentmods.dev/badge/commands/donbr/lifesciences-research/scaffold-fastmcp-v2/github.svg)](https://agentmods.dev/commands/donbr/lifesciences-research/scaffold-fastmcp-v2)
Your own site
<a href="https://agentmods.dev/commands/donbr/lifesciences-research/scaffold-fastmcp-v2"><img src="https://agentmods.dev/badge/commands/donbr/lifesciences-research/scaffold-fastmcp-v2/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 scaffold-fastmcp-v2

Your own site · 80×15
<a href="https://agentmods.dev/commands/donbr/lifesciences-research/scaffold-fastmcp-v2"><img src="https://agentmods.dev/badge/commands/donbr/lifesciences-research/scaffold-fastmcp-v2.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,547 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.00019 $0.02547
Opus 5 $0.00010 $0.01273
Sonnet 5 $0.00004 $0.00509
Haiku 4.5 $0.00002 $0.00255

Measured 11d ago against content hash 72824bba75cf, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

scaffold-fastmcp-v2 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 11d 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/commands/scaffold-fastmcp-v2.md · 351 lines

How it starts

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

User Input

$ARGUMENTS

You MUST consider the user input before proceeding. Expected format:

  • <api-name> - e.g., "uniprot", "chembl", "opentargets"

If no argument provided, ask the user for the API name.

Goal

Create the complete scaffolding for a new FastMCP MCP server following the Life Sciences project architecture defined in ADR-001. This skill implements Constitution Principle VI (Platform Skill Delegation) to ensure consistent project structure.

Generated Structure

src/lifesciences_mcp/
├── clients/
│   └── <api>.py              # Client stub (ADR-006)
├── servers/
│   └── <api>.py              # FastMCP server with tool stubs
└── (existing files preserved)

tests/
├── unit/
│   └── test_<api>_models.py  # Unit test stubs
└── integration/
    └── test_<api>_api.py     # Integration test stubs

Execution Steps

1. Validate Input

  • Extract API name from arguments (lowercase, alphanumeric with underscores)
  • Validate against existing servers in src/lifesciences_mcp/servers/
  • If server already exists, abort with message

2. Read Existing Patterns

Read the following files to understand established patterns:

  • src/lifesciences_mcp/servers/hgnc.py - Server pattern
  • src/lifesciences_mcp/clients/hgnc.py - Client pattern
  • src/lifesciences_mcp/models/envelopes.py - Envelope models
  • tests/integration/test_hgnc_api.py - Test pattern

3. Generate Server File

Create src/lifesciences_mcp/servers/<api>.py with:

"""<API_NAME> MCP Server - <Brief description>.

This server provides tools for <API purpose>:
- search_<entities>: Fuzzy search returning ranked candidates
- get_<entity>: Strict lookup by <ID_TYPE> CURIE

Usage:
    uv run fastmcp run src/lifesciences_mcp/servers/<api>.py
"""

from fastmcp import FastMCP

from lifesciences_mcp.clients import <API>Client
from lifesciences_mcp.models import (
    ErrorEnvelope,
    PaginationEnvelope,
)

# Initialize the MCP server
mcp = FastMCP("<API_NAME> Server")

# Shared client instance (connection pooling)
# Lifecycle managed by module-level singleton pattern
_client: <API>Client | None = None


async def get_client() -> <API>Client:
    """Get or create the shared <API> client."""
    global _client
    if _client is None:
        _client = <API>Client()
    return _client


@mcp.tool
async def search_<entities>(
    query: str,
    slim: bool = False,
    cursor: str | None = None,
    page_size: int = 50,
) -> PaginationEnvelope | ErrorEnvelope:
    """Fuzzy search for <entities>.

    Args:
        query: Search term.
        slim: If true, return minimal fields (~20 tokens per entity).
        cursor: Opaque cursor for pagination.
        page_size: Number of results per page (1-100, default 50).

    Returns:
        PaginationEnvelope with items, or ErrorEnvelope on failure.
    """
    client = await get_client()
    return await client.search_<entities>(
        query=query,
        slim=slim,
        cursor=cursor,
        page_size=page_size,
    )


@mcp.tool
async def get_<entity>(<id_param>: str) -> dict | ErrorEnvelope:
    """Get complete <entity> record by <ID_TYPE> CURIE.

    Args:
        <id_param>: <ID_TYPE> CURIE in format '<PREFIX>:NNNNN'.

    Returns:
        <Entity> record, or ErrorEnvelope on failure.
    """
    client = await get_client()
    return await client.get_<entity>(<id_param>=<id_param>)


if __name__ == "__main__":
    mcp.run()

Read the full file on GitHub · 351 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. 11d ago First seen · 351 lines · 19 tokens per session scan A 72824bba75cf

Subscribe to this mod's changes

scaffold-fastmcp-v2 is a command published in the GitHub repository donbr/lifesciences-research (7 stars, last pushed 8d ago), licensed MIT. It adds 19 tokens to every session and 2,547 once invoked, about $0.0001 per session on Opus 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-31.