OpenAI API

v1.0.0Coding Agentsstable

Provides comprehensive access to OpenAI's API capabilities including chat completions, image generation, embeddings, text-to-speech, speech-to-text, vision analysis, and content moderation. Enables users to interact with GPT models, DALL-E, Whisper,

openai-mcp-servermcpai-integration
Share:
81
Stars
0
Downloads
0
Weekly
0/5

What is OpenAI API?

OpenAI API is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to provides comprehensive access to openai's api capabilities including chat completions, image generation, embeddings, text-to-speech, speech-to-text, vision analysis, and content moderation. enables us...

Provides comprehensive access to OpenAI's API capabilities including chat completions, image generation, embeddings, text-to-speech, speech-to-text, vision analysis, and content moderation. Enables users to interact with GPT models, DALL-E, Whisper,

This server falls under the Coding Agents and Developer Tools categories on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Provides comprehensive access to OpenAI's API capabilities i

Use Cases

Access GPT models and DALL-E
Generate images and transcribe speech
pierrebrunelle

Maintainer

LicenseMIT License
Languagepython
Versionv1.0.0
UpdatedApr 23, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx openai-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use OpenAI API

The OpenAI MCP Server is a Python-based MCP server that bridges Claude and other MCP clients to OpenAI's API, allowing AI assistants to query GPT language models directly within a conversation. Built on the Model Context Protocol, it lets Claude delegate tasks to OpenAI models, compare responses, or leverage GPT-specific capabilities without the user switching tools. Developers and researchers use it to run cross-model experiments, chain Claude reasoning with GPT outputs, or access OpenAI features from within their existing Claude workflow.

Prerequisites

  • Python 3.10 or higher with pip
  • An OpenAI API key with access to the models you want to query (available at platform.openai.com)
  • Git to clone the repository
  • An MCP client such as Claude Desktop
1

Clone the repository

Clone the mcp-server-openai repository from GitHub to your local machine.

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

Install the package

Install the server and its dependencies in editable mode using pip. This makes the src.mcp_server_openai module importable as a Python module.

pip install -e .
3

Obtain an OpenAI API key

Sign in to platform.openai.com, navigate to API keys, and create a new secret key. Keep it safe — it will be passed as an environment variable to the server.

4

Configure Claude Desktop

Add the server entry to claude_desktop_config.json. Set OPENAI_API_KEY to your key and set PYTHONPATH to the directory where you cloned the repository so the module can be found.

5

Verify the installation

Run the test suite from the project root to confirm the server can authenticate with OpenAI and return responses.

pytest -v test_openai.py -s

OpenAI API Examples

Client configuration

Add this block to claude_desktop_config.json. Replace /path/to/mcp-server-openai with the absolute path to your cloned repository, and set your OpenAI API key.

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

Prompts to try

Once the server is connected, use these prompts in Claude Desktop to interact with OpenAI models through the MCP server.

- "Use the OpenAI server to ask GPT-4o: what are the main differences between REST and GraphQL?"
- "Query the connected OpenAI model to summarize this text: [paste text here]."
- "Ask GPT via the MCP server to write a Python function that parses ISO 8601 dates."
- "Compare your answer with the OpenAI model's answer to: what is the best sorting algorithm for nearly sorted data?"

Troubleshooting OpenAI API

ModuleNotFoundError: No module named 'src.mcp_server_openai'

Ensure PYTHONPATH in claude_desktop_config.json points to the root of the cloned repository (the directory containing the src/ folder), not the src/ directory itself. Also confirm 'pip install -e .' completed without errors.

OpenAI authentication error: 'Invalid API key'

Double-check the OPENAI_API_KEY value in claude_desktop_config.json. The key must start with 'sk-' and must not have trailing spaces or newline characters. Regenerate the key at platform.openai.com/api-keys if needed.

Server appears in Claude Desktop but no response comes back from OpenAI queries

Run 'pytest -v test_openai.py -s' from the project root to check direct connectivity to the OpenAI API. Also verify your OpenAI account has available credits and the model name you are requesting is accessible on your plan.

Frequently Asked Questions about OpenAI API

What is OpenAI API?

OpenAI API is a Model Context Protocol (MCP) server that provides comprehensive access to openai's api capabilities including chat completions, image generation, embeddings, text-to-speech, speech-to-text, vision analysis, and content moderation. enables users to interact with gpt models, dall-e, whisper, It connects AI assistants to external tools and data sources through a standardized interface.

How do I install OpenAI API?

Follow the installation instructions on the OpenAI API GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with OpenAI API?

OpenAI API works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is OpenAI API free to use?

Yes, OpenAI API is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Coding Agents MCP Servers

Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "openai-mcp-server": { "command": "npx", "args": ["-y", "openai-mcp-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use OpenAI API?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides