Skip to content

civicteam/agno-reference-implementation-civic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agno + Civic MCP Hub

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.

Prerequisites

  • Python 3.10+
  • A Civic account with a Hub token — sign up at nexus.civic.com
  • An Anthropic API key

Setup

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 .

Run

Single query (main.py):

python main.py

The agent connects to Civic's MCP Hub and lists the tool categories available to it.

Chat UI (chat.py):

uvicorn chat:app --reload

Open http://localhost:8000 for a browser-based chat interface.

Key implementation notes

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.

Environment variables

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

Learn more

About

Agno reference implementation for Civic

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages