Skip to main content
Glama

any-chat-completions-mcp

by pyroprompts

any-chat-completions-mcp MCP 服务器

将 Claude 与任何 OpenAI SDK 兼容的聊天完成 API 集成 - OpenAI、Perplexity、Groq、xAI、PyroPrompts 等。

这实现了模型上下文协议服务器。了解更多信息: https://modelcontextprotocol.io

这是一个基于 TypeScript 的 MCP 服务器,可实现任何 OpenAI SDK 兼容聊天完成 API。

它有一个工具, chat ,将问题转发给配置的 AI 聊天提供商。

发展

安装依赖项:

npm install

构建服务器:

npm run build

对于使用自动重建的开发:

npm run watch

安装

要将 OpenAI 添加到 Claude Desktop,请添加服务器配置:

在 MacOS 上: ~/Library/Application Support/Claude/claude_desktop_config.json

在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json

您可以通过 Claude Desktop 配置中的npx使用它,如下所示:

{ "mcpServers": { "chat-openai": { "command": "npx", "args": [ "@pyroprompts/any-chat-completions-mcp" ], "env": { "AI_CHAT_KEY": "OPENAI_KEY", "AI_CHAT_NAME": "OpenAI", "AI_CHAT_MODEL": "gpt-4o", "AI_CHAT_BASE_URL": "https://api.openai.com/v1" } } } }

或者,如果您克隆 repo,则可以像这样在 Claude Desktop 配置中构建和使用:

{ "mcpServers": { "chat-openai": { "command": "node", "args": [ "/path/to/any-chat-completions-mcp/build/index.js" ], "env": { "AI_CHAT_KEY": "OPENAI_KEY", "AI_CHAT_NAME": "OpenAI", "AI_CHAT_MODEL": "gpt-4o", "AI_CHAT_BASE_URL": "https://api.openai.com/v1" } } } }

您可以通过多次引用同一个 MCP 服务器但使用不同的环境参数来添加多个提供程序:

{ "mcpServers": { "chat-pyroprompts": { "command": "node", "args": [ "/path/to/any-chat-completions-mcp/build/index.js" ], "env": { "AI_CHAT_KEY": "PYROPROMPTS_KEY", "AI_CHAT_NAME": "PyroPrompts", "AI_CHAT_MODEL": "ash", "AI_CHAT_BASE_URL": "https://api.pyroprompts.com/openaiv1" } }, "chat-perplexity": { "command": "node", "args": [ "/path/to/any-chat-completions-mcp/build/index.js" ], "env": { "AI_CHAT_KEY": "PERPLEXITY_KEY", "AI_CHAT_NAME": "Perplexity", "AI_CHAT_MODEL": "sonar", "AI_CHAT_BASE_URL": "https://api.perplexity.ai" } }, "chat-openai": { "command": "node", "args": [ "/path/to/any-chat-completions-mcp/build/index.js" ], "env": { "AI_CHAT_KEY": "OPENAI_KEY", "AI_CHAT_NAME": "OpenAI", "AI_CHAT_MODEL": "gpt-4o", "AI_CHAT_BASE_URL": "https://api.openai.com/v1" } } } }

有了这三个,您将在 Claude Desktop Home 中看到每个工具的一个工具:

带有聊天工具的 Claude Desktop Home

然后你就可以与其他 LLM 聊天,聊天中显示如下内容:

Claude 与 OpenAI 聊天

或者,在LibreChat中配置如下:

chat-perplexity: type: stdio command: npx args: - -y - @pyroprompts/any-chat-completions-mcp env: AI_CHAT_KEY: "pplx-012345679" AI_CHAT_NAME: Perplexity AI_CHAT_MODEL: sonar AI_CHAT_BASE_URL: "https://api.perplexity.ai" PATH: '/usr/local/bin:/usr/bin:/bin'

它在 LibreChat 中显示:

LibreChat 与困惑聊天

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装任何与 OpenAI 兼容的 API 集成:

npx -y @smithery/cli install any-chat-completions-mcp-server --client claude

调试

由于 MCP 服务器通过 stdio 进行通信,调试起来可能比较困难。我们推荐使用MCP Inspector ,它以包脚本的形式提供:

npm run inspector

检查器将提供一个 URL 来访问浏览器中的调试工具。

致谢

  • 显然,modelcontextprotocol 和 Anthropic 团队负责 MCP 规范并将其集成到 Claude Desktop。https ://modelcontextprotocol.io/introduction
  • 感谢PyroPrompts赞助本项目。使用优惠码CLAUDEANYCHAT即可在 PyroPrompts 上免费获得 20 个自动化积分。

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

将 Claude 与任何 OpenAI SDK 兼容的聊天完成 API 集成 - OpenAI、Perplexity、Groq、xAI、PyroPrompts 等。

  1. 发展
    1. 安装
      1. 通过 Smithery 安装
      2. 调试
      3. 致谢

    Related MCP Servers

    • A
      security
      A
      license
      A
      quality
      Enables integration of Perplexity's AI API with LLMs, delivering advanced chat completion by utilizing specialized prompt templates for tasks like technical documentation, code review, and API documentation.
      Last updated -
      1
      94
      8
      JavaScript
      MIT License
      • Linux
    • A
      security
      F
      license
      A
      quality
      A Node.js implementation that enables Claude to interact with Perplexity AI's language models through Anthropic's Model Context Protocol, providing tools for advanced chat completions and quick queries.
      Last updated -
      2
      6
      TypeScript
      • Apple
      • Linux
    • -
      security
      A
      license
      -
      quality
      MCP server that enables Claude to request chat completions with citations from the Perplexity API.
      Last updated -
      MIT License
      • Apple
    • -
      security
      F
      license
      -
      quality
      MCP ChatGPT Responses connects Claude to ChatGPT through two essential tools: standard queries for AI-to-AI conversations and web-enabled requests for current information. It uses OpenAI's Responses API to maintain conversation state automatically.
      Last updated -
      5
      Python

    View all related MCP servers

    MCP directory API

    We provide all the information about MCP servers via our MCP API.

    curl -X GET 'https://glama.ai/api/mcp/v1/servers/pyroprompts/any-chat-completions-mcp'

    If you have feedback or need assistance with the MCP directory API, please join our Discord server