mcp-openai-server

mcp-openai-server

0

The OpenAI MCP Server is designed to standardize interactions with OpenAI's language models through the Model Context Protocol (MCP). It provides secure key management, support for chat completions, model listing, and embedding generation using the official MCP SDK.

OpenAI MCP Server

A Model Context Protocol (MCP) server implementation for OpenAI's API to provide a standardized interface using the official MCP SDK.

Features

  • 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

  1. Clone the repository or copy files to your project.
  2. Install dependencies.
  3. Create a .env file and configure your OpenAI API key.

Running the Server

Start the server with npm and optional auto-restart for development.

Available Tools

  • List Models: List all available OpenAI models.
  • Chat Completion: Generate responses using OpenAI's chat completion API.
  • Create Embedding: Generate embeddings for text using OpenAI's embedding API.

Testing

Sample client provided in client-example.js.