Connect a CrewAI agent to Civic’s MCP Hub using streamable HTTP transport
Connect a CrewAI agent to Civic using MCPClient with HTTP transport. CrewAI’s MCP integration wraps discovered tools with MCPToolWrapper to make them usable by CrewAI agents.
async def main(): tools = await get_civic_tools() llm = LLM( model="anthropic/claude-sonnet-4-6", api_key=os.environ["ANTHROPIC_API_KEY"], ) assistant = Agent( role="Personal Assistant", goal="Help the user with their tasks using available tools", backstory="You are a capable assistant with access to the user's connected services through Civic.", tools=tools, llm=llm, ) task = Task( description="What events do I have today?", expected_output="A list of today's calendar events.", agent=assistant, ) crew = Crew(agents=[assistant], tasks=[task]) result = crew.kickoff() print(result)asyncio.run(main())