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's ticketing 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

uv add crewai 

Or using pip:

pip install crewai 

Authentication

Step 1: Generate a Service Key

Use your Unizo API key to generate a service key for MCP authentication:

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)

Category Selectors:

For different scopes, use the appropriate category type:

  • "type": "PLATFORM" - For platform operations
  • "type": "TICKETING" - For ticketing integrations
  • "type": "VMS" - For visitor management
  • "type": "OBSERVABILITY" - For observability tools
  • "type": "INFRA" - For infrastructure management

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:

UNIZO_SERVICE_KEY=your_service_key_from_displayId
OPENAI_API_KEY=your_openai_api_key

Quick Start

Connect to UNIZO MCP and create a CrewAI agent:

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

# Load environment variables
load_dotenv()

# Get Unizo service key from environment
UNIZO_SERVICE_KEY = os.getenv('UNIZO_SERVICE_KEY')

# 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": UNIZO_SERVICE_KEY,
"x-mcp-scopes": "ticketing"
}
)
],
verbose=True
)

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

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

# Execute the crew
if __name__ == "__main__":
result = crew.kickoff()
print(result)

You can enable multiple scopes by separating them with commas:

"x-mcp-scopes": "platform,ticketing,vms,observability,infra"

Multi-Agent with Different Scopes

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"
}
)
]
)

crew = Crew(
agents=[platform_agent, support_agent, infra_agent],
tasks=[task1, task2, task3],
verbose=True
)