fastmcp-library

fastmcp-library is a cursor rule for Cursor from koizumikento/reinfolib-mcp. It costs 0 tokens per session (1,583 once invoked), scanned A, original, MIT.

A Python framework for building MCP servers and clients. MCP is a standard way for AI tools to connect to functions and data sources.

In plain words
What is it for?
Use it to create Python MCP servers, expose functions such as searches or calculations, describe their safety properties, and run them over supported connection methods.
Why use it?
It provides a documented structure for defining tools, resources, and server connections instead of building that setup from scratch.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it to create Python MCP servers, expose functions such as searches or calculations, describe their safety properties, and run them over supported connection methods.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/koizumikento/reinfolib-mcp/fastmcp-library
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/koizumikento/reinfolib-mcp

Made for: Cursor.

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-library

README.md
[![agentmods](https://agentmods.dev/badge/rules/koizumikento/reinfolib-mcp/fastmcp-library/github.svg)](https://agentmods.dev/rules/koizumikento/reinfolib-mcp/fastmcp-library)
Your own site
<a href="https://agentmods.dev/rules/koizumikento/reinfolib-mcp/fastmcp-library"><img src="https://agentmods.dev/badge/rules/koizumikento/reinfolib-mcp/fastmcp-library/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-library

Your own site · 80×15
<a href="https://agentmods.dev/rules/koizumikento/reinfolib-mcp/fastmcp-library"><img src="https://agentmods.dev/badge/rules/koizumikento/reinfolib-mcp/fastmcp-library.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,583 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.00000 $0.01583
Opus 5 $0.00000 $0.00792
Sonnet 5 $0.00000 $0.00317
Haiku 4.5 $0.00000 $0.00158

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

Security

Grade A, and why

fastmcp-library 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 12d 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.

.cursor/rules/fastmcp-library.mdc · 222 lines

How it starts

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

FastMCPライブラリ使用ガイド

FastMCPの基本構造

FastMCPは、Model Context Protocol (MCP) サーバーとクライアントを構築するためのPythonフレームワークです。

基本的なサーバー設定

from fastmcp import FastMCP

mcp = FastMCP("不動産情報ライブラリMCPサーバー")

@mcp.tool
def greet(name: str) -> str:
    """指定された名前で挨拶を返します。"""
    return f"こんにちは、{name}さん!"

if __name__ == "__main__":
    mcp.run(transport="stdio")  # stdio, http, sse をサポート

ツール定義パターン

1. 基本的なツール定義

@mcp.tool
def add(a: int, b: int) -> int:
    """2つの整数を加算します。"""
    return a + b

2. カスタム名とメタデータ付きツール

@mcp.tool(
    name="find_products",
    description="製品カタログを検索します",
    tags={"catalog", "search"},
    meta={"version": "1.2", "author": "team"}
)
def search_products(query: str, category: str | None = None) -> list[dict]:
    """製品検索の実装"""
    return [{"id": 1, "name": "商品名"}]

3. ツールアノテーション

from mcp.types import ToolAnnotations

@mcp.tool(
    annotations=ToolAnnotations(
        title="計算ツール",
        readOnlyHint=True,      # 読み取り専用
        destructiveHint=False,  # 破壊的でない
        idempotentHint=True,    # 冪等性あり
        openWorldHint=False     # 閉じた世界
    )
)
def calculate_sum(a: float, b: float) -> float:
    """数値の合計を計算します。"""
    return a + b

リソース定義

@mcp.resource("system://status")
def get_system_status() -> dict:
    """システムステータスを返します。"""
    return {"status": "正常稼働中"}

@mcp.resource("weather://{city}")
def get_weather(city: str) -> str:
    """指定都市の天気を取得します。"""
    return f"{city}の天気情報"

プロンプト定義

@mcp.prompt
def ask_about_topic(topic: str) -> str:
    """トピックについて説明を求めるプロンプトを生成します。"""
    return f"'{topic}'について詳しく説明してください。"

@mcp.prompt(
    name="analyze_request",
    description="データ分析リクエストを生成",
    tags={"analysis", "data"}
)
def data_analysis_prompt(data_uri: str, analysis_type: str = "summary") -> str:
    """データ分析のプロンプトを生成します。"""
    return f"{data_uri}のデータに対して{analysis_type}分析を実行してください。"

コンテキストの使用

from fastmcp import Context

@mcp.tool
async def process_data(uri: str, ctx: Context) -> str:
    """コンテキストを使用したデータ処理。"""
    # ログ出力
    await ctx.info(f"処理開始: {uri}")
    await ctx.debug("デバッグ情報")
    
    # プログレス報告
    await ctx.report_progress(50, 100, "処理中...")
    
    # リソース読み取り
    data = await ctx.read_resource(uri)
    
    # 状態管理
    ctx.set_state("processing", True)
    
    return f"処理完了: {uri}"

Read the full file on GitHub · 222 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. 12d ago First seen · 222 lines · 1,583 tokens per session scan A bfe8aeb286dd

Subscribe to this mod's changes

fastmcp-library is a cursor rule published in the GitHub repository koizumikento/reinfolib-mcp (2 stars, last pushed 16d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,583 tokens. 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.