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.
git clone --depth 1 https://github.com/tumf/grafana-loki-mcpWrote 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.
[](https://agentmods.dev/rules/tumf/grafana-loki-mcp/fastmcp)<a href="https://agentmods.dev/rules/tumf/grafana-loki-mcp/fastmcp"><img src="https://agentmods.dev/badge/rules/tumf/grafana-loki-mcp/fastmcp/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.
<a href="https://agentmods.dev/rules/tumf/grafana-loki-mcp/fastmcp"><img src="https://agentmods.dev/badge/rules/tumf/grafana-loki-mcp/fastmcp.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00009 | $0.01922 |
| Opus 5 | $0.00005 | $0.00961 |
| Sonnet 5 | $0.00002 | $0.00384 |
| Haiku 4.5 | $0.00001 | $0.00192 |
Grade A, and why
fastmcp 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 9d 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.
How it starts
The opening of the file, as written. The whole thing — 280 lines — stays where its author put it; the contents beside it link to each section on GitHub.
FastMCPとは
FastMCPは、Model Context Protocol (MCP) サーバーを簡単に構築するためのPythonフレームワークです。Pythonの関数をデコレータで装飾するだけで、MCPサーバーを素早く構築できます。
🎉 FastMCPは現在、公式のMCP SDKに統合されています! 公式のModel Context Protocol Python SDK: github.com/modelcontextprotocol/python-sdk
主な特徴
- 高速: 高レベルなインターフェースにより、少ないコードで迅速な開発が可能
- シンプル: 最小限のボイラープレートコードでMCPサーバーを構築
- Pythonic: Python開発者にとって自然な感覚で使用可能
- 完全: MCPの仕様を完全に実装することを目指している
インストール方法
FastMCPは uv を使ってインストールすることが推奨されています:
uv pip install fastmcp
macOSでは、Claude Desktopアプリで利用するために、Homebrewを使って uv をインストールする必要がある場合があります:
brew install uv
あるいは、デプロイせずにSDKを使用する場合は、pipを使用することもできます:
pip install fastmcp
クイックスタート
以下は、簡単な計算ツールを提供するMCPサーバーの例です:
# server.py
from fastmcp import FastMCP
# MCPサーバーの作成
mcp = FastMCP("Demo")
# 足し算ツールの追加
@mcp.tool()
def add(a: int, b: int) -> int:
"""二つの数値を足し算する"""
return a + b
# サーバーの実行
if __name__ == "__main__":
mcp.run()
これだけで、動作するMCPサーバーが完成します!
主要コンポーネント
FastMCPは以下の主要コンポーネントをサポートしています:
1. サーバー
サーバーはFastMCPのメインオブジェクトで、すべての機能の中心となります:
from fastmcp import FastMCP
mcp = FastMCP(
"サーバー名",
host="0.0.0.0", # オプション
port=52229, # オプション
)
2. ツール
ツールはLLMが呼び出せる関数です。デコレータを使って簡単に定義できます:
@mcp.tool()
def my_tool(param1: str, param2: int) -> str:
"""
ツールの説明
Args:
param1: 最初のパラメータの説明
param2: 2番目のパラメータの説明
Returns:
結果の説明
"""
# ツールの実装
return f"結果: {param1}, {param2}"
3. リソース
リソースはLLMがアクセスできるデータです:
@mcp.resource("echo://{message}")
def echo_resource(message: str) -> str:
"""リソースとしてメッセージをエコーする"""
return f"Resource echo: {message}"
4. プロンプト
プロンプトはLLMに特定のタスクを実行させるための指示です:
@mcp.prompt()
def analyze_table(table: str) -> str:
"""テーブル分析用のプロンプトテンプレートを作成する"""
return f"""このデータベーステーブルを分析してください:
テーブル: {table}
スキーマ:
{get_schema()}
構造と関係性についてどのような洞察を提供できますか?"""
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.
- 9d ago First seen · 280 lines · 9 tokens per session scan A 3470fa31567e
fastmcp is a cursor rule published in the GitHub repository tumf/grafana-loki-mcp (29 stars, last pushed 8mo ago), licensed MIT. It adds 9 tokens to every session and 1,922 once invoked, about $0.0000 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-30.
Other cursor rules, from other repositories
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
cli-error-handling
CLI command error handling patterns.
prefer-assertions-over-defensive-checks
Prefer assertions over defensive checks when data is guaranteed to be valid.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.