modelscope·@NimbleBrainInc/mcp-openai
暂无描述。
MCP server providing comprehensive access to OpenAI's API capabilities.
pip install -r requirements.txt
cp .env.example .env
# Edit .env and add your OpenAI API key
.env fileStart the server:
# Set your API key
export OPENAI_API_KEY=your_api_key_here
# Run the server (default port 8000)
fastmcp run openai_server.py
# Or specify a custom port
fastmcp run openai_server.py --port 8080
The server will be available at http://localhost:8000
Add to your claude_desktop_config.json:
HTTP Configuration:
{
"mcpServers": {
"openai": {
"url": "http://localhost:8000"
}
}
}
Alternative - Direct Python (stdio):
If you need stdio mode instead of HTTP, you can run directly:
Windows (%APPDATA%\Claude\claude_desktop_config.json):
{
"mcpServers": {
"openai": {
"command": "python",
"args": ["-m", "fastmcp", "run", "openai_server.py"],
"env": {
"OPENAI_API_KEY": "your_api_key_here"
}
}
}
}
macOS (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"openai": {
"command": "python3",
"args": ["-m", "fastmcp", "run", "openai_server.py"],
"env": {
"OPENAI_API_KEY": "your_api_key_here"
}
}
}
}
Generate conversational responses using OpenAI's chat models.
Parameters:
messages (required): List of message objects with 'role' and 'content'model: Model name (default: "gpt-4o-mini")temperature: Creativity level 0-2 (default: 1.0)max_tokens: Maximum response lengthresponse_format: Optional "json_object" for JSON responsesExample:
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain quantum computing in simple terms."}
]
Generate vector embeddings for text.
Parameters:
text (required): Text to embedmodel: Embedding model (default: "text-embedding-3-small")Use Cases:
Create images from text descriptions using DALL-E.
Parameters:
prompt (required): Description of desired imagemodel: "dall-e-3" or "dall-e-2" (default: "dall-e-3")size: Image dimensions (1024x1024, 1792x1024, 1024x1792)quality: "standard" or "hd" (DALL-E 3 only)n: Number of images (1-10, only 1 for DALL-E 3)Convert text to natural-sounding audio.
Parameters:
text (required): Text to convertvoice: alloy, echo, fable, onyx, nova, shimmer (default: "alloy")model: "tts-1" or "tts-1-hd" (default: "tts-1")speed: Speech rate 0.25-4.0 (default: 1.0)Returns: Base64 encoded MP3 audio
Transcribe audio to text using Whisper.
Parameters:
audio_file_base64 (required): Base64 encoded audio filemodel: "whisper-1"language: Optional language code (auto-detected if not provided)response_format: json, text, srt, vtt, verbose_jsonAnalyze images using GPT-4 Vision.
Parameters:
image_url (required): URL of image to analyzeprompt: Question about the image (default: "What's in this image?")model: Vision model (default: "gpt-4o-mini")max_tokens: Maximum response lengthCheck if content violates OpenAI's usage policies.
Parameters:
text (required): Content to moderatemodel: "text-moderation-latest" or "text-moderation-stable"Returns: Flags and scores for various content categories
Get all available OpenAI models with metadata.
{
"messages": [
{"role": "system", "content": "You are a creative writing assistant."},
{"role": "user", "content": "Write a haiku about programming."}
],
"model": "gpt-4o",
"temperature": 0.8
}
{
"prompt": "A modern minimalist logo for a tech startup, blue and white color scheme, professional",
"model": "dall-e-3",
"size": "1024x1024",
"quality": "hd"
}
{
"text": "Wireless Bluetooth headphones with active noise cancellation and 30-hour battery life",
"model": "text-embedding-3-small"
}
{
"audio_file_base64": "<base64_encoded_audio>",
"language": "en",
"response_format": "verbose_json"
}
###…
暂无描述。
暂无描述。
暂无描述。
暂无描述。
一个模型上下文协议服务器,为使用微软Edge文本转语音技术的AI代理提供文本转语音功能,支持多种声音、语言和语音定制。
暂无描述。