https://github.com/pyroprompts/any-chat-completions-mcp
MCP Server for using any LLM as a Tool
https://github.com/pyroprompts/any-chat-completions-mcp
mcp mcp-server
Last synced: 2 months ago
JSON representation
MCP Server for using any LLM as a Tool
- Host: GitHub
- URL: https://github.com/pyroprompts/any-chat-completions-mcp
- Owner: pyroprompts
- License: mit
- Created: 2024-12-02T03:40:01.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-05-01T02:39:27.000Z (6 months ago)
- Last Synced: 2025-08-17T03:39:45.182Z (2 months ago)
- Topics: mcp, mcp-server
- Language: JavaScript
- Homepage:
- Size: 23 MB
- Stars: 140
- Watchers: 0
- Forks: 20
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-mcp-servers - Any Chat Completions MCP - An MCP server for chatting with any OpenAI SDK compatible Chat Completions API, including Perplexity, Groq, and xAI, enabling connection to multiple AI providers through a unified OpenAI-compatible API interface using the Model Context Protocol. ([Read more](/details/any-chat-completions-mcp.md)) `mcp` `chat` `openai` `ai-integration` (AI Integration MCP Servers)
- awesome-mcp-servers - OpenAI Compatible Chat - Chat with models from OpenAI-compatible APIs (Perplexity, Groq, xAI, etc.) (🤝 <a name="ai-services"></a>AI Services)
- awesome-mcp-servers - **any-chat-completions-mcp** - MCP Server for using any LLM as a Tool `api` `http` `ai` `openai` `git` `npm install pyroprompts/any-chat-completions-mcp` (AI/ML)
- awesome-mcp-servers - **any-chat-completions-mcp** - MCP Server for using any LLM as a Tool `api` `http` `ai` `openai` `git` `npm install pyroprompts/any-chat-completions-mcp` (AI/ML)
- awesome-mcp-zh - pyroprompts/any-chat-completions-mcp
- best-of-mcp-servers - GitHub
- awesome-mcp-servers - pyroprompts/any-chat-completions-mcp - Chat with any other OpenAI SDK Compatible Chat Completions API, like Perplexity, Groq, xAI and more (Legend / 🛠️ <a name="other-tools-and-integrations"></a>Other Tools and Integrations)
- awesome-mcp-servers - pyroprompts/any-chat-completions-mcp - Chat with any other OpenAI SDK Compatible Chat Completions API, like Perplexity, Groq, xAI and more (Legend / 🛠️ <a name="other-tools-and-integrations"></a>Other Tools and Integrations)
- awesome-mcp-servers - any-chat-completions-mcp - Chat with any other OpenAI SDK Compatible Chat Completions API, like Perplexity, Groq, xAI and more (Community Servers)
- awesome-mcp-servers - any-chat-completions-mcp - Chat with any other OpenAI SDK Compatible Chat Completions API, like Perplexity, Groq, xAI and more (Community Servers)
- awesome-mcp-servers - pyroprompts/any-chat-completions-mcp - Perplexity、Groq、xAIなどの他のOpenAI SDK互換のチャット完了APIとチャット (サーバー実装 / 🛠️ <a name="other-tools-and-integrations"></a>その他のツールと統合)
- awesome-mcp-servers - AnyChat Completions MCP - Integrates various AI chat APIs (OpenAI, Perplexity, etc.) with Claude via the Model Context Protocol (Table of Contents / AI Services)
- Awesome-MCP-Servers-directory - Any Chat Completions - Interact with any OpenAI SDK Compatible Chat Completions API like OpenAI, Perplexity, Groq, xAI and many more (AI Services)
- mcp-index - Any OpenAI Compatible API Integrations - Integrates various AI chat providers compatible with OpenAI SDKs for chat completion tasks. It relays questions to configured AI Chat Providers through a unified interface. (Cloud Services)
- awesome-mcp - pyroprompts/any-chat-completions-mcp - Chat with any other OpenAI SDK Compatible Chat Completions API, like Perplexity, Groq, xAI and more (MCP Servers / 🛠️ Other Tools and Integrations)
README
# any-chat-completions-mcp MCP Server
Integrate Claude with Any OpenAI SDK Compatible Chat Completion API - OpenAI, Perplexity, Groq, xAI, PyroPrompts and more.
This implements the Model Context Protocol Server. Learn more: [https://modelcontextprotocol.io](https://modelcontextprotocol.io)
This is a TypeScript-based MCP server that implements an implementation into any OpenAI SDK Compatible Chat Completions API.
It has one tool, `chat` which relays a question to a configured AI Chat Provider.
[](https://smithery.ai/server/any-chat-completions-mcp-server)
## Development
Install dependencies:
```bash
npm install
```Build the server:
```bash
npm run build
```For development with auto-rebuild:
```bash
npm run watch
```## Installation
To add OpenAI to Claude Desktop, add the server config:
On MacOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
On Windows: `%APPDATA%/Claude/claude_desktop_config.json`
You can use it via `npx` in your Claude Desktop configuration like this:
```json
{
"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"
}
}
}
}
```Or, if you clone the repo, you can build and use in your Claude Desktop configuration like this:
```json
{
"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"
}
}
}
}
```You can add multiple providers by referencing the same MCP server multiple times, but with different env arguments:
```json
{
"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"
}
}
}
}
```With these three, you'll see a tool for each in the Claude Desktop Home:

And then you can chat with other LLMs and it shows in chat like this:

Or, configure in [LibreChat](https://www.librechat.ai/) like:
```yaml
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'
````And it shows in LibreChat:

### Installing via Smithery
To install Any OpenAI Compatible API Integrations for Claude Desktop automatically via [Smithery](https://smithery.ai/server/any-chat-completions-mcp-server):
```bash
npx -y @smithery/cli install any-chat-completions-mcp-server --client claude
```### Debugging
Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the [MCP Inspector](https://github.com/modelcontextprotocol/inspector), which is available as a package script:
```bash
npm run inspector
```The Inspector will provide a URL to access debugging tools in your browser.
### Acknowledgements
- Obviously the modelcontextprotocol and Anthropic team for the MCP Specification and integration into Claude Desktop. [https://modelcontextprotocol.io/introduction](https://modelcontextprotocol.io/introduction)
- [PyroPrompts](https://pyroprompts.com?ref=github-any-chat-completions-mcp) for sponsoring this project. Use code `CLAUDEANYCHAT` for 20 free automation credits on Pyroprompts.