
mcp_client
MCP client sample for OpenAI Agents SDK
Repository Info
About This Server
MCP client sample for OpenAI Agents SDK
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
MCP Client
This project is an implementation of an MCP (Model Context Protocol) client for OpenAI Agents SDK.
Features
- Dynamic and Flexible Configuration: Effortlessly add or modify MCP servers through a simple configuration file. Explore a curated list of powerful MCP servers here and orchestrate them seamlessly to suit your needs.
- Supports agent orchestration, allowing multiple agents to collaborate and delegate tasks.
- Easy integration with OpenAI Agents SDK.
- Scalable design to handle complex workflows with multiple agents.
- Customizable agent instructions and behavior.
Requirements
- Python 3.8 or higher
- OpenAI Agents SDK (
pip install openai-agents)
Usage
Make configuration file (config.json)
{
"agents": [
{
"name": "agent1",
"model": "model_name",
"instructions": "Agent 1 instructions",
"cache_tools_list": true,
"assistants": ["agent2"],
"mcp_servers": [
{
"command": "path/to/command",
"args": ["--arg1", "value1"]
}
]
},
{
"name": "agent2",
"model": "model_name",
"instructions": "Agent 2 instructions",
"cache_tools_list": false,
"assistants": [],
"mcp_servers": [
{
"command": "path/to/command",
"args": ["--arg2", "value2"]
}
]
}
],
"starting_agent": "agent1"
}
Explanation of Fields
- agents: A list of agent configurations.
- name: The unique name of the agent.
- model: The model associated with the agent.
- instructions: Instructions or description for the agent.
- cache_tools_list: A boolean indicating whether to cache the tools list.
- assistants: A list of other agents that this agent can hand off tasks to.
- mcp_servers: A list of MCP server configurations.
- command: The command to start the MCP server.
- args: A list of arguments for the command.
- starting_agent: The name of the agent to start the workflow.
Notes
- Ensure that all agents listed in the assistants field exist in the agents list.
- Warning: Circular dependencies between agents may lead to infinite loops during execution. Ensure that the configuration avoids such scenarios.
Run the client with:
export OPENAI_API_KEY=<Your API KEY>
python main.py <config_file>
Use exit, quit, or q to terminate the program during execution.
Quick Start
Clone the repository
git clone https://github.com/exyrias/mcp_clientInstall dependencies
cd mcp_client
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.