For complete MCP Server documentation including all tools and configuration options, see the MCP Server guide. This page focuses on OpenAI Agents SDK-specific usage patterns.
Prerequisites
- Pica Account - Free account for managing integrations
- Python 3.10+ - Required for OpenAI Agents SDK
- OpenAI Agents SDK - Installed via pip
Installation
Quick Start
Create an agent with Pica’s MCP Server:Usage Patterns
Basic Agent with MCP Server
The simplest setup - an agent with access to all MCP tools:Example
Agent with Handoffs
Use multiple specialized agents with handoff capabilities. This example combines a Pica-powered integration agent with a text analysis agent:Example
Agent with Guardrails
Add validation and safety checks to your agent. This example blocks emails to restricted addresses:Example
Streaming Responses
Stream agent responses in real-time:Example
Multi-Session Support
Use sessions to maintain conversation history:Example
Configuration
The MCP server accepts configuration through environment variables:Full MCP configuration options
View all environment variables and configuration settings
Best Practices

Use specific instructions
Use specific instructions
Provide clear instructions about when and how to use Pica tools:
Implement guardrails
Implement guardrails
Always add guardrails for production agents to prevent:
- Destructive operations without confirmation
- Exposure of sensitive information
- Invalid or malicious requests
Use handoffs for complex workflows
Use handoffs for complex workflows
Split complex tasks across specialized agents:
- Data retrieval agent (read-only)
- Action execution agent (write operations)
- Coordinator agent (orchestrates handoffs)
Leverage sessions
Leverage sessions
Use sessions to maintain context across multiple interactions, making your agent feel more natural and contextual.
Enable tracing
Enable tracing
Use OpenAI Agents SDK’s built-in tracing to debug and monitor your agent:
Troubleshooting
MCP server not starting
MCP server not starting
Problem: Agent can’t connect to MCP server.Solutions:
- Ensure Node.js is installed:
node --version
- Verify PICA_SECRET is set:
echo $PICA_SECRET
- Check MCP server logs for errors
- Try running manually:
npx @picahq/mcp
Tools not available
Tools not available
Problem: Agent says Pica tools are not available.Solutions:
- Verify MCP server is added:
mcp_servers=[mcp]
in Agent - Check that PICA_SECRET is valid
- Ensure you have connections in Pica dashboard
Action execution failing
Action execution failing
Problem: execute_pica_action returns errors.Solutions:
- Always call get_pica_action_knowledge first
- Verify connection key is correct
- Check required parameters are provided
- Ensure connection is authenticated
Agent context too large
Agent context too large
Problem: Token limit exceeded.Solutions:
- Use more specific queries
- Limit number of actions searched
- Use streaming for long responses
- Consider using handoffs to specialized agents
What’s next?
MCP Server Documentation
Complete guide to Pica’s MCP Server tools and configuration
OpenAI Agents SDK Docs
Learn more about agents, handoffs, guardrails, and tracing
Browse available integrations
Explore the 150+ platforms available through Pica
Get help
Contact support for assistance with your implementation