Overview
civic-mcp-client is a Python MCP client for connecting to the Civic MCP Hub and exposing MCP tools to AI frameworks.
It supports:
- Direct Civic token authentication
- RFC 8693 token exchange (server-side only)
- Adapter-based integration with frameworks like LangChain, Pydantic AI, and FastMCP
Recommended (demo-first)
Start with the reference implementation: That demo uses Civic Auth in the frontend and forwards the authenticated Civic access token to a Python backend, which then passes it intoCivicMCPClient(auth={"token": ...}).
Install
Authentication
Civic Token (direct; manual token for local testing)
Generate a Civic Token
- Log in to app.civic.com
- Click your account name in the bottom left
- Go to Install → MCP URL
- Click Generate Token and copy it immediately — it won’t be shown again
Set Environment Variables
profile parameter:
Use the Token
Pass the token as a Bearer token in theAuthorization header:
Full credentials guide
Token generation, URL parameters, OAuth vs token comparison
CIVIC_TOKEN (docs) is the same value as access_token. In the python-civic-mcp-client repo, this value is named CIVIC_ACCESS_TOKEN.
Token Exchange (RFC 8693)
Token exchange is server-side only. Your Civic client secret must never be shipped to a browser or untrusted environment.Quick Start (manual token)
This quick start uses a manually generated Civic access token for local testing. For a production-like frontend + Python backend setup, use the demo app above.Framework Adapters
Useawait client.adapt_for(...) with the adapter for your framework.
Depending on the adapter, adapt_for(...) will either:
- Return a new
CivicMCPClient(backend adapters like FastMCP), or - Return adapter-native tool outputs (e.g. tool schemas / definitions)
LangChain / LangGraph
Pydantic AI
FastMCP
Next Steps
Deploy an agent (recommended)
- See the agent deployment guide: profile locking, URL parameters, and best practices
Get help
- Ask questions in our developer Slack

