ggmcp: Cursor rule for Windsurf

.windsurfrules

windsurfrules is a cursor rule for Windsurf from GitGuardian/ggmcp. It costs 1,437 tokens per session, scanned A, original, MIT.

A set of rules for defining MCP tools in Python. MCP is a protocol that lets an agent call named functions, and these rules require asynchronous functions, type hints, and descriptive documentation.

In plain words
What is it for?
Use it when creating Python MCP tools, including tools that make asynchronous web requests or perform calculations.
Why use it?
It gives generated tools a consistent shape that MCP clients can discover and call. It also helps avoid common implementation mistakes such as missing decorators or unclear parameters.

Cursor rule for Windsurf

Written for Windsurf: a Windsurf rule. Also seen: mentions Cursor.

This is GitGuardian/ggmcp's own configuration. It tells Windsurf how to work on ggmcp 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 ggmcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to GitGuardian/ggmcp. 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/GitGuardian/ggmcp/main/.windsurfrules
Clone the repo
git clone --depth 1 https://github.com/GitGuardian/ggmcp

Made for: Windsurf.

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 windsurfrules

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

Your own site · 80×15
<a href="https://agentmods.dev/rules/gitguardian/ggmcp/windsurfrules"><img src="https://agentmods.dev/badge/rules/gitguardian/ggmcp/windsurfrules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,437 This file is loaded in full into every session.
When invoked 1,437 The same file — it is already loaded in full.
Security scan A 1 finding. 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.01437 $0.01437
Opus 5.5 $0.00575 $0.00575
Sonnet 5.5 $0.00287 $0.00287
Haiku 4.5 $0.00144 $0.00144

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

Security

Grade A, and why

windsurfrules scanned grade A with 1 finding 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 1mo 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Incorrect: `requests.get(...)`
.windsurfrules · 230 lines

How it starts

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

Cursor Rules for MCP Tool Generation

Tool Definition Guidelines

  1. Use the @mcp.tool() decorator

    • All tools must be defined using the @mcp.tool() decorator
    • This properly registers the function as an MCP tool
    • Include proper type hints for parameters and return values
  2. Methods must be async

    • All tool methods should be defined as async functions
    • Use async def for all tool definitions
    • Use appropriate async libraries and patterns (e.g., httpx.AsyncClient instead of requests)
  3. Include descriptive docstrings

    • Each tool must have a clear, descriptive docstring
    • Docstrings should explain what the tool does and describe parameters

Examples of correct tool implementations:

@mcp.tool()
async def calculate_bmi(weight_kg: float, height_m: float) -> float:
    """Calculate BMI given weight in kg and height in meters"""
    return weight_kg / (height_m**2)


@mcp.tool()
async def fetch_weather(city: str) -> str:
    """Fetch current weather for a city"""
    async with httpx.AsyncClient() as client:
        response = await client.get(f"https://api.weather.com/{city}")
        return response.text

Common Mistakes to Avoid

  1. Don't use synchronous functions

    • Incorrect: def my_tool():
    • Correct: async def my_tool():
  2. Don't forget the decorator

    • Incorrect: async def my_tool():
    • Correct: @mcp.tool()\nasync def my_tool():
  3. Don't use blocking HTTP libraries

    • Incorrect: requests.get(...)
    • Correct: async with httpx.AsyncClient() as client: await client.get(...)

title: "Don't use uvicorn or fastapi with MCP" description: "MCP has native server capabilities, external web servers are not needed" severity: warning

Don't use uvicorn or fastapi with MCP/FastMCP

Rule Details

MCP and FastMCP have their own server implementations that can run directly without external web servers like uvicorn or fastapi.

❌ Incorrect

# Incorrect: Using uvicorn with MCP
import uvicorn
from mcp.server.fastmcp import FastMCP

mcp = FastMCP("MyServer")

if __name__ == "__main__":
    uvicorn.run(mcp.app, host="0.0.0.0", port=8000)  # Wrong

Read the full file on GitHub · 230 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. 1mo ago First seen · 230 lines · 1,437 tokens per session scan A cc5fe8e60e4d

Subscribe to this mod's changes

windsurfrules is a cursor rule published in the GitHub repository GitGuardian/ggmcp (41 stars, last pushed 4d ago), licensed MIT. It adds 1,437 tokens to every session, about $0.0057 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-11.