AI SummaryA protocol guide for developing MCP plugins compatible with Windsurf, covering planning and implementation steps for integrating AI tools with Node.js and Python environments.
Install
Copy this and paste it into Claude Code, Cursor, or any AI assistant:
I want to add the "mastra-gmail-mcp — Windsurf Rules" prompt rules to my project. Repository: https://github.com/mundume/mastra-gmail-mcp Please read the repo to find the rules/prompt file, then: 1. Download it to the correct location (.cursorrules, .windsurfrules, .github/prompts/, or project root — based on the file type) 2. If there's an existing rules file, merge the new rules in rather than overwriting 3. Confirm what was added
Description
Windsurf Rules for mastra-gmail-mcp
Key Requirements
• ✓ Must use MCP SDK • ✓ Must have comprehensive logging • ✓ Must test each tool individually • ✓ Must handle errors gracefully • ⛔️ NEVER skip testing before completion
MCP Plugin Development Protocol
⚠️ CRITICAL: DO NOT USE attempt_completion BEFORE TESTING ⚠️
Step 1: Planning (PLAN MODE)
• What problem does this tool solve? • What API/service will it use? • What are the authentication requirements? □ Standard API key □ OAuth (requires separate setup script) □ Other credentials
Step 2: Implementation (ACT MODE)
• Bootstrap • For web services, JavaScript integration, or Node.js environments: `bash npx @modelcontextprotocol/create-server my-server cd my-server npm install ` • For data science, ML workflows, or Python environments: `bash pip install mcp # Or with uv (recommended) uv add "mcp[cli]" ` • Core Implementation • Use MCP SDK • Implement comprehensive logging • TypeScript (for web/JS projects): `typescript console.error("[Setup] Initializing server..."); console.error("[API] Request to endpoint:", endpoint); console.error("[Error] Failed with:", error); ` • Python (for data science/ML projects): `python import logging logging.error('[Setup] Initializing server...') logging.error(f'[API] Request to endpoint: {endpoint}') logging.error(f'[Error] Failed with: {str(error)}') ` • Add type definitions • Handle errors with context • Implement rate limiting if needed • Configuration • Get credentials from user if needed • Add to MCP settings: • For TypeScript projects: `json { "mcpServers": { "my-server": { "command": "node", "args": ["path/to/build/index.js"], "env": { "API_KEY": "key" }, "disabled": false, "autoApprove": [] } } } ` • For Python projects: `bash # Directly with command line mcp install server.py -v API_KEY=key # Or in settings.json { "mcpServers": { "my-server": { "command": "python", "args": ["server.py"], "env": { "API_KEY": "key" }, "disabled": false, "autoApprove": [] } } } `
Discussion
Health Signals
My Fox Den
Community Rating
Sign in to rate this booster
Works With
Any AI assistant that accepts custom rules or system prompts