Connect Agno agents to Civic's MCP Hub — giving your agents access to 85 MCP servers with built-in guardrails, audit trails, and instant revocation.
- Python 3.10+
- A Civic account with a Hub token — sign up at nexus.civic.com
- An Anthropic API key
git clone https://github.com/titus-civic/agno-reference-implementation-civic
cd agno-reference-implementation-civic
cp .env.example .env
# Edit .env and fill in CIVIC_TOKEN and ANTHROPIC_API_KEY
pip install -e .Single query (main.py):
python main.pyThe agent connects to Civic's MCP Hub and lists the tool categories available to it.
Chat UI (chat.py):
uvicorn chat:app --reloadOpen http://localhost:8000 for a browser-based chat interface.
MCPTools as async context manager
MCPTools must be used as an async with block — it handles the MCP session lifecycle:
async with MCPTools(
server_params=StreamableHTTPClientParams(
url=os.environ["CIVIC_URL"],
headers={"Authorization": f"Bearer {os.environ['CIVIC_TOKEN']}"},
),
transport="streamable-http",
) as mcp_tools:
agent = Agent(model=Claude(id="claude-sonnet-4-6"), tools=[mcp_tools])StreamableHTTPClientParams with transport="streamable-http"
Pass server_params=StreamableHTTPClientParams(...) and set transport="streamable-http" explicitly. Civic's MCP Hub uses Streamable HTTP (not SSE or stdio).
Authorization header
Pass your Civic token as a Bearer token in the headers dict inside StreamableHTTPClientParams.
| Variable | Description |
|---|---|
CIVIC_TOKEN |
Your Civic Hub token (from nexus.civic.com) |
CIVIC_URL |
MCP Hub endpoint (default: https://nexus.civic.com/hub/mcp) |
ANTHROPIC_API_KEY |
Your Anthropic API key |