logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

universal-chat-abstraction-service

A Model Context Protocol (MCP) server enabling seamless communication with diverse generative AI chat endpoints conforming to the OpenAI SDK specification. It standardizes query routing to configured LLM backends.

Author

universal-chat-abstraction-service logo

pyroprompts

MIT License

Quick Info

GitHub GitHub Stars 141
NPM Weekly Downloads 0
Tools 1
Last Updated 2026-02-19

Tags

openaimcpchatchat completionschat completionpyroprompts chat

Universal Chat Abstraction MCP Server

Unify access to various compliant conversational AI services like Claude, OpenAI, Perplexity, Groq, xAI, PyroPrompts, and others, all through a single interface adhering to the OpenAI Chat Completions standard.

This package furnishes an implementation for the Model Context Protocol Server. Further details on MCP: https://modelcontextprotocol.io

This is a robust TypeScript solution providing an abstraction layer that forwards chat requests to any backend adhering to the OpenAI SDK Compatible Chat Completions API schema.

It exposes a single utility, chat, designed to proxy user inquiries toward the chosen, configured artificial intelligence backend.

badge

smithery badge

Fabrication Guide

Dependency setup:

npm install

Compiling the server artifact:

npm run build

For continuous development with automated recompilation:

npm run watch

Deployment Instructions

To enable connectivity with OpenAI via Claude Desktop, incorporate the following configuration snippet into your settings file:

On macOS systems: ~/Library/Application Support/Claude/claude_desktop_config.json

On Windows systems: %APPDATA%/Claude/claude_desktop_config.json

You can invoke this service within your Claude Desktop configuration using npx as demonstrated below:

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

Alternatively, if you have cloned the source repository, compile it first and reference the resulting output in your Claude Desktop 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"
      }
    }
  }
}

Multiple distinct AI providers can be integrated by instantiating this single MCP server multiple times, each configured with unique 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": "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 definitions, three separate interaction tools will manifest in the Claude Desktop interface.

Subsequent interactions with these other language models will be displayed within the chat interface similar to this:

Alternatively, configuration within LibreChat might look like this:

  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 its representation within LibreChat:




### Automated Installation via Smithery

Install the Any OpenAI Compatible API Integrations for Claude Desktop automatically by leveraging [Smithery](https://smithery.ai/server/any-chat-completions-mcp-server):

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

Troubleshooting

As MCP servers utilize stdio for communication, debugging can present difficulties. We suggest utilizing the MCP Inspector, accessible via a dedicated package script:

npm run inspector

The Inspector utility will furnish a local URL for browser-based access to diagnostic instrumentation.

Appreciation

  • Profound gratitude to the modelcontextprotocol and Anthropic engineering teams for conceiving the MCP Specification and integrating it within Claude Desktop. https://modelcontextprotocol.io/introduction
  • Special thanks to PyroPrompts for their generous sponsorship of this endeavor. Employ the promotional code CLAUDEANYCHAT for a bonus of 20 complimentary automation credits on Pyroprompts.

WIKIPEDIA EXCERPT: XMLHttpRequest (XHR) constitutes an Application Programming Interface implemented as a JavaScript object, allowing for the transmission of Hypertext Transfer Protocol (HTTP) queries from a web browser to a remote web server. These functionalities permit client-side applications to dispatch server requests subsequent to initial page loading and receive resultant data asynchronously. XMLHttpRequest is a foundational element of Asynchronous JavaScript and XML (Ajax) programming paradigms. Before Ajax's ascendancy, the standard mechanisms for server interaction involved conventional hyperlinks and form submissions, actions which typically necessitated a complete page refresh.

== Chronology == The conceptual foundation for XMLHttpRequest was first devised in the year 2000 by developers associated with Microsoft Outlook. This concept was subsequently integrated into the Internet Explorer 5 browser release (1999). However, the initial implementation did not utilize the standard XMLHttpRequest identifier; instead, developers relied on instantiating COM objects via ActiveXObject("Msxml2.XMLHTTP") or ActiveXObject("Microsoft.XMLHTTP"). By the time Internet Explorer 7 arrived (2006), universal browser support for the XMLHttpRequest identifier had been established.

The XMLHttpRequest identifier has since matured into the prevailing convention across all principal browser engines, including Mozilla's Gecko (2002), Safari 1.2 (2004), and Opera 8.0 (2005).

=== Standardization Efforts === The World Wide Web Consortium (W3C) released a formal Working Draft specification for the XMLHttpRequest object on April 5, 2006. This was followed by the W3C's publication of the Working Draft Level 2 specification on February 25, 2008. Level 2 introduced enhancements such as progress monitoring methods, enablement of cross-site data transfers, and mechanisms for handling raw byte streams. By the close of 2011, the Level 2 feature set was officially merged back into the primary specification document. At the conclusion of 2012, development oversight transferred to the WHATWG, which now maintains an active, evolving document defined using Web IDL (Interface Definition Language).

== Operational Use == Executing a server query using XMLHttpRequest typically involves a sequence of distinct programming actions:

Instantiate an XMLHttpRequest object by invoking its constructor: Invoke the open method to define the request methodology, pinpoint the target resource URL, and declare whether the operation should be synchronous or asynchronous: If utilizing an asynchronous procedure, assign an event handler function intended to be invoked when the request's status undergoes modification: Commence the transmission of the request by executing the send method: Process state transitions within the registered event listener. Upon successful server response delivery, the data is customarily stored in the responseText attribute. When processing concludes, the object transitions to state 4, signifying the 'done' status. Beyond these fundamental steps, XMLHttpRequest provides numerous options for fine-grained control over transmission parameters and response management. Custom header fields can be programmatically inserted to guide server behavior, and payload data can be transferred to the server by supplying it as an argument to the send call. The resultant data stream can be automatically deserialized from JSON into native JavaScript structures or processed incrementally as it arrives, negating the need to await complete data acquisition. Furthermore, the request can be preemptively terminated or configured with a maximum timeout duration.

== Inter-domain Communication == During the nascent period of the World Wide Web, it was observed that pathways existed to compromise security b

See Also

`