openai-agents-mcp
MCP server that bridges OpenAI's Agents SDK with Claude Code, enabling web search, file search, and computer use capabilities directly in your development environment.
README
OpenAI Agents MCP ๐ค
A Model Context Protocol (MCP) server that bridges OpenAI's Agents SDK with Claude Code and other MCP clients. Enable powerful AI agent capabilities including web search, file search, and computer use directly in your development environment.
๐ Quick Start
npx openai-agents-mcp
That's it! The server will start and be ready to accept MCP connections.
๐ฏ Features
- ๐ Web Search - Search the web using OpenAI's integrated web search capability
- ๐ File Search - Analyze and search through files with AI-powered understanding
- ๐ป Computer Use - Interact with computer interfaces (preview feature, requires tier 3-5)
- โก Real-time Streaming - Stream responses for better user experience
- ๐ง Claude Code Ready - Works seamlessly with Claude Code via stdio transport
- ๐งช Test-Driven - Comprehensive test suite with high coverage
- ๐ฆ NPX Compatible - Run directly without installation
๐ Prerequisites
- Node.js 18.0.0 or higher
- OpenAI API key
- For computer use: OpenAI usage tier 3-5
๐ง Installation & Setup
Option 1: NPX (Recommended)
No installation needed! Just run:
npx openai-agents-mcp
Option 2: Global Installation
npm install -g openai-agents-mcp
openai-agents-mcp
Option 3: From Source
git clone https://github.com/merlinrabens/openai-agents-mcp.git
cd openai-agents-mcp
npm install
npm run build
npm start
โ๏ธ Configuration
Environment Variables
Create a .env file in your project root:
# Required
OPENAI_API_KEY=sk-...your-key-here
# Optional
OPENAI_ORGANIZATION=org-... # Your org ID
ENABLE_COMPUTER_USE=true # Enable computer use (requires tier 3-5)
LOG_LEVEL=info # debug | info | warn | error
Claude Code Integration
Add to your Claude Code configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"openai-agents": {
"command": "npx",
"args": ["openai-agents-mcp"],
"env": {
"OPENAI_API_KEY": "sk-...your-key-here"
}
}
}
}
Then restart Claude Code to activate the server.
๐ก Usage Examples
Once configured, you can use these commands in Claude Code:
Web Search
Use the web_search tool to find the latest news about AI developments
File Search
Use the file_search tool to analyze this codebase and find all API endpoints
Computer Use (if enabled)
Use the computer_use tool to take a screenshot of the current screen
๐๏ธ Architecture
โโโโโโโโโโโโโโโ MCP Protocol โโโโโโโโโโโโโโโโ OpenAI API โโโโโโโโโโโโ
โ Claude Code โ โโโโโโโโโโโโโโโโโโโโบ โ This Server โ โโโโโโโโโโโโโโโโโโโบ โ OpenAI โ
โ or other โ stdio/HTTP โ โ Agents SDK โ Agents โ
โ MCP Client โ โ โ โ โ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโ
Key Components
- MCP Server Core - Handles MCP protocol using
@modelcontextprotocol/sdk - OpenAI Integration - Uses
@openai/agentsSDK for agent capabilities - Tool Translation - Maps MCP tool calls to OpenAI function calls
- Stream Handler - Manages real-time streaming responses
- Error Handler - Provides retry logic and graceful error handling
๐งช Development
Setup Development Environment
# Clone the repository
git clone https://github.com/merlinrabens/openai-agents-mcp.git
cd openai-agents-mcp
# Install dependencies
npm install
# Run in development mode
npm run dev
Available Scripts
npm run dev # Development mode with hot reload
npm test # Run test suite
npm run test:watch # Run tests in watch mode
npm run test:coverage # Generate coverage report
npm run build # Build for production
npm run lint # Run ESLint
npm run format # Format with Prettier
Project Structure
src/
โโโ server/ # MCP server implementation
โ โโโ index.ts # Main server class
โโโ openai/ # OpenAI Agents SDK integration
โ โโโ client.ts # OpenAI client wrapper
โโโ tools/ # Tool definitions
โโโ config/ # Configuration management
โโโ utils/ # Utilities and helpers
tests/ # Test suite
bin/ # CLI entry point
examples/ # Usage examples
๐ Testing
The project follows Test-Driven Development (TDD) principles:
# Run all tests
npm test
# Watch mode for development
npm run test:watch
# Coverage report
npm run test:coverage
Current test coverage: ~71%
๐ฐ Pricing
This server uses OpenAI's API, which has the following pricing (as of March 2025):
- Input: $3 per 1M tokens
- Output: $12 per 1M tokens
- Computer Use: Research preview (requires tier 3-5)
๐ค Contributing
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Write tests first (TDD approach)
- Implement your feature
- Ensure all tests pass
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
๐ License
MIT License - see LICENSE file for details
๐ Acknowledgments
Built with:
- Model Context Protocol SDK - The MCP protocol implementation
- OpenAI Agents SDK - OpenAI's agent framework
- Claude Code - Anthropic's AI-powered development environment
๐ Troubleshooting
Server won't start
- Ensure
OPENAI_API_KEYis set correctly - Check Node.js version is 18.0.0 or higher
- Run
npm run buildif running from source
Claude Code doesn't see the server
- Restart Claude Code after updating configuration
- Check the configuration file path is correct
- Verify the server starts without errors:
npx openai-agents-mcp
Computer use not working
- Verify your OpenAI account is tier 3-5
- Set
ENABLE_COMPUTER_USE=truein environment
๐ง Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Author: Merlin Rabens
๐ฆ Status
- โ Web Search - Fully functional
- โ File Search - Fully functional
- โ ๏ธ Computer Use - Preview (requires tier 3-5)
- ๐ง OpenAI Agents SDK - Preview as of March 2025
Note: The OpenAI Agents SDK is currently in preview. Features and pricing may change. The deprecated Assistants API will be sunset by mid-2026 in favor of the Agents SDK.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.