MCP-Bridge

MCP-Bridge: Seamlessly connect OpenAI API to MCP tools. Simplify AI model integration with any client.

MCP-Bridge
MCP-Bridge Capabilities Showcase

MCP-Bridge Solution Overview

MCP-Bridge is a versatile tool designed to seamlessly connect AI models with the MCP ecosystem via the OpenAI API. Functioning as a bridge, it allows developers to utilize MCP tools without requiring explicit MCP support in their clients. This is achieved by translating OpenAI API requests into MCP tool calls, and vice versa.

Key features include support for both streaming and non-streaming chat completions, MCP tool integration, and MCP sampling. MCP-Bridge simplifies the integration process, enabling any client to interact with any MCP tool. It offers REST API endpoints for native MCP primitives and an SSE bridge for external clients, streamlining the management of MCP servers.

By using MCP-Bridge, developers can leverage the power of MCP tools within existing OpenAI API workflows, enhancing AI model capabilities and reducing integration complexities. It can be installed via Docker or manually, and configured to manage various MCP servers through a simple configuration file.

MCP-Bridge Key Capabilities

OpenAI API Compatibility

MCP-Bridge acts as a translator, enabling AI models and applications designed for the OpenAI API to seamlessly interact with MCP tools. It exposes a set of REST API endpoints that mirror the OpenAI API structure, allowing developers to use existing OpenAI client libraries and tools without modification. This compatibility extends to both non-streaming and streaming chat completions, providing flexibility for different application needs. By abstracting away the complexities of the MCP protocol, MCP-Bridge simplifies the integration process and reduces the learning curve for developers familiar with the OpenAI ecosystem.

For example, a developer using the OpenAI Python library can point their application to the MCP-Bridge endpoint and immediately begin leveraging MCP tools without rewriting their code. This is achieved by modifying the incoming request to include tool definitions for all MCP tools available on the MCP servers.

MCP Tool Integration

MCP-Bridge facilitates the integration of various MCP tools into AI workflows. It dynamically discovers and exposes available MCP tools through its API, allowing AI models to leverage external data sources and services. The bridge manages the communication with these tools, handling the execution of tool calls and the retrieval of results. This enables AI models to perform tasks such as fetching real-time data, accessing specialized knowledge bases, and interacting with external systems, enhancing their capabilities and expanding their application scope.

Consider a scenario where an AI model needs to answer a question that requires up-to-date information. MCP-Bridge can be configured to use an MCP tool that fetches data from a specific website or API. The AI model can then use this information to provide a more accurate and comprehensive answer. The request is then modified to include the tool call results, and is returned to the inference engine again so the LLM can create a response.

SSE Bridge for External Clients

MCP-Bridge provides an SSE (Server-Sent Events) bridge, enabling external chat applications with explicit MCP support to seamlessly connect and utilize MCP tools. This SSE endpoint acts as an MCP server, allowing these client applications to discover and interact with available tools through a standardized interface. This feature promotes interoperability within the MCP ecosystem, allowing different clients and servers to work together harmoniously. It also simplifies testing and debugging, as developers can use tools like mcp-cli to verify their configurations and ensure proper communication between components.

For instance, a developer can point their MCP-enabled chat application to the MCP-Bridge SSE endpoint and immediately begin using the configured MCP tools. This allows the chat application to leverage the capabilities of the MCP ecosystem without requiring direct integration with each individual tool.

API Key Authentication

MCP-Bridge supports API key authentication to secure the server and protect access to MCP tools. By configuring an API key in the config.json file, administrators can require clients to authenticate before accessing the bridge's functionality. This helps prevent unauthorized access and ensures that only authorized users can leverage the power of MCP tools through the bridge. The API key is included in the Authorization header of each request as a Bearer token.

For example, an organization can deploy MCP-Bridge with API key authentication to restrict access to sensitive MCP tools to internal users only. This prevents external parties from exploiting the tools and ensures that data and resources are protected. If the api_key field is empty or not present in the configuration, authentication will be skipped, allowing backward compatibility.

REST API Endpoints

MCP-Bridge exposes REST API endpoints for interacting with native MCP primitives. This allows developers to outsource the complexity of dealing with MCP servers to MCP-Bridge without compromising on functionality. The OpenAPI documentation provides examples of how to use this functionality. This feature allows developers to interact with all of the native MCP primitives.

For example, developers can use the REST API endpoints to manage MCP servers, configure tools, and monitor the status of the bridge. This provides a centralized interface for managing the MCP ecosystem and simplifies the development process.