Back to MCP Catalog

OpenAI API Access MCP Server

Developer ToolsPython
Query OpenAI models directly from Claude

This MCP server enables seamless integration between Claude and OpenAI's powerful language models. It acts as a bridge that allows Claude to make direct API calls to OpenAI models like GPT-4, giving you the ability to leverage both AI platforms simultaneously. With this integration, you can harness the unique strengths of OpenAI's models without leaving your Claude environment. This creates a powerful workflow where you can compare responses, use specialized capabilities from each platform, or create hybrid solutions that combine the best of both AI ecosystems.

Overview

The OpenAI MCP Server allows you to query OpenAI models directly from Claude using the Model Context Protocol (MCP). This integration enables you to leverage OpenAI's models alongside Claude, creating a powerful multi-model workflow.

Installation

Prerequisites

  • Python installed on your system
  • An OpenAI API key

Step 1: Clone the Repository

git clone https://github.com/pierrebrunelle/mcp-server-openai
cd mcp-server-openai

Step 2: Install the Package

pip install -e .

Step 3: Configure Claude Desktop

Add the following configuration to your claude_desktop_config.json file:

{
  "mcpServers": {
    "openai-server": {
      "command": "python",
      "args": ["-m", "src.mcp_server_openai.server"],
      "env": {
        "PYTHONPATH": "/path/to/your/mcp-server-openai",
        "OPENAI_API_KEY": "your-openai-api-key-here"
      }
    }
  }
}

Make sure to:

  • Replace /path/to/your/mcp-server-openai with the actual path to where you cloned the repository
  • Replace your-openai-api-key-here with your actual OpenAI API key

Usage

Once configured, you can use the OpenAI MCP Server directly from Claude. The server will handle the communication between Claude and OpenAI's API, allowing you to:

  1. Query OpenAI models for responses
  2. Compare outputs between Claude and OpenAI models
  3. Leverage specific capabilities of OpenAI models when needed

Testing

To verify that your installation is working correctly, you can run the included tests:

# Run tests from project root
pytest -v test_openai.py -s

A successful test will show output similar to:

Testing OpenAI API call...
OpenAI Response: Hello! I'm doing well, thank you for asking...
PASSED

Troubleshooting

If you encounter issues:

  1. Verify your OpenAI API key is valid and has sufficient credits
  2. Check that the PYTHONPATH in your configuration points to the correct directory
  3. Ensure Python can access the internet to reach OpenAI's API servers
  4. Check the Claude Desktop logs for any error messages related to the MCP server

Related MCPs

Apple Shortcuts
Developer ToolsJavaScript

Control Apple Shortcuts automations from AI assistants

Clojars Dependency Lookup
Developer ToolsJavaScript

Fetch dependency information from Clojars, the Clojure community's artifact repository

Simple Timeserver
Developer ToolsPython

Provides Claude with current time and timezone information

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.