UNPKG

create-sparc

Version:

NPX package to scaffold new projects with SPARC methodology structure

402 lines (316 loc) โ€ข 16.5 kB
# Roo Modes and MCP Integration Guide ## Overview This guide provides information about the various modes available in Roo and detailed documentation on the Model Context Protocol (MCP) integration capabilities. Create by @ruvnet ## Available Modes Roo offers specialized modes for different aspects of the development process: ### ๐Ÿ“‹ Specification Writer - **Role**: Captures project context, functional requirements, edge cases, and constraints - **Focus**: Translates requirements into modular pseudocode with TDD anchors - **Best For**: Initial project planning and requirement gathering ### ๐Ÿ—๏ธ Architect - **Role**: Designs scalable, secure, and modular architectures - **Focus**: Creates architecture diagrams, data flows, and integration points - **Best For**: System design and component relationships ### ๐Ÿง  Auto-Coder - **Role**: Writes clean, efficient, modular code based on pseudocode and architecture - **Focus**: Implements features with proper configuration and environment abstraction - **Best For**: Feature implementation and code generation ### ๐Ÿงช Tester (TDD) - **Role**: Implements Test-Driven Development (TDD, London School) - **Focus**: Writes failing tests first, implements minimal code to pass, then refactors - **Best For**: Ensuring code quality and test coverage ### ๐Ÿชฒ Debugger - **Role**: Troubleshoots runtime bugs, logic errors, or integration failures - **Focus**: Uses logs, traces, and stack analysis to isolate and fix bugs - **Best For**: Resolving issues in existing code ### ๐Ÿ›ก๏ธ Security Reviewer - **Role**: Performs static and dynamic audits to ensure secure code practices - **Focus**: Flags secrets, poor modular boundaries, and oversized files - **Best For**: Security audits and vulnerability assessments ### ๐Ÿ“š Documentation Writer - **Role**: Writes concise, clear, and modular Markdown documentation - **Focus**: Creates documentation that explains usage, integration, setup, and configuration - **Best For**: Creating user guides and technical documentation ### ๐Ÿ”— System Integrator - **Role**: Merges outputs of all modes into a working, tested, production-ready system - **Focus**: Verifies interface compatibility, shared modules, and configuration standards - **Best For**: Combining components into a cohesive system ### ๐Ÿ“ˆ Deployment Monitor - **Role**: Observes the system post-launch, collecting performance data and user feedback - **Focus**: Configures metrics, logs, uptime checks, and alerts - **Best For**: Post-deployment observation and issue detection ### ๐Ÿงน Optimizer - **Role**: Refactors, modularizes, and improves system performance - **Focus**: Audits files for clarity, modularity, and size - **Best For**: Code refinement and performance optimization ### ๐Ÿš€ DevOps - **Role**: Handles deployment, automation, and infrastructure operations - **Focus**: Provisions infrastructure, configures environments, and sets up CI/CD pipelines - **Best For**: Deployment and infrastructure management ### ๐Ÿ” Supabase Admin - **Role**: Designs and implements database schemas, RLS policies, triggers, and functions - **Focus**: Ensures secure, efficient, and scalable data management with Supabase - **Best For**: Database management and Supabase integration ### โ™พ๏ธ MCP Integration - **Role**: Connects to and manages external services through MCP interfaces - **Focus**: Ensures secure, efficient, and reliable communication with external APIs - **Best For**: Integrating with third-party services ### โšก๏ธ SPARC Orchestrator - **Role**: Orchestrates complex workflows by breaking down objectives into subtasks - **Focus**: Ensures secure, modular, testable, and maintainable delivery - **Best For**: Managing complex projects with multiple components ### โ“ Ask - **Role**: Helps users navigate, ask, and delegate tasks to the correct modes - **Focus**: Guides users to formulate questions using the SPARC methodology - **Best For**: Getting started and understanding how to use Roo effectively ## MCP Integration Mode The MCP Integration Mode (โ™พ๏ธ) in Roo is designed specifically for connecting to and managing external services through MCP interfaces. This mode ensures secure, efficient, and reliable communication between your application and external service APIs. ### Key Features - Establish connections to MCP servers and verify availability - Configure and validate authentication for service access - Implement data transformation and exchange between systems - Robust error handling and retry mechanisms - Documentation of integration points, dependencies, and usage patterns ### MCP Integration Workflow | Phase | Action | Tool Preference | |-------|--------|-----------------| | 1. Connection | Establish connection to MCP servers and verify availability | `use_mcp_tool` for server operations | | 2. Authentication | Configure and validate authentication for service access | `use_mcp_tool` with proper credentials | | 3. Data Exchange | Implement data transformation and exchange between systems | `use_mcp_tool` for operations, `apply_diff` for code | | 4. Error Handling | Implement robust error handling and retry mechanisms | `apply_diff` for code modifications | | 5. Documentation | Document integration points, dependencies, and usage patterns | `insert_content` for documentation | ### Non-Negotiable Requirements - โœ… ALWAYS verify MCP server availability before operations - โœ… NEVER store credentials or tokens in code - โœ… ALWAYS implement proper error handling for all API calls - โœ… ALWAYS validate inputs and outputs for all operations - โœ… NEVER use hardcoded environment variables - โœ… ALWAYS document all integration points and dependencies - โœ… ALWAYS use proper parameter validation before tool execution - โœ… ALWAYS include complete parameters for MCP tool operations # Agentic Coding MCPs ## Overview This guide provides detailed information on Management Control Panel (MCP) integration capabilities. MCP enables seamless agent workflows by connecting to more than 80 servers, covering development, AI, data management, productivity, cloud storage, e-commerce, finance, communication, and design. Each server offers specialized tools, allowing agents to securely access, automate, and manage external services through a unified and modular system. This approach supports building dynamic, scalable, and intelligent workflows with minimal setup and maximum flexibility. ## Install via NPM ``` npx create-sparc init --force ``` --- ## Available MCP Servers ### ๐Ÿ› ๏ธ Development & Coding | | Service | Description | |:------|:--------------|:-----------------------------------| | ๐Ÿ™ | GitHub | Repository management, issues, PRs | | ๐ŸฆŠ | GitLab | Repo management, CI/CD pipelines | | ๐Ÿงบ | Bitbucket | Code collaboration, repo hosting | | ๐Ÿณ | DockerHub | Container registry and management | | ๐Ÿ“ฆ | npm | Node.js package registry | | ๐Ÿ | PyPI | Python package index | | ๐Ÿค— | HuggingFace Hub| AI model repository | | ๐Ÿง  | Cursor | AI-powered code editor | | ๐ŸŒŠ | Windsurf | AI development platform | --- ### ๐Ÿค– AI & Machine Learning | | Service | Description | |:------|:--------------|:-----------------------------------| | ๐Ÿ”ฅ | OpenAI | GPT models, DALL-E, embeddings | | ๐Ÿงฉ | Perplexity AI | AI search and question answering | | ๐Ÿง  | Cohere | NLP models | | ๐Ÿงฌ | Replicate | AI model hosting | | ๐ŸŽจ | Stability AI | Image generation AI | | ๐Ÿš€ | Groq | High-performance AI inference | | ๐Ÿ“š | LlamaIndex | Data framework for LLMs | | ๐Ÿ”— | LangChain | Framework for LLM apps | | โšก | Vercel AI | AI SDK, fast deployment | | ๐Ÿ› ๏ธ | AutoGen | Multi-agent orchestration | | ๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘ | CrewAI | Agent team framework | | ๐Ÿง  | Huggingface | Model hosting and APIs | --- ### ๐Ÿ“ˆ Data & Analytics | | Service | Description | |:------|:---------------|:-----------------------------------| | ๐Ÿ›ข๏ธ | Supabase | Database, Auth, Storage backend | | ๐Ÿ” | Ahrefs | SEO analytics | | ๐Ÿงฎ | Code Interpreter| Code execution and data analysis | --- ### ๐Ÿ“… Productivity & Collaboration | | Service | Description | |:------|:---------------|:-----------------------------------| | โœ‰๏ธ | Gmail | Email service | | ๐Ÿ“น | YouTube | Video sharing platform | | ๐Ÿ‘” | LinkedIn | Professional network | | ๐Ÿ“ฐ | HackerNews | Tech news discussions | | ๐Ÿ—’๏ธ | Notion | Knowledge management | | ๐Ÿ’ฌ | Slack | Team communication | | โœ… | Asana | Project management | | ๐Ÿ“‹ | Trello | Kanban boards | | ๐Ÿ› ๏ธ | Jira | Issue tracking and projects | | ๐ŸŽŸ๏ธ | Zendesk | Customer service | | ๐ŸŽฎ | Discord | Community messaging | | ๐Ÿ“ฒ | Telegram | Messaging app | --- ### ๐Ÿ—‚๏ธ File Storage & Management | | Service | Description | |:------|:---------------|:-----------------------------------| | โ˜๏ธ | Google Drive | Cloud file storage | | ๐Ÿ“ฆ | Dropbox | Cloud file sharing | | ๐Ÿ“ | Box | Enterprise file storage | | ๐ŸชŸ | OneDrive | Microsoft cloud storage | | ๐Ÿง  | Mem0 | Knowledge storage, notes | --- ### ๐Ÿ”Ž Search & Web Information | | Service | Description | |:------|:----------------|:---------------------------------| | ๐ŸŒ | Composio Search | Unified web search for agents | --- ### ๐Ÿ›’ E-commerce & Finance | | Service | Description | |:------|:---------------|:-----------------------------------| | ๐Ÿ›๏ธ | Shopify | E-commerce platform | | ๐Ÿ’ณ | Stripe | Payment processing | | ๐Ÿ’ฐ | PayPal | Online payments | | ๐Ÿ“’ | QuickBooks | Accounting software | | ๐Ÿ“ˆ | Xero | Accounting and finance | | ๐Ÿฆ | Plaid | Financial data APIs | --- ### ๐Ÿ“ฃ Marketing & Communications | | Service | Description | |:------|:---------------|:-----------------------------------| | ๐Ÿ’ | MailChimp | Email marketing platform | | โœ‰๏ธ | SendGrid | Email delivery service | | ๐Ÿ“ž | Twilio | SMS and calling APIs | | ๐Ÿ’ฌ | Intercom | Customer messaging | | ๐ŸŽŸ๏ธ | Freshdesk | Customer support | --- ### ๐Ÿ›œ Social Media & Publishing | | Service | Description | |:------|:---------------|:-----------------------------------| | ๐Ÿ‘ฅ | Facebook | Social networking | | ๐Ÿ“ท | Instagram | Photo sharing | | ๐Ÿฆ | Twitter | Microblogging platform | | ๐Ÿ‘ฝ | Reddit | Social news aggregation | | โœ๏ธ | Medium | Blogging platform | | ๐ŸŒ | WordPress | Website and blog publishing | | ๐ŸŒŽ | Webflow | Web design and hosting | --- ### ๐ŸŽจ Design & Digital Assets | | Service | Description | |:------|:---------------|:-----------------------------------| | ๐ŸŽจ | Figma | Collaborative UI design | | ๐ŸŽž๏ธ | Adobe | Creative tools and software | --- ### ๐Ÿ—“๏ธ Scheduling & Events | | Service | Description | |:------|:---------------|:-----------------------------------| | ๐Ÿ“† | Calendly | Appointment scheduling | | ๐ŸŽŸ๏ธ | Eventbrite | Event management and tickets | | ๐Ÿ“… | Calendar Google | Google Calendar Integration | | ๐Ÿ“… | Calendar Outlook| Outlook Calendar Integration | --- ## ๐Ÿงฉ Using MCP Tools To use an MCP server: 1. Connect to the desired MCP endpoint or install server (e.g., Supabase via `npx`). 2. Authenticate with your credentials. 3. Trigger available actions through Roo workflows. 4. Maintain security and restrict only necessary permissions. ### Example: GitHub Integration ``` <!-- Initiate connection --> <use_mcp_tool> <server_name>github</server_name> <tool_name>GITHUB_INITIATE_CONNECTION</tool_name> <arguments>{}</arguments> </use_mcp_tool> <!-- List pull requests --> <use_mcp_tool> <server_name>github</server_name> <tool_name>GITHUB_PULLS_LIST</tool_name> <arguments>{"owner": "username", "repo": "repository-name"}</arguments> </use_mcp_tool> ``` ### Example: OpenAI Integration ``` <!-- Initiate connection --> <use_mcp_tool> <server_name>openai</server_name> <tool_name>OPENAI_INITIATE_CONNECTION</tool_name> <arguments>{}</arguments> </use_mcp_tool> <!-- Generate text with GPT --> <use_mcp_tool> <server_name>openai</server_name> <tool_name>OPENAI_CHAT_COMPLETION</tool_name> <arguments>{ "model": "gpt-4", "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Explain quantum computing in simple terms."} ], "temperature": 0.7 }</arguments> </use_mcp_tool> ``` ## Tool Usage Guidelines ### Primary Tools - `use_mcp_tool`: Use for all MCP server operations ``` <use_mcp_tool> <server_name>server_name</server_name> <tool_name>tool_name</tool_name> <arguments>{ "param1": "value1", "param2": "value2" }</arguments> </use_mcp_tool> ``` - `access_mcp_resource`: Use for accessing MCP resources ``` <access_mcp_resource> <server_name>server_name</server_name> <uri>resource://path/to/resource</uri> </access_mcp_resource> ``` - `apply_diff`: Use for code modifications with complete search and replace blocks ``` <apply_diff> <path>file/path.js</path> <diff> <<<<<<< SEARCH // Original code ======= // Updated code >>>>>>> REPLACE </diff> </apply_diff> ``` ### Secondary Tools - `insert_content`: Use for documentation and adding new content - `execute_command`: Use for testing API connections and validating integrations - `search_and_replace`: Use only when necessary and always include both parameters ## Detailed Documentation For detailed information about each MCP server and its available tools, refer to the individual documentation files in the `.roo/rules-mcp/` directory: - [GitHub](./rules-mcp/github.md) - [Supabase](./rules-mcp/supabase.md) - [Ahrefs](./rules-mcp/ahrefs.md) - [Gmail](./rules-mcp/gmail.md) - [YouTube](./rules-mcp/youtube.md) - [LinkedIn](./rules-mcp/linkedin.md) - [OpenAI](./rules-mcp/openai.md) - [Notion](./rules-mcp/notion.md) - [Slack](./rules-mcp/slack.md) - [Google Drive](./rules-mcp/google_drive.md) - [HackerNews](./rules-mcp/hackernews.md) - [Composio Search](./rules-mcp/composio_search.md) - [Mem0](./rules-mcp/mem0.md) - [PerplexityAI](./rules-mcp/perplexityai.md) - [CodeInterpreter](./rules-mcp/codeinterpreter.md) ## Best Practices 1. Always initiate a connection before attempting to use any MCP tools 2. Implement retry mechanisms with exponential backoff for transient failures 3. Use circuit breakers to prevent cascading failures 4. Implement request batching to optimize API usage 5. Use proper logging for all API operations 6. Implement data validation for all incoming and outgoing data 7. Use proper error codes and messages for API responses 8. Implement proper timeout handling for all API calls 9. Use proper versioning for API integrations 10. Implement proper rate limiting to prevent API abuse 11. Use proper caching strategies to reduce API calls