# 🚀 CrewAI Enterprise MCP Server A Model Context Protocol (MCP) server that provides access to CrewAI Enterprise API for AI agent orchestration and task execution, deployed on the [Apify platform](https://docs.apify.com/platform/actors). This Actor enables you to: - Connect to your CrewAI Enterprise server via MCP - Start crew tasks with custom inputs - Monitor crew task status and results - Monetize your server using Apify's Pay Per Event (PPE) model ## ✨ Features - **CrewAI Integration**: Direct access to CrewAI Enterprise API endpoints - **Built-in charging**: Integrated [Pay Per Event (PPE)](https://docs.apify.com/platform/actors/publishing/monetize#pay-per-event-pricing-model) for: - Server startup - Tool calls (kickoff_crew, get_crew_status) - Tool listing - **Easy configuration**: Simple setup through Actor input or environment variables - **SSE Transport**: Exposes MCP server via Server-Sent Events for real-time communication ## 🛠 Available Tools ### `kickoff_crew` Start a new crew task with the provided inputs. **Parameters:** - `inputs` (object): Dictionary containing the query and other input parameters for the crew **Returns:** Dictionary containing the crew task response, including the crew ID needed to check status. ### `get_crew_status` Get the status of a crew task by its ID. **Parameters:** - `crew_id` (string): The ID of the crew task to check **Returns:** Dictionary containing the crew task status and results. ## 🚀 Quick Start ### 1. Configure the Actor Set up your CrewAI Enterprise server details either through: **Actor Input (Recommended):** - `crewaiServerUrl`: Your CrewAI Enterprise server URL (e.g., `https://your-crewai-server.com/api`) - `bearerToken`: Bearer token for authenticating with the CrewAI Enterprise API **Environment Variables:** - `MCP_CREWAI_ENTERPRISE_SERVER_URL`: CrewAI Enterprise server URL - `MCP_CREWAI_ENTERPRISE_BEARER_TOKEN`: Bearer token for authentication ### 2. Deploy and Enable Standby Mode 1. Deploy the Actor to Apify 2. Enable standby mode for the Actor 3. Note the Actor's standby URL ### 3. Connect Using an MCP Client Add the following configuration to your MCP client: ```json { "mcpServers": { "crewai-enterprise": { "url": "https://your-actor.apify.actor/sse" } } } ``` ### 4. Use the Tools Once connected, you can use the CrewAI tools in your MCP client: ```javascript // Start a crew task const result = await mcpClient.callTool("kickoff_crew", { inputs: { query: "Analyze market trends for Q1 2024", additional_context: "Focus on technology sector" } }); // Check crew status const status = await mcpClient.callTool("get_crew_status", { crew_id: result.crew_id }); ``` ## 💰 Pricing This Actor uses the [Pay Per Event (PPE)](https://docs.apify.com/platform/actors/publishing/monetize#pay-per-event-pricing-model) monetization model: - **Server startup**: $0.01 per startup - **Tool calls**: $0.05 per tool execution (kickoff_crew, get_crew_status) - **Tool listing**: $0.001 per list operation ## 🔧 Configuration ### Required Configuration You must provide either through Actor input or environment variables: 1. **CrewAI Server URL**: The endpoint URL of your CrewAI Enterprise server 2. **Bearer Token**: Authentication token for your CrewAI Enterprise API ### Optional Configuration The Actor automatically handles: - SSE transport setup - Error handling and retries - Charging for operations - Standby mode configuration ## 📚 Example Usage ### Starting a Crew Task ```python # Example crew inputs crew_inputs = { "task": "Research and analyze competitor pricing strategies", "context": { "industry": "SaaS", "company_size": "startup", "target_market": "SMB" }, "agents": ["researcher", "analyst", "writer"] } # Start the crew result = await kickoff_crew(crew_inputs) crew_id = result["crew_id"] ``` ### Monitoring Task Progress ```python # Check status periodically status = await get_crew_status(crew_id) if status["status"] == "completed": print("Task completed!") print("Results:", status["results"]) elif status["status"] == "running": print("Task still running...") print("Progress:", status.get("progress", "Unknown")) else: print("Task status:", status["status"]) ``` ## 🔗 Related Resources - [CrewAI Enterprise Documentation](https://docs.crewai.com/enterprise) - [Model Context Protocol Documentation](https://modelcontextprotocol.io) - [Apify MCP Documentation](https://docs.apify.com/platform/integrations/mcp) - [What is Anthropic's Model Context Protocol?](https://blog.apify.com/what-is-model-context-protocol/) ## 🚀 Deployment ### Using Apify CLI 1. Install Apify CLI: `npm install -g apify-cli` 2. Login: `apify login` 3. Deploy: `apify push` ### Using Git Integration 1. Connect your Git repository to Apify 2. Push changes to trigger automatic deployment 3. Configure environment variables in Apify Console ## 🛡️ Security - Bearer tokens are handled securely through Apify's secret management - All API communications use HTTPS - The Actor runs in an isolated container environment - No sensitive data is logged or stored ## 📞 Support For issues related to: - **CrewAI Enterprise**: Contact CrewAI support - **Apify Platform**: Check [Apify documentation](https://docs.apify.com) or [Discord community](https://discord.com/invite/jyEM2PRvMU) - **MCP Protocol**: See [MCP documentation](https://modelcontextprotocol.io) ## 📄 License This Actor is provided as-is under standard Apify terms. CrewAI Enterprise is a separate service with its own licensing terms.