MCP-Bridge  by SecretiveShell

Middleware for OpenAI API access to MCP tools

Created 11 months ago
868 stars

Top 41.3% 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 day ago

Responsiveness

1 day

Pull Requests (30d)
10
Issues (30d)
0
Star History
9 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.