OpenAI MCP
About
Provides a high-performance bridge between OpenAI and Anthropic models with prompt templating, response streaming, and efficient caching for applications requiring customizable LLM access.
Details
- Author
- arthurcolle
- Repository
- arthurcolle/openai-mcp
- GitHub stars
- 19
- Downloads
- 274
- Categories
- Design, Developer Tools, AI, Frontend, Infrastructure
- Tags
- #analytics, #integration
Jump to
- Interactive CLI for coding assistance
- Web API for integration with other applications
- Model Context Protocol (MCP) server implementation
- Replication support for high availability
- Tool-based architecture for extensibility
- Reinforcement learning for tool optimization
- Web client for browser-based interaction
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
OpenAI MCPCommand (node, npx, python, etc.)pythonArguments-
Argument 1
claude.py -
Argument 2
serve
Environment-
OPENAI_MODEL
gpt-4o -
OPENAI_API_KEY
your_openai_api_key_here -
ANTHROPIC_MODEL
claude-3-opus-20240229 -
ANTHROPIC_API_KEY
your_anthropic_api_key_here
Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
-
Argument 1
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Clone the repository, install dependencies with pip install -r requirements.txt, and set API keys in a .env file. Run in CLI mode with python claude.py chat, as an MCP server with python claude.py serve, as an MCP client with python claude.py mcp-client path/to/server.py, or in multi-agent mode with python claude.py mcp-multi-agent path/to/server.py --config config.json. Use flags like --provider, --model, and --budget to configure behavior.
View
Read files with optional line limits.
Edit
Modify files with precise text replacement.
Replace
Create or overwrite files.
GlobTool
Find files by pattern matching.
GrepTool
Search file contents using regex.
LS
List directory contents.
Bash
Execute shell commands.
Weather
Get current weather for a location.
JinaSearch
Web search using Jina.ai.
JinaFactCheck
Fact checking using Jina.ai.
JinaReadURL
Read and summarize webpages.
- View: Read files with optional line limits
- Edit: Modify files with precise text replacement
- Replace: Create or overwrite files
- GlobTool: Find files by pattern matching
- GrepTool: Search file contents using regex
- LS: List directory contents
- Bash: Execute shell commands
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"openai mcp": {
"env": {
"OPENAI_MODEL": "gpt-4o",
"OPENAI_API_KEY": "your_openai_api_key_here",
"ANTHROPIC_MODEL": "claude-3-opus-20240229",
"ANTHROPIC_API_KEY": "your_anthropic_api_key_here"
},
"args": [
"claude.py",
"serve"
],
"command": "python"
}
}
}
Linux
{
"env": {
"OPENAI_MODEL": "gpt-4o",
"OPENAI_API_KEY": "your_openai_api_key_here",
"ANTHROPIC_MODEL": "claude-3-opus-20240229",
"ANTHROPIC_API_KEY": "your_anthropic_api_key_here"
},
"args": [
"claude.py",
"serve"
],
"command": "python"
}
Macos
{
"env": {
"OPENAI_MODEL": "gpt-4o",
"OPENAI_API_KEY": "your_openai_api_key_here",
"ANTHROPIC_MODEL": "claude-3-opus-20240229",
"ANTHROPIC_API_KEY": "your_anthropic_api_key_here"
},
"args": [
"claude.py",
"serve"
],
"command": "python"
}
Windows
{
"env": {
"OPENAI_MODEL": "gpt-4o",
"OPENAI_API_KEY": "your_openai_api_key_here",
"ANTHROPIC_MODEL": "claude-3-opus-20240229",
"ANTHROPIC_API_KEY": "your_anthropic_api_key_here"
},
"args": [
"claude.py",
"serve"
],
"command": "python"
}
MCP Coding Assistant with support for OpenAI + other LLM Providers
A powerful Python recreation of Claude Code with enhanced real-time visualization, cost management, and Model Context Protocol (MCP) server capabilities. This tool provides a natural language interface for software development tasks with support for multiple LLM providers.
Key Features
- Multi-Provider Support: Works with OpenAI, Anthropic, and other LLM providers
- Model Context Protocol Integration:
- Run as an MCP server for use with Claude Desktop and other clients
- Connect to any MCP server with the built-in MCP client
- Multi-agent synchronization for complex problem solving
- Real-Time Tool Visualization: See tool execution progress and results in real-time
- Cost Management: Track token usage and expenses with budget controls
- Comprehensive Tool Suite: File operations, search, command execution, and more
- Enhanced UI: Rich terminal interface with progress indicators and syntax highlighting
- Context Optimization: Smart conversation compaction and memory management
- Agent Coordination: Specialized agents with different roles can collaborate on tasks
Installation
1. Clone this repository
2. Install dependencies:
pip install -r requirements.txt
3. Create a .env file with your API keys:
# Choose one or more providers
OPENAI_API_KEY=your_openai_api_key_here
ANTHROPIC_API_KEY=your_anthropic_api_key_here
Optional model selection
OPENAI_MODEL=gpt-4o
ANTHROPIC_MODEL=claude-3-opus-20240229
Usage
CLI Mode
Run the CLI with the default provider (determined from available API keys):
python claude.py chat
Specify a provider and model:
python claude.py chat --provider openai --model gpt-4o
Set a budget limit to manage costs:
python claude.py chat --budget 5.00
MCP Server Mode
Run as a Model Context Protocol server:
python claude.py serve
Start in development mode with the MCP Inspector:
python claude.py serve --dev
Configure host and port:
python claude.py serve --host 0.0.0.0 --port 8000
Specify additional dependencies:
python claude.py serve --dependencies pandas numpy
Load environment variables from file:
python claude.py serve --env-file .env
MCP Client Mode
Connect to an MCP server using Claude as the reasoning engine:
python claude.py mcp-client path/to/server.py
Specify a Claude model:
python claude.py mcp-client path/to/server.py --model claude-3-5-sonnet-20241022
Try the included example server:
# In terminal 1 - start the server
python examples/echo_server.py
In terminal 2 - connect with the client
python claude.py mcp-client examples/echo_server.py
Multi-Agent MCP Mode
Launch a multi-agent client with synchronized agents:
python claude.py mcp-multi-agent path/to/server.py
Use a custom agent configuration file:
python claude.py mcp-multi-agent path/to/server.py --config examples/agents_config.json
Example with the echo server:
# In terminal 1 - start the server
python examples/echo_server.py
In terminal 2 - launch the multi-agent client
python claude.py mcp-multi-agent examples/echo_server.py --config examples/agents_config.json
Available Tools
- View: Read files with optional line limits
- Edit: Modify files with precise text replacement
- Replace: Create or overwrite files
- GlobTool: Find files by pattern matching
- GrepTool: Search file contents using regex
- LS: List directory contents
- Bash: Execute shell commands
Chat Commands
- /help: Show available commands
- /compact: Compress conversation history to save tokens
- /version: Show version information
- /providers: List available LLM providers
- /cost: Show cost and usage information
- /budget [amount]: Set a budget limit
- /quit, /exit: Exit the application
Architecture
Claude Code Python Edition is built with a modular architecture:
/claude_code/
/lib/
/providers/ # LLM provider implementations
/tools/ # Tool implementations
/context/ # Context management
/ui/ # UI components
/monitoring/ # Cost tracking & metrics
/commands/ # CLI commands
/config/ # Configuration management
/util/ # Utility functions
claude.py # Main CLI entry point
mcp_server.py # Model Context Protocol server
Using with Model Context Protocol
Using Claude Code as an MCP Server
Once the MCP server is running, you can connect to it from Claude Desktop or other MCP-compatible clients:
1. Install and run the MCP server:
python claude.py serve
2. Open the configuration page in your browser:
http://localhost:8000
3. Follow the instructions to configure Claude Desktop, including:
- Copy the JSON configuration
- Download the auto-configured JSON file
- Step-by-step setup instructions
Using Claude Code as an MCP Client
To connect to any MCP server using Claude Code:
1. Ensure you have your Anthropic API key in the environment or .env file
2. Start the MCP server you want to connect to
3. Connect using the MCP client:
python claude.py mcp-client path/to/server.py
4. Type queries in the interactive chat interface
Using Multi-Agent Mode
For complex tasks, the multi-agent mode allows multiple specialized agents to collaborate:
1. Create an agent configuration file or use the provided example
2. Start your MCP server
3. Launch the multi-agent client:
python claude.py mcp-multi-agent path/to/server.py --config examples/agents_config.json
4. Use the command interface to interact with multiple agents:
- Type a message to broadcast to all agents
- Use
/talk Agent_Name message for direct communication- Use
/agents to see all available agents- Use
/history to view the conversation history
Contributing
1. Fork the repository
2. Create a feature branch
3. Implement your changes with tests
4. Submit a pull request
License
MIT
Acknowledgments
This project is inspired by Anthropic's Claude Code CLI tool, reimplemented in Python with additional features for enhanced visibility, cost management, and MCP server capabilities.# OpenAI Code Assistant
A powerful command-line and API-based coding assistant that uses OpenAI APIs with function calling and streaming.
Features
- Interactive CLI for coding assistance
- Web API for integration with other applications
- Model Context Protocol (MCP) server implementation
- Replication support for high availability
- Tool-based architecture for extensibility
- Reinforcement learning for tool optimization
- Web client for browser-based interaction
Installation
1. Clone the repository
2. Install dependencies:
pip install -r requirements.txt
3. Set your OpenAI API key:
export OPENAI_API_KEY=your_api_key
Usage
CLI Mode
Run the assistant in interactive CLI mode:
python cli.py
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





