MCP Connector

Connect to Any Chat Completion API

MCP server that lets Claude chat with any OpenAI-SDK-compatible provider - OpenAI, Perplexity, Groq, xAI, and more - via one chat tool per configured provider.

Works with openaiperplexitygroqxaipyroprompts

Maintainer of this project? Claim this page to edit the listing.


91
Spark score
out of 100
Updated May 2025
Version 0.1.1
Models
claudegpt 4o

Add to Favorites

Why it matters

Integrate Claude with any Chat Completion API compatible with the OpenAI SDK, enabling seamless interaction with multiple AI providers through a single interface.

Outcomes

What it gets done

01

Configure connections to OpenAI, Perplexity, Groq, xAI, and PyroPrompts.

02

Utilize a unified chat tool for diverse AI models.

03

Enable Claude to leverage various LLM providers.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-any-chat-completions | bash

Capabilities

Tools your agent gets

chat

Sends a question to the configured AI Chat provider compatible with OpenAI SDK

Overview

Any Chat Completions MCP Server

A TypeScript MCP server exposing a single chat tool per configured provider, relaying questions to any OpenAI SDK-compatible chat completions API - OpenAI, Perplexity, Groq, xAI, or a custom endpoint - configured entirely via environment variables. Use to call other LLM providers from within a Claude Desktop or LibreChat conversation. Requires an OpenAI-compatible chat completions endpoint; each provider needs its own separate server registration.

What it does

A TypeScript MCP server that integrates Claude with any OpenAI SDK-compatible chat completions API - OpenAI, Perplexity, Groq, xAI, PyroPrompts, and any other provider exposing an OpenAI-compatible endpoint. It implements a single tool, chat, which relays a question to whichever AI chat provider the server instance is configured for.

Because the server is configured entirely through environment variables (AI_CHAT_KEY, AI_CHAT_NAME, AI_CHAT_MODEL, AI_CHAT_BASE_URL), the same MCP server binary can be registered multiple times under different names in an MCP client's configuration - once per provider - each with its own API key, display name, model, and base URL. Registering three providers this way (PyroPrompts, Perplexity, and OpenAI, in the documented example) surfaces three distinct chat tools in Claude Desktop, one per provider, so a single Claude conversation can call out to any of them by name.

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

Beyond Claude Desktop, the same configuration pattern works in LibreChat, using a stdio-type YAML entry with the equivalent AI_CHAT_* environment variables (the documented example configures a Perplexity sonar model this way).

When to use - and when NOT to

Use this connector when you want to call other LLM providers from within a Claude conversation - comparing responses, delegating a question to a model better suited to it (e.g. Perplexity for web-grounded search, a cheaper Groq/xAI model for simple tasks), or integrating a custom OpenAI-compatible endpoint like PyroPrompts. It only works with providers that expose an OpenAI-compatible chat completions API; providers with a fundamentally different API shape are out of scope. Each provider needs its own separate server registration (with its own API key and base URL) rather than one server handling multiple providers dynamically.

Capabilities

AI_CHAT_NAME doubles as the label Claude Desktop shows for that provider's tool, so naming each registration distinctly (e.g. "OpenAI," "Perplexity") is what makes multiple providers show up as clearly distinguishable tools in the same conversation rather than one ambiguous "chat" entry repeated three times.

How to install

Run directly via npx @pyroprompts/any-chat-completions-mcp in an mcpServers entry, or clone the repository, npm install, npm run build, and point the config at the built build/index.js with Node.js. Automatic installation for Claude Desktop is also available via Smithery (npx -y @smithery/cli install any-chat-completions-mcp-server --client claude). Configuration lives entirely in the env block of the server entry: AI_CHAT_KEY (provider API key), AI_CHAT_NAME (display name for the tool), AI_CHAT_MODEL (model identifier), and AI_CHAT_BASE_URL (the provider's OpenAI-compatible API base URL). Since MCP servers communicate over stdio, debugging is done via the MCP Inspector (npm run inspector), which opens a browser-based debugging URL.

Who it's for

Claude Desktop or LibreChat users who want to call out to other LLM providers - OpenAI, Perplexity, Groq, xAI, or any OpenAI-compatible endpoint - from within the same conversation, without switching tools or writing custom integration code per provider.

Source 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

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.

smithery badge

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 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:

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


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


{
  "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 like:

  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:

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, which is available as a package script:

npm run inspector

The Inspector will provide a URL to access debugging tools in your browser.

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.