MCP-Bridge  by SecretiveShell

Middleware for OpenAI API access to MCP tools

created 8 months ago
824 stars

Top 44.0% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

MCP-Bridge provides an OpenAI-compatible API endpoint that bridges to MCP (Meta-Command Processor) tools, enabling developers to integrate MCP functionalities into applications designed for OpenAI's ecosystem without explicit MCP support. This middleware simplifies the use of diverse MCP tools by abstracting their complexity behind a familiar API, benefiting developers seeking to leverage specialized tools with LLM-driven applications.

How It Works

MCP-Bridge acts as an intermediary between an OpenAI client and an inference engine. It intercepts incoming requests, augments them with definitions for available MCP tools, and forwards them to the inference engine. The LLM, guided by these tool definitions, generates tool calls. MCP-Bridge then manages the execution of these calls with the appropriate MCP servers, incorporates the results back into the request, and sends it back to the inference engine for final response generation. This process allows LLMs to seamlessly utilize MCP tools for enhanced capabilities.

Quick Start & Requirements

  • Installation: Recommended via Docker. Clone the repository, edit compose.yml to reference a config.json (via volume mount, HTTP URL, or direct JSON environment variable), and run docker-compose up --build -d.
  • Prerequisites: Requires an inference engine with tool call support (tested with vLLM, Ollama should be compatible).
  • Configuration: A config.json file is essential, specifying inference server details and MCP server commands/arguments.
  • Documentation: API documentation available at http://yourserver:8000/docs.

Highlighted Details

  • Supports non-streaming and streaming chat completions with MCP tool calls.
  • Exposes REST API endpoints for direct interaction with MCP primitives.
  • Includes an SSE Bridge for external clients to use MCP-Bridge as an MCP server.
  • Supports API key authentication for securing the bridge.

Maintenance & Community

  • Project actively seeks contributions via pull requests.
  • Community support is available via Discord.
  • Further documentation is provided.

Licensing & Compatibility

  • Licensed under the MIT License, permitting commercial use and closed-source linking.

Limitations & Caveats

  • Streaming completions are noted as not yet implemented.
  • The project is actively under development with planned features.
Health Check
Last commit

1 week ago

Responsiveness

1 day

Pull Requests (30d)
5
Issues (30d)
1
Star History
141 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Travis Fischer Travis Fischer(Founder of Agentic), and
1 more.

fastmcp by punkpeye

3.7%
2k
TypeScript framework for building MCP servers handling client sessions
created 7 months ago
updated 2 days ago
Starred by Didier Lopes Didier Lopes(Founder of OpenBB), Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), and
2 more.

fastmcp by jlowin

2.1%
15k
Pythonic SDK for building Model Context Protocol (MCP) servers/clients
created 8 months ago
updated 1 day ago
Feedback? Help us improve.