Skip to main content

CrewAI

Connect Unizo MCP to CrewAI with built-in MCP server support.

Overview

CrewAI offers native MCP integration via the mcps field on agents, enabling your AI agents to access UNIZO MCP Tools.

Prerequisites

Before setting up the MCP integration, you'll need:

  • Unizo API Key: Used for authentication (found in the Unizo Console)
  • Python 3.10+: Required for CrewAI
  • OpenAI API Key: For the underlying LLM

Installation

pip install crewai

Or with uv:

curl --location 'https://api.unizo.ai/api/v1/serviceKeys' \
--header "apiKey: {unizo_api_key}" \
--header "Content-Type: application/json" \
--data '{
"name": "MCP Platform Integration",
"subOrganization": {
"name": "{YOUR_CUSTOMER_NAME}",
"externalKey": "{YOUR_CUSTOMER_UNIQUE_IDENTIFIER}"
},
"integration": {
"target": {
"categorySelectors": [
{
"type": "TICKETING"
}
]
}
}
}'

Required Parameters:

ParameterDescription
apiKeyYour Unizo API key (found in the Unizo Console)
nameDescriptive name for the integration (e.g., "MCP Platform Integration")
subOrganization.nameYour organization name (e.g., "Acme Inc")
subOrganization.externalKeyUnique identifier (UUID format recommended)

Response:

{
"state": "ACTIVE",
"displayId": "{UNIZO_SERVICE_KEY}",
...
}

Important: Save the displayId from the response — this is your service key for authenticating with the MCP server.

Step 2: Configure Environment Variables

Create a .env file in your project root:

OPENAI_API_KEY=your_openai_api_key

Quick Start

Connect to Unizo MCP using structured configuration:

import os
from crewai import Agent, Crew, Task
from crewai.mcp import MCPServerHTTP

# Load environment variables
load_dotenv()

# Create an agent with Unizo MCP integration
integration_agent = Agent(
role="Integration Specialist",
goal="Help users manage and understand their integrations using Unizo platform",
backstory="You are an expert at managing integrations, ticketing systems,through the Unizo platform.",
mcps=[
MCPServerHTTP(
url="https://api.unizo.ai/mcp",
headers={
"servicekey": os.getenv('UNIZO_SERVICE_KEY'),
"x-mcp-scopes": "TICKETING" # Comma-separated scopes (TICKETING, VMS, etc.)
}
)
]
)

# Create a task for the agent
integration_task = Task(
description="List all the TICKETING Connectors ",
agent=integration_agent,
expected_output="A detailed list of available TICKETING Connectors "
)

# Create and run crew
crew = Crew(
agents=[integration_agent],
tasks=[integration_task]
)

result = crew.kickoff()
print(result)

Headers

HeaderDescription
servicekeyYour Unizo service key (from the authentication step)
x-mcp-scopes (optional)Supported scopes include TICKETING, VMS, INCIDENT, SCM, PCR, COMMS, IDENTITY, OBSERVABILITY, KEY_MANAGEMENT, INFRA, EDR, STORAGE, and PLATFORM.

Note: If x-mcp-scopes is not specified, all scopes are enabled by default.

Multi-Agent with Different Scopes

from crewai import Agent, Task, Crew
from crewai.mcp import MCPServerHTTP

# Agent 1: Platform management
platform_agent = Agent(
role="Platform Manager",
goal="Manage integrations",
backstory="Platform expert",
mcps=[
MCPServerHTTP(
url="https://api.unizo.ai/mcp",
headers={
"servicekey": os.getenv('UNIZO_SERVICE_KEY'),
"x-mcp-scopes": "PLATFORM"
}
)
]
)

# Agent 2: Ticketing support
support_agent = Agent(
role="Support Specialist",
goal="Handle customer tickets",
backstory="Support expert",
mcps=[
MCPServerHTTP(
url="https://api.unizo.ai/mcp",
headers={
"servicekey": os.getenv('UNIZO_SERVICE_KEY'),
"x-mcp-scopes": "TICKETING"
}
)
]
)

# Agent 3: Infrastructure monitoring
infra_agent = Agent(
role="Infrastructure Engineer",
goal="Monitor infrastructure",
backstory="Infrastructure expert",
mcps=[
MCPServerHTTP(
url="https://api.unizo.ai/mcp",
headers={
"servicekey": os.getenv('UNIZO_SERVICE_KEY'),
"x-mcp-scopes": "INFRA,OBSERVABILITY"
}
)
]
)

#define tasks
...

# Create crew with sequential task execution
Multi_Agent_crew = Crew(
agents=[platform_agent, support_agent, infra_agent],
tasks=[task1, task2, task3],
verbose=True
)

result = Multi_Agent_crew.kickoff()