any-chat-completions-mcp
by: pyroprompts
any chat completions mcp
📌Overview
Purpose: To integrate Claude with any OpenAI SDK compatible Chat Completion API, enabling users to connect and interact with various AI chat providers seamlessly.
Overview: The any-chat-completions-mcp server is a TypeScript-based implementation of the Model Context Protocol server, designed to enable communication with multiple AI chat providers through a unified interface. By leveraging this server, users can send queries to different AI models efficiently while maintaining a consistent experience across platforms.
Key Features:
-
Multi-Provider Compatibility: Allows integration with various AI chat providers, including OpenAI, PyroPrompts, and Perplexity, enhancing flexibility for users who wish to interact with multiple models.
-
Configurable Chat Providers: Users can easily configure multiple AI chat providers through JSON configuration, making it simple to switch or add new models without modifying underlying code.
-
Real-Time Communication: The server facilitates real-time communication with AI providers, enabling instant responses and interactive chat experiences within the Claude Desktop application.
-
Debugging Tools: Comes with built-in debugging support via the MCP Inspector, allowing developers to troubleshoot and optimize their configurations effectively.
any-chat-completions-mcp MCP Server
Integrate Claude with any OpenAI SDK Compatible Chat Completion API such as OpenAI, Perplexity, Groq, xAI, PyroPrompts, and more.
This server implements the Model Context Protocol (MCP). Learn more: https://modelcontextprotocol.io
It is a TypeScript-based MCP server that connects to any OpenAI SDK Compatible Chat Completions API. It provides one tool, chat
, which relays questions to a configured AI Chat Provider.
Development
Install dependencies:
npm install
Build the server:
npm run build
For development with auto-rebuild:
npm run watch
Installation
To add OpenAI to Claude Desktop, add the server configuration:
- On MacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- On Windows:
%APPDATA%/Claude/claude_desktop_config.json
Example configuration:
{
"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, with different environment variables:
{
"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": "llama-3.1-sonar-small-128k-online",
"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, you'll see a tool for each provider in the Claude Desktop Home.
Installing via Smithery
To install Any OpenAI Compatible API Integrations for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install any-chat-completions-mcp-server --client claude
Debugging
Since MCP servers communicate over stdio, debugging can be challenging. It is recommended to use the MCP Inspector, available as a package script:
npm run inspector
The Inspector will provide a URL to access debugging tools in your browser.
Acknowledgements
- The modelcontextprotocol and Anthropic teams for the MCP Specification and integration into Claude Desktop. https://modelcontextprotocol.io/introduction
- PyroPrompts for sponsoring this project. Use code
CLAUDEANYCHAT
for 20 free automation credits on PyroPrompts.