How to Use
- Copy the prompt below and paste it into your AI assistant
- Tell the assistant which agent framework you’re using (Anthropic SDK, LangChain, OpenAI Agents, etc.)
- The assistant will walk you through setting up your MCP connection with the correct code for your framework
- Configure security at app.civic.com — guardrails, toolkits, and audit are managed in the platform, not in code
Integration Prompt
client.messages.create (NOT client.beta.messages). The parameter is mcp_servers (not tools). Field is authorization_token, not { type: 'bearer', token }.
OpenAI Agents SDK (TypeScript)
openai is bundled as a dependency of @openai/agents — no separate install needed.
LangChain / LangGraph (Python)
pip install langchain-mcp-adapters langgraph
Pydantic AI (Python)
pip install pydantic-ai
Vercel AI SDK (TypeScript)
pnpm install ai @ai-sdk/anthropic @modelcontextprotocol/sdk
v6+: import experimental_createMCPClient from "@ai-sdk/mcp" instead of "ai".
Any Other Framework (Generic MCP)
pip install mcp
Interactive Clients (Claude Desktop, Cursor, VS Code, etc.)
No code needed. Add this MCP URL in your client’s MCP settings:Step 3: Configure Security (In the Platform, Not Code)
After connecting, the developer configures security at app.civic.com:- Guardrails: Block PII, credit cards, prompt injection; redact sensitive data from responses
- Toolkits: Group MCP servers into focused profiles (e.g., “support” = Gmail + Slack)
- Audit logs: Query what the agent did via Civic Chat
- Revocation: Instantly block tools, servers, or entire toolkits
Error Handling
When integrating Civic, add handling for these failure cases: Authentication failures — Token expired (30-day expiry) or missing. The MCP client will receive an HTTP 401. Handle by prompting the developer to regenerate the token at app.civic.com.?profile=your-toolkit, or the toolkit has no servers configured. Check CIVIC_URL includes the profile parameter.
Transport mismatch — Civic uses Streamable HTTP. If you see connection errors, verify your framework is not trying to connect via stdio or plain SSE.
Common Issues
- Auth errors: Token may be expired (30-day expiry). Regenerate at app.civic.com
- No tools: MCP URL may be missing
?profile=your-toolkit. Check the toolkit name - Connection errors: Civic uses Streamable HTTP transport, not stdio or plain SSE
- Docs: Full framework guides at https://docs.civic.com/civic/quickstart
All Framework Guides
- Anthropic SDK: https://docs.civic.com/civic/recipes/anthropic
- OpenAI Agents SDK: https://docs.civic.com/civic/recipes/openai-agents
- OpenAI SDK: https://docs.civic.com/civic/recipes/openai-sdk
- LangChain: https://docs.civic.com/civic/recipes/langchain
- Vercel AI SDK: https://docs.civic.com/civic/recipes/vercel-ai-sdk
- Pydantic AI: https://docs.civic.com/civic/recipes/pydantic-ai
- Google ADK: https://docs.civic.com/civic/recipes/google-adk
- CrewAI: https://docs.civic.com/civic/recipes/crewai
- Full list: https://docs.civic.com/civic/quickstart
Correct vs. Incorrect Output
After pasting the prompt, review what your AI assistant generates. Here’s how to tell if it got it right:- Correct
- Incorrect — Regenerate
Verify Your Integration
After the AI generates code, check these three things before running:1
Environment variables, not hardcoded tokens
Confirm
CIVIC_URL and CIVIC_TOKEN are read from process.env or os.environ — never hardcoded in source. If the AI put a token string directly in the code, move it to .env.2
Correct transport type
Civic uses Streamable HTTP, not stdio or plain SSE. Look for
streamable_http, StreamableHTTPClientTransport, or type: "url" in the generated code. If you see type: "stdio" or a subprocess spawn — that’s wrong.3
No invented APIs
The generated code should only call your framework’s standard MCP client methods (e.g.,
messages.create, hostedMcpTool, MCPServerStreamableHTTP). If it imports from civic, @civic/hub, or civic-guardrails — those packages don’t exist.What the AI Assistant Will Do
When you use this prompt, the AI assistant will:- Ask which framework you’re using (Anthropic SDK, OpenAI Agents, LangChain, etc.)
- Generate the connection code — typically 5-15 lines to connect to Civic via MCP
- Set up environment variables for your MCP URL and token
- Point you to app.civic.com for guardrail and toolkit configuration
Supported AI Assistants
This prompt has been tested with:- Claude (Anthropic)
- Cursor (with Claude)
- ChatGPT (OpenAI)
- GitHub Copilot Chat
Make sure your AI assistant has the ability to run terminal commands and edit files in your project.

