Use SettleGrid Tools with CrewAI
CrewAI natively supports MCP tool providers. Configure a CrewAI agent with SettleGrid as its MCP tool source to give your crew access to paid, production-grade AI tools with automatic billing.
In this guide
Install CrewAI
Install CrewAI with its tools extension. Run pip install crewai crewai-tools to get the full package with MCP support. CrewAI requires Python 3.10 or later. The crewai-tools package includes the MCP client that connects to SettleGrid.
Sign up for a SettleGrid account at settlegrid.ai/register if you do not have one. You need a consumer API key (starts with sg_) for each tool your crew will use. Generate keys from your dashboard — each key is scoped to a single tool for security and billing isolation.
Verify your installation by running python -c "from crewai import Agent, Task, Crew; print('OK')". CrewAI's MCP support is built into the core framework, so no additional plugins are needed.
Configure MCP Connection
CrewAI connects to MCP tool providers via its tool configuration. Create an MCP server configuration that points to SettleGrid's discovery server. The server URL is https://settlegrid.ai/api/mcp/sse and your API key is passed as a header.
The MCP configuration tells CrewAI where to discover tools, how to authenticate, and which transport to use. SettleGrid uses SSE (Server-Sent Events) transport, which CrewAI supports natively. Once configured, CrewAI discovers all available tools at startup and makes them available to your agents.
You can scope the discovery to specific categories by adding query parameters to the SSE URL. For example, https://settlegrid.ai/api/mcp/sse?category=code only discovers code analysis tools. This is useful for focused crews where you want agents to only see relevant tools.
Create Agents with SettleGrid Tools
Define your CrewAI agents and assign SettleGrid tools to them. Each agent gets a role, goal, and backstory that guide its behavior. The tools are passed directly to the agent, and the agent uses them based on its goal and the task it is assigned.
CrewAI's multi-agent architecture works well with SettleGrid because different agents can use different tools. A research agent might use data enrichment tools, while an analysis agent uses NLP tools. Each tool is billed independently through SettleGrid, so you get granular cost tracking per agent and per task.
For crews with multiple agents sharing the same tools, assign the tools at the crew level rather than the agent level. This is more efficient because CrewAI only discovers the tools once and shares them across all agents in the crew.
Create Tasks and Run the Crew
Define tasks for your crew and kick off execution. Each task has a description, expected output format, and an assigned agent. When the agent works on a task, it calls SettleGrid tools as needed. The billing is handled automatically — you do not need to manage API keys, balances, or metering in your task code.
CrewAI supports sequential, parallel, and hierarchical task execution. All modes work with SettleGrid tools. In sequential mode, agents execute tasks one at a time. In parallel mode, multiple agents can call SettleGrid tools simultaneously — the proxy handles concurrent requests without issues.
For long-running crews, monitor your SettleGrid balance. If an agent's tool call fails with a 402 (insufficient balance), CrewAI's error handling will surface the error in the task result. Set up auto-reload in your SettleGrid dashboard to prevent balance interruptions during crew runs.
View Billing and Optimize
After your crew finishes, visit the SettleGrid dashboard at settlegrid.ai/dashboard to review all tool calls. The dashboard shows each invocation with its cost, latency, and the tool that was called. You can filter by date range to see costs for a specific crew run.
Use the dashboard data to optimize your crew's tool usage. If one agent is making redundant tool calls, refine its role description or add explicit instructions to cache results. If a tool is consistently slow, consider switching to a faster alternative from the marketplace. If costs are higher than expected, check whether agents are calling tools unnecessarily.
Export your usage data via the API for cost attribution. If you run crews for multiple clients, the invocation records include metadata that lets you attribute costs to specific runs. This is useful for billing your own customers for the AI tool costs incurred on their behalf.
Code Examples
CrewAI with SettleGrid MCP tools
Pythonfrom crewai import Agent, Task, Crew
from crewai_tools import MCPServerAdapter
# Connect to SettleGrid's MCP discovery server
mcp_server = MCPServerAdapter(
server_url="https://settlegrid.ai/api/mcp/sse",
headers={"x-api-key": "sg_your_api_key_here"},
)
settlegrid_tools = mcp_server.tools
# Create agents with SettleGrid tools
researcher = Agent(
role="Research Analyst",
goal="Gather accurate real-time data using available tools",
backstory="You are an expert research analyst with access to "
"premium data tools via SettleGrid.",
tools=settlegrid_tools,
verbose=True,
)
writer = Agent(
role="Content Writer",
goal="Create clear, well-structured reports from research data",
backstory="You are a skilled writer who turns raw data into "
"actionable insights.",
verbose=True,
)
# Define tasks
research_task = Task(
description="Research the current weather conditions and "
"air quality in Tokyo, Japan.",
expected_output="A structured summary of weather and air quality data.",
agent=researcher,
)
report_task = Task(
description="Write a brief report based on the research findings.",
expected_output="A 200-word report with key findings and recommendations.",
agent=writer,
)
# Run the crew
crew = Crew(
agents=[researcher, writer],
tasks=[research_task, report_task],
verbose=True,
)
result = crew.kickoff()
print(result)Category-filtered tool discovery
Pythonfrom crewai import Agent, Task, Crew
from crewai_tools import MCPServerAdapter
# Only discover NLP tools
nlp_server = MCPServerAdapter(
server_url="https://settlegrid.ai/api/mcp/sse?category=nlp",
headers={"x-api-key": "sg_your_api_key_here"},
)
# Only discover data tools
data_server = MCPServerAdapter(
server_url="https://settlegrid.ai/api/mcp/sse?category=data",
headers={"x-api-key": "sg_your_data_key_here"},
)
# Assign different tool sets to different agents
nlp_agent = Agent(
role="NLP Specialist",
goal="Analyze text sentiment and extract entities",
backstory="Expert in natural language processing.",
tools=nlp_server.tools,
)
data_agent = Agent(
role="Data Analyst",
goal="Enrich and validate data from external sources",
backstory="Expert in data enrichment and validation.",
tools=data_server.tools,
)
# Create tasks and run the crew
analysis = Task(
description="Analyze the sentiment of this review: "
"'The product exceeded my expectations.'",
expected_output="Sentiment score and key entities.",
agent=nlp_agent,
)
crew = Crew(agents=[nlp_agent, data_agent], tasks=[analysis])
result = crew.kickoff()
print(result)Ready to integrate?
Sign up for SettleGrid, get your API key, and start using paid tools in CrewAI. Free tier includes 50,000 operations per month.