OpenAI MCP Server
An mcp-openai-server for connecting via Claude or similar
marchampson
README
OpenAI MCP Server
A Model Context Protocol (MCP) server implementation for the OpenAI API. This server provides a standardized interface between Augment and OpenAI's language models using the official MCP SDK.
What is MCP?
The Model Context Protocol (MCP) is a standardized API specification that provides a unified way to interact with various large language models (LLMs). It allows applications like Augment to work with different LLM providers through a consistent interface.
MCP acts as a "universal adapter" for LLMs - it translates application requests into the specific format each LLM provider requires.
Features
- 🔄 Uses the official MCP SDK for compatibility
- Secure API key management
- 📊 Support for chat completions
- 📋 Model listing
- 🧠 Embedding generation
- ⚠️ Proper error handling and logging
Prerequisites
- Node.js (v16 or higher)
- npm or yarn
- OpenAI API key
Installation
- Clone this repository or copy the files to your project directory
- Install dependencies:
npm install
- Create a
.env
file based on the.env.example
provided:
cp .env.example .env
- Add your OpenAI API key to the
.env
file:
OPENAI_API_KEY=your_openai_api_key_here
Running the Server
Start the server with:
npm start
For development with auto-restart on file changes:
npm run dev
Using with Augment
To use this MCP server with Augment, add the following to your Augment settings.json file:
"augment.advanced": {
"mcpServers": [
{
"name": "openai-mcp",
"command": "node",
"args": ["/path/to/openai-mcp-server.js"],
"env": {
"OPENAI_API_KEY": "your_openai_api_key_here",
"DEBUG": "true"
}
}
]
}
Replace /path/to/openai-mcp-server.js
with the actual path to the server file on your system.
Available Tools
This MCP server provides the following tools to Augment:
1. List Models
Lists all available OpenAI models.
2. Chat Completion
Generates responses using OpenAI's chat completion API. Supports parameters like:
model
: The model to use (e.g., gpt-3.5-turbo, gpt-4)messages
: Array of conversation messagestemperature
: Controls randomness (0-1)max_tokens
: Maximum number of tokens to generate
3. Create Embedding
Generates embeddings for text using OpenAI's embedding API. Supports parameters like:
model
: The model to use (e.g., text-embedding-ada-002)input
: The text to embed (string or array of strings)
Testing
A sample client is provided in client-example.js
to test your MCP server. Run it with:
node client-example.js
Understanding the Code
The server consists of several key components:
- MCP SDK Integration: Uses the official MCP SDK for standardized communication
- Tool Handlers: Implements handlers for each supported tool
- OpenAI API Integration: Communicates with OpenAI's API
- Error Handling: Provides consistent error responses
- Logging: Logs operations for debugging
Potential Improvements
See mcp-server-improvement-suggestions.md
for a list of potential improvements that could be made to this implementation.
License
MIT
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.
MCP Package Docs Server
Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.
Claude Code MCP
An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.
@kazuph/mcp-taskmanager
Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.
Linear MCP Server
Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.
mermaid-mcp-server
A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.
Jira-Context-MCP
MCP server to provide Jira Tickets information to AI coding agents like Cursor

Linear MCP Server
A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Sequential Thinking MCP Server
This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.