Skip to main content

Overview

CrewAI includes native MCP support via the mcps parameter on agents, enabling direct integration with StackOne’s MCP server. Official Docs

Installation

uv add crewai

Quick Start

Connect to StackOne MCP and create a crew with MCP tools:
import os
import base64
from crewai import Agent, Crew, Task
from crewai.mcp import MCPServerStreamableHTTP

# Configure StackOne account
STACKONE_ACCOUNT_ID = "<account_id>"  # Your StackOne account ID

# Encode API key for Basic auth
auth_token = base64.b64encode(
    f"{os.getenv('STACKONE_API_KEY')}:".encode()
).decode()

# Create agent with StackOne MCP server
data_agent = Agent(
    role="Platform Data Analyst",
    goal="Analyze data from connected platforms and provide insights",
    backstory="Expert in cross-platform data integration and analysis",
    mcps=[
        MCPServerStreamableHTTP(
            url="https://api.stackone.com/mcp",
            headers={
                "Authorization": f"Basic {auth_token}",
                "x-account-id": STACKONE_ACCOUNT_ID,
                "MCP-Protocol-Version": "2025-06-18"
            }
        )
    ]
)

# Create task
analysis_task = Task(
    description="Search recent calls in Gong and summarize key insights",
    agent=data_agent,
    expected_output="A summary of recent call activities and insights"
)

# Create and run crew
crew = Crew(
    agents=[data_agent],
    tasks=[analysis_task]
)

result = crew.kickoff()
print(result)

Environment Variables

STACKONE_API_KEY=<stackone_api_key>
OPENAI_API_KEY=your_openai_key

Resources

Next Steps