Any-Chat Completions MCP

By pyropromptsCreated 4 days ago
starstarstarstarstar

Chat with any OpenAI-compatible Chat Completions API (Perplexity, Groq, xAI, …).

Visit Project
Share this MCP:
X (Formerly Twitter)RedditblueskyThreads by Instagram

Category

Community MCP Server

Tags

Chat ApiLlm IntegrationMcpClaudedesktopLibrechat

What is Any-Chat Completions MCP?

Any-Chat Completions MCP is a TypeScript-based MCP server that allows integration with any OpenAI SDK-compatible chat completion API (OpenAI, Perplexity, Groq, xAI, PyroPrompts, etc.) and facilitates communication between these APIs and applications like Claude Desktop or LibreChat.

How to use Any-Chat Completions MCP?

  1. Install dependencies: npm install
  2. Build the server: npm run build (or npm run watch for development)
  3. Configure the server in your application (e.g., Claude Desktop, LibreChat) by adding server configurations in JSON or YAML format with environment variables for API keys, model names, and base URLs.
  4. Use the server to relay messages from the host application to your selected chat completion API.

Installation for Claude Desktop:

{
  "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"
      }
    }
  }
}

Installation for 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'

Key Features of Any-Chat Completions MCP

  • API Agnostic: Works with any OpenAI SDK-compatible chat completion API (Perplexity, Groq, xAI, etc.).
  • MCP Protocol Support: Implements the Model Context Protocol (MCP) for seamless integration with Claude Desktop and other host applications.
  • Multiple Providers: Supports configuration of multiple AI providers with different keys, models, and base URLs in a single setup.
  • Tools for Debugging: Includes an MCP Inspector for debugging stdio communications.

Use Cases of Any-Chat Completions MCP

  1. Extend Claude Desktop with additional AI models (e.g., OpenAI, Perplexity).
  2. Integrate custom OpenAI-compatible chat completion APIs into LibreChat or other applications.
  3. Enable communication between different AI providers and host applications using MCP.
  4. Rapid prototyping and testing of chat completion integrations.

FAQ from Any-Chat Completions MCP

  • Can I use any OpenAI-compatible API with this server?

Yes, it supports any API compatible with the OpenAI SDK.

  • Do I need authentication for each provider?

Yes, you must provide an API key for each provider via environment variables.

  • How do I debug MCP communications?

Use the built-in MCP Inspector (npm run inspector) for debugging.

  • Is this free to use?

Yes, but API usage fees apply for the respective providers (e.g., OpenAI, Perplexity).

  • Can I contribute to this project?

Yes, the project is open-source on GitHub and welcomes contributions.