CrewAI Integration
How to integrate CrewAI with Aluvia's MCP server for enhanced AI agent capabilities.
Setup Guide
1
Get your API token
- Go to Aluvia Dashboard
- Navigate to the Credentials page
- Copy your Aluvia Token (it looks like:
2dceb1aa0***************************)
2
Configure your MCP server
from crewai import Agent, Task, Crew
from crewai_tools import MCPServerAdapter
import os
# Replace with your actual Aluvia API key
ALUVIA_TOKEN = "your_aluvia_token_here"
server_params = {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://mcp.aluvia.io",
"--header",
f"Authorization: Bearer {ALUVIA_TOKEN}"
]
}
try:
with MCPServerAdapter(server_params) as mcp_tools:
print(f"Available tools: {[tool.name for tool in mcp_tools]}")
my_agent = Agent(
role="Aluvia Connectivity Manager",
goal="Manage and test connectivity credentials using Aluvia tools",
backstory="I specialize in managing Aluvia connectivity credentials and testing connectivity using MCP tools.",
tools=mcp_tools,
verbose=True,
llm="gpt-4o-mini",
)
task = Task(
description="List all available connectivity credentials in my Aluvia account and test one of them to verify it's working. Use list_proxy_credentials first, then test a credential using test_proxy_credential.",
expected_output="A summary of available connectivity credentials and the test results showing connection status, IP location, and response details.",
agent=my_agent
)
crew = Crew(
agents=[my_agent],
tasks=[task],
verbose=True
)
result = crew.kickoff()
print("\n=== RESULT ===")
print(result)
except Exception as e:
print(f"Error connecting to MCP server: {e}")
print("Make sure you have:")
print("1. Set your Aluvia Token correctly")
print("2. Installed Node.js on your system")
print("3. Internet connectivity to reach mcp.aluvia.io")
3
Test it works
- Run your CrewAI script with the Aluvia connectivity manager task
- The agent will use Aluvia tools to list and test your credentials
- You should see results with credential details and connectivity status