شعار MCP Bridge API

MCP Bridge API

المجتمع
INQUIRELAB

MCP Bridge is a lightweight, fast, and LLM-agnostic proxy for connecting to multiple Model Context Protocol (MCP) servers through a unified REST API. It enables secure tool execution across diverse environments like mobile, web, and edge devices. Designed for flexibility, scalability, and easy integration with any LLM backend.

الناشرINQUIRELAB
المستودعmcp-bridge-api
اللغةTypeScript
التفريعات
8
النجوم
69
الأدوات المتاحة
0
نوع نقل البياناتstreamable-http
الفئات
الروابط
  • اربط الأدوات بسير عمل الذكاء الاصطناعي

    يتيح MCP Bridge API إمكانات MCP التي يمكن لتطبيقات الذكاء الاصطناعي العميلة ووكلاء الذكاء الاصطناعي المتوافقة استخدامها.

  • الأدوات المتاحة: 0

    تصفّح الإجراءات القابلة للاستدعاء أدناه، بما في ذلك أسماؤها وأوصافها عندما يوفّرها الخادم.

  • إعدادات جاهزة للنسخ

    استخدم أمثلة إعداد التثبيت لتهيئة هذا الخادم في تطبيق MCP العميل المفضّل لديك.

  • مؤشرات الاهتمام بالمصدر المفتوح

    النجوم: 69، والنسخ المتفرعة: 8 في المستودع المرتبط.

MCP Bridge API

A Lightweight, LLM-Agnostic RESTful Proxy for Model Context Protocol Servers

Figure: The React Native MCP Agent interface showing the chat screen with tool execution results (left) and the settings screen with MCP Bridge connection status and Gemini API configuration (right)

Authors:
Arash Ahmadi, Sarah S. Sharif, and Yaser M. Banad*
School of Electrical, and Computer Engineering, University of Oklahoma, Oklahoma, United States
*Corresponding author: bana@ou.edu

License: Noncommercial arXiv

If you want to reference this research project in your work, please cite our paper:

@article{ahmadi2025mcp,
  title={MCP Bridge: A Lightweight, LLM-Agnostic RESTful Proxy for Model Context Protocol Servers},
  author={Ahmadi, Arash and Sharif, Sarah and Banad, Yaser M},
  journal={arXiv preprint arXiv:2504.08999},
  year={2025}
}

📋 Table of Contents

📚 Introduction

MCP Bridge is a lightweight, fast, and LLM-agnostic proxy that connects to multiple Model Context Protocol (MCP) servers and exposes their capabilities through a unified REST API. It enables any client on any platform to leverage MCP functionality without process execution constraints. Unlike Anthropic's official MCP SDK, MCP Bridge is fully independent and designed to work with any LLM backend which makes it adaptable, modular, and future-proof for diverse deployments. With optional risk-based execution levels, it provides granular security controls—from standard execution to confirmation workflows and Docker isolation—while maintaining backward compatibility with standard MCP clients.

Complementing this server-side infrastructure are two distinct intelligent client implementations:

  1. Python MCP-Gemini Agent - A command-line Python client for desktop environments
  2. React Native MCP Agent - A modern cross-platform mobile application

Both clients enable natural language interaction with MCP tools through intelligent LLM-powered interfaces that feature multi-step reasoning for complex operations, security confirmation workflow handling, and configurable display options for enhanced usability. Together, MCP Bridge's versatile server-side capabilities and these intelligent client interfaces create a powerful ecosystem for developing sophisticated LLM-powered applications.

⚠️ The Problem

  • Many MCP servers use STDIO transports requiring local process execution
  • Edge devices, mobile devices, web browsers, and other platforms cannot efficiently run npm or Python MCP servers
  • Direct MCP server connections are impractical in resource-constrained environments
  • Multiple isolated clients connecting to the same servers causes redundancy and increases resource usage
  • Interacting directly with MCP tools requires technical knowledge of specific tool formats and requirements

🏗️ Architecture

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│  React Native   │     │     Python      │     │  Other Clients  │
│   MCP Agent     │     │  Gemini Agent   │     │                 │
└────────┬────────┘     └────────┬────────┘     └────────┬────────┘
         │                       │                       │
         │                       │                       │
         │                       ▼                       │
         │           ┌───────────────────────┐          │
         └──────────►│                       │◄─────────┘
                     │      REST API         │
                     │                       │
                     └───────────┬───────────┘
                                 │
                                 ▼
                     ┌───────────────────────┐
                     │                       │
                     │     MCP Bridge        │
                     │                       │
                     └───────────┬───────────┘
                                 │
                 ┌───────────────┼───────────────┐
                 │               │               │
                 ▼               ▼               ▼
        ┌─────────────┐  ┌─────────────┐  ┌─────────────┐
        │  MCP Server │  │  MCP Server │  │  MCP Server │
        │    (STDIO)  │  │    (STDIO)  │  │    (SSE)    │
        └─────────────┘  └─────────────┘  └─────────────┘

💾 Installation

📦 Prerequisites

  • Node.js 18+ for MCP Bridge
  • Python 3.8+ for the Python MCP-Gemini Agent
  • React Native development environment for the mobile app

🚀 Quick Setup

MCP Bridge

bash
# Install dependencies
npm install express cors morgan uuid

# Start the server
node mcp-bridge.js

Python MCP-Gemini Agent

bash
# Install dependencies
pip install google-generativeai requests rich

# Start the agent
python llm_test.py

React Native MCP Agent

bash
# Navigate to the React Native app directory
cd reactnative-gamini-mcp-agent

# Install dependencies
npm install

# Start the development server
npx expo start

🐍 Python MCP-Gemini Agent

The Python MCP-Gemini Agent is a command-line client that connects to MCP Bridge and uses Google's Gemini LLM to process user requests and execute MCP tools commands. It's designed for desktop environments and developer workflows.

Key Features

  1. Multi-step reasoning - Supports sequenced tool calls for complex operations
  2. Security confirmation flow - Integrated handling for medium and high risk operations
  3. Flexible JSON display - Control the verbosity of JSON outputs for better readability
  4. Configurable connection - Connect to any MCP Bridge instance with custom URL and port
  5. Discovery of available tools - Automatically detects and uses all tools from connected servers

Python Agent Configuration

The Python MCP-Gemini Agent supports several command-line options:

usage: llm_test.py [-h] [--hide-json] [--json-width JSON_WIDTH] [--mcp-url MCP_URL] [--mcp-port MCP_PORT]

MCP-Gemini Agent with configurable settings

options:
  -h, --help            show this help message and exit
  --hide-json           Hide JSON results from tool executions
  --json-width JSON_WIDTH
                        Maximum width for JSON output (default: 100)
  --mcp-url MCP_URL     MCP Bridge URL including protocol and port (default: http://localhost:3000)
  --mcp-port MCP_PORT   Override port in MCP Bridge URL (default: use port from --mcp-url)

Python Agent Usage Examples

bash
# Basic usage with default settings
python llm_test.py

# Hide JSON results for cleaner output
python llm_test.py --hide-json

# Connect to a custom MCP Bridge server
python llm_test.py --mcp-url http://192.168.1.100:3000

# Connect to a different port
python llm_test.py --mcp-port 4000

# Adjust JSON width display for better formatting
python llm_test.py --json-width 120

📱 React Native MCP Agent

The React Native MCP Agent is a modern, cross-platform mobile application that provides intuitive access to MCP tools through a clean, user-friendly interface. Built with Expo and React Native Paper, it offers a dark-themed, Material Design 3 interface optimized for both iOS and Android platforms.

Key Features

  • Cross-Platform Compatibility: Runs on iOS, Android, and web platforms
  • Intuitive Chat Interface: Natural language interaction with segmented message display
  • Real-Time Tool Execution: Visual feedback for MCP tool calls with collapsible result sections
  • Conversation Management: Persistent conversation history with AI-generated titles
  • Modern UI/UX: Dark theme with glassmorphism effects and smooth animations
  • Comprehensive Settings: Easy configuration of MCP Bridge connections and Gemini API settings
  • Security Integration: Built-in support for MCP Bridge's risk-level confirmation workflows
  • Multi-Model Support: Compatible with various Gemini models including the latest 2.5 Flash Preview

Getting Started with the React Native app

  1. Configure MCP Bridge: Set up your MCP Bridge server URL in the Settings tab
  2. Add Gemini API Key: Enter your Google Gemini API key for AI functionality
  3. Select Model: Choose from available Gemini models including the latest releases
  4. Start Chatting: Begin natural language conversations with your MCP tools

The app automatically discovers available MCP tools and provides contextual assistance for complex multi-step operations.

⚙️ Configuration

MCP Bridge Configuration

MCP Bridge is configured through a JSON file named mcp_config.json in the project root. This is an example of a basic MCP config:

json
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/directory"],
      "riskLevel": 2
    },
    "slack": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-slack"],
      "env": {
        "SLACK_BOT_TOKEN": "your-slack-token",
        "SLACK_TEAM_ID": "your-team-id"
      },
      "riskLevel": 1
    }
  }
}

🧪 API Usage

MCP Bridge exposes a clean and intuitive REST API for interacting with connected servers. Here's a breakdown of available endpoints:

📋 General Endpoints

EndpointMethodDescription
/serversGETList all connected MCP servers
/serversPOSTStart a new MCP server
/servers/{serverId}DELETEStop and remove an MCP server
/healthGETGet health status of the MCP Bridge
/confirmations/{confirmationId}POSTConfirm execution of a medium risk level request

📌 Server-Specific Endpoints

EndpointMethodDescription
/servers/{serverId}/toolsGETList all tools for a specific server
/servers/{serverId}/tools/{toolName}POSTExecute a specific tool
/servers/{serverId}/resourcesGETList all resources
/servers/{serverId}/resources/{resourceUri}GETRetrieve specific resource content
/servers/{serverId}/promptsGETList all prompts
/servers/{serverId}/prompts/{promptName}POSTExecute a prompt with arguments

🧪 Example Requests

📂 Read Directory (Filesystem)

http
POST /servers/filesystem/tools/list_directory
Content-Type: application/json

{
  "path": "."
}

🧪 Client Features

Python Agent Features

The Python MCP-Gemini Agent provides:

  1. Multi-step reasoning - Supports sequenced tool calls for complex operations
  2. Security confirmation flow - Integrated handling for medium and high risk operations
  3. Flexible JSON display - Control the verbosity of JSON outputs for better readability
  4. Configurable connection - Connect to any MCP Bridge instance with custom URL and port
  5. Discovery of available tools - Automatically detects and uses all tools from connected servers

React Native Agent Features

The React Native MCP Agent provides:

  1. Conversation Management - Persistent chat history with AI-generated titles
  2. Segmented Message Display - Clean separation of text responses and tool operations
  3. Real-time Tool Execution - Visual feedback with collapsible result sections
  4. Security Confirmation UI - Native confirmation dialogs for medium/high risk operations
  5. Multi-Model Support - Support for various Gemini models with easy switching
  6. Cross-Platform - Works on iOS, Android, and web platforms
  7. Modern Material Design - Dark theme with smooth animations and haptic feedback

🔐 Risk Levels

MCP Bridge implements an optional risk level system that provides control over server execution behaviors. Risk levels help manage security and resource concerns when executing potentially sensitive MCP server operations.

Risk Level Classification

LevelNameDescriptionBehavior
1LowStandard executionDirect execution without confirmation
2MediumRequires confirmationClient must confirm execution before processing
3HighDocker execution requiredServer runs in isolated Docker container

Configuring Risk Levels

Risk levels are optional for backward compatibility. You can configure risk levels in your mcp_config.json:

json
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/directory"],
      "riskLevel": 2
    },
    "slack": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-slack"],
      "env": {
        "SLACK_BOT_TOKEN": "your-slack-token",
        "SLACK_TEAM_ID": "your-team-id"
      },
      "riskLevel": 1
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_TOKEN": "your-github-token"
      },
      "riskLevel": 3,
      "docker": {
        "image": "node:18",
        "volumes": ["/tmp:/tmp"],
        "network": "host"
      }
    }
  }
}

Risk Level Workflows

Low Risk (Level 1)

  • Standard execution without additional steps
  • Suitable for operations with minimal security concerns
  • This is the default behavior when no risk level is specified

Medium Risk (Level 2)

  1. Client makes a tool execution request
  2. Server responds with a confirmation request containing a confirmation ID
  3. Client must make a separate confirmation request to proceed
  4. Only after confirmation does the server execute the operation

Both the Python MCP-Gemini Agent and React Native Agent handle this confirmation flow automatically, prompting the user for approval when needed.

High Risk (Level 3)

  • Server automatically runs in an isolated Docker container
  • Provides environmental isolation for the MCP server process
  • Requires Docker to be installed and properly configured

📋 Changelog

Latest Updates

  • ✅ UV Package Manager Support: Fixed the issue with loading UV-based (Python) MCP servers. MCP Bridge now properly initializes and communicates with Python MCP servers that use the UV package manager, resolving previous compatibility issues with UV-based toolchains.

  • 📱 React Native MCP Agent: Added a comprehensive mobile application with:

    • Cross-platform support for iOS, Android, and web
    • Modern Material Design 3 interface with dark theming
    • Intelligent conversation management with AI-generated titles
    • Real-time tool execution with visual feedback
    • Built-in security confirmation workflows
    • Support for multiple Gemini models including latest releases
  • 🔧 Enhanced Tool Execution: Improved multi-step reasoning capabilities across all clients

  • 🛡️ Security Improvements: Enhanced risk-level confirmation flows with better user experience

  • 📊 Better Error Handling: More robust error handling and recovery mechanisms

🌟 Community Impact and Recognition

MCP Bridge has gained recognition within the AI and development communities, being featured in academic research, industry security analyses, professional discourse, and technical publications. These acknowledgments highlight the practical value and real-world impact of our lightweight, LLM-agnostic proxy solution.

Cited by this paper: From Prompt Injections to Protocol Exploits: Threats in LLM-Powered AI Agents Workflows - A research paper discussing security implications in LLM-powered AI agent workflows

Research Briefing: MCP Security - Wiz security research highlighting MCP Bridge as an example of academic work in the MCP ecosystem

LinkedIn Post by Vaibhava Lakshmi Ravideshik - A LinkedIn Learning Instructor discussion about MCP Bridge's practical applications

Unlocking Agentic Apps with the Model Context Protocol (MCP) For Financial Services - Medium article featuring MCP Bridge's design pattern for financial applications

🚧 Deployment Considerations

🔒 Security

  • Use HTTPS in production
  • Add auth for sensitive operations
  • Network-isolate critical services

📊 Scaling

  • Use load balancers
  • Pool high-demand servers
  • Track metrics and resource pressure

📱 Mobile Deployment

For the React Native app:

  • Build for production using npx expo build
  • Configure app store deployment with EAS Build
  • Set up over-the-air updates with EAS Update

📊 Comparison with Other MCP Bridge/Proxy Repositories

Featureivanboring/mcp-restINQUIRELAB/mcp-bridge-api (This Repo)SecretiveShell/MCP-BridgeJoshuaRileyDev/mcp-apirakesh-eltropy/mcp-clientbartolli/mcp-llm-bridge
⚙️ Primary LanguageNode.jsNode.js (Bridge) + Python (Agent) ✨PythonNode.jsPythonPython
🎯 Main PurposeSimple REST wrapperLLM-Agnostic REST Bridge + Gemini AgentFeature-rich OpenAI & REST Bridge + MCP ServerREST API for MCP Servers + Chat UI ExampleLangChain Agent w/ MCP Tools (REST/CLI)MCP <-> LLM Bridge (OpenAI compatible)
🔌 MCP ConnectionSSE onlySTDIO (Managed) + Docker (Risk-based) ✔️STDIO, SSE, DockerSTDIOSTDIO (LangChain)STDIO
🚀 API InterfaceBasic RESTUnified REST API ✔️OpenAI compatible, REST, MCP Server (SSE)REST API + SwaggerREST API (Streaming), CLIInteractive CLI
✨ Key FeaturesBasic tool list/callMulti-server, Risk Levels, Security Confirm, Docker Exec, Gemini Agent, Config Flexibility ✨OpenAI compat., Sampling, Multi-transport, Auth, Docker/Helm, Flexible ConfigMulti-server, Tool Name Norm., Swagger, Chat UILangChain Integration, REST/CLI, StreamingBidirectional Protocol Translation, DB Tool
🔧 ConfigurationCLI argsJSON file + Env Vars ✔️JSON file, HTTP URL, Env VarsJSON file (multi-path search), Env VarsJSON filePython Object, Env Vars
🧩 LLM IntegrationNoneYes (Dedicated Gemini Agent w/ Multi-Step Reasoning) ✨Yes (OpenAI endpoint)None (API only)Yes (LangChain)Yes (OpenAI client)
🏗️ ComplexityLowLow ✔️HighModerateModerate-HighModerate
🛡️ Security FeaturesNoneRisk Levels (Medium/High) + Confirmation Flow + Docker Isolation ✨Basic Auth (API Keys), CORSNoneNoneNone
📦 Key Dependenciesexpress, mcp-clientexpress, uuid (Bridge, minimum dependency); requests, google-genai, rich (Agent)fastapi, mcp, mcpxexpress, @mcp/sdk, socket.iofastapi, `

License scope

Original INQUIRE Lab code is licensed under PolyForm Noncommercial License 1.0.0. Original INQUIRE Lab datasets, figures, and documentation are licensed under CC BY-NC 4.0. See LICENSE for scope and the full license texts. Materials from other rights holders retain their original terms.

استخدم MCP الخاص بـ MCP Bridge API مع نماذج ذكاء اصطناعي متعددة

يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا بمجرد توصيل MCP Bridge API، يمكنك استخدامه مع نماذج ذكاء اصطناعي مختلفة في TypingMind بدلًا من إعداده لكل نموذج على حدة. يتصل تكامل MCP هذا عبر عنوان URL لخادم MCP مستضاف عن بُعد في TypingMind.

أضف عنوان URL لخادم MCP

استخدم هذا الخيار عندما يكون MCP Bridge API مستضافًا بالفعل عن بُعد أو عندما يريد فريقك موصلًا مشتركًا واحدًا يمكن لعدة مستخدمين الوصول إليه.

1

فتح موصلات MCP

في TypingMind، انتقل إلى «الإضافات»، وافتح «موصلات MCP»، ثم اختر «إضافة رابط».

  1. افتح TypingMind في متصفحك.
  2. انتقل إلى الإضافات.
  3. افتح موصلات MCP.
  4. انقر على «إضافة عنوان URL».
نموذج إضافة عنوان URL لخادم MCP مخصص في TypingMind
2

لصق عنوان URL للخادم

أدخل عنوان URL لخادم MCP الذي يقدّمه مزوّد الخدمة في حقل «رابط الخادم». أضف اسمًا للاتصال أو وصفًا أو أيقونة أو ترويسات HTTP مخصصة أو إعدادات عميل OAuth إذا كان الخادم يتطلب ذلك.

  1. ألصق عنوان URL لخادم MCP الذي يقدّمه مزوّد الخدمة في حقل «رابط الخادم».
  2. أدخل اسمًا لاتصال MCP Bridge API.
  3. أضف وصفًا وأيقونة لتسهيل التعرّف على الاتصال إن أردت.
  4. أضف ترويسات HTTP مخصصة أو تفاصيل عميل OAuth إذا كان الخادم يتطلب المصادقة.
3

إنشاء الاتصال

انقر على «إنشاء اتصال»، ثم عُد إلى قائمة الإضافات وتأكد من أن اتصال MCP الجديد نشط.

  1. انقر على «إنشاء اتصال».
  2. عُد إلى قائمة موصلات MCP.
  3. تأكد من ظهور اتصال MCP Bridge API بحالة «نشط».
  4. حدّث قائمة الإضافات إذا لم يظهر الاتصال فورًا.
4

تبديل النماذج دون إعادة الاتصال

ابدأ محادثة مع نموذجك المفضل، وفعّل أدوات MCP Bridge API من «الإضافات»، وانتقل إلى نموذج آخر عند الحاجة. يظل اتصال MCP متاحًا في مساحة عمل TypingMind.

  1. ابدأ محادثة جديدة في TypingMind.
  2. اختر نموذج الذكاء الاصطناعي الذي تريد استخدامه.
  3. فعّل أدوات MCP Bridge API من قسم الإضافات.
  4. اطلب من النموذج استخدام الأداة عند الحاجة.
  5. انتقل إلى نموذج ذكاء اصطناعي آخر وأعد استخدام اتصال MCP نفسه.
محادثة في TypingMind تستخدم أدوات MCP المفعّلة مع نموذج ذكاء اصطناعي محدّد
هل يمكنك استخدام MCP Bridge API لمساعدتي في هذه المهمة؟
MCP Bridge API
بالتأكيد. قرأته.
إليك ما وجدته باستخدام MCP Bridge API.

الأسئلة الشائعة

ما استخدامات خادم MCP MCP Bridge API؟

MCP Bridge API هو خادم MCP يتيح لتطبيقات الذكاء الاصطناعي المتوافقة الاتصال بأدوات ومصادر سياق خارجية. في TypingMind، يمكنك إضافة خادم MCP هذا مرة واحدة وإتاحة أدواته في مساحة عملك للذكاء الاصطناعي.

هل يمكنني استخدام خادم MCP MCP Bridge API مع نماذج ذكاء اصطناعي متعددة في TypingMind؟

نعم. يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا يمكنك استخدام MCP Bridge API مع نماذج ذكاء اصطناعي مختلفة مثل Claude أو ChatGPT أو Gemini أو غيرها من النماذج التي أعددتها في TypingMind، دون إعداد خادم MCP لكل نموذج على حدة.

لماذا تستخدم موصل MCP MCP Bridge API مع TypingMind؟

يُعد TypingMind من أفضل واجهات المحادثة مع النماذج اللغوية الكبيرة، إذ يجمع نماذج ذكاء اصطناعي متعددة ومطالبات وإضافات ووكلاء ذكاء اصطناعي ومفاتيح API وأدوات MCP في مساحة عمل واحدة. بعد توصيل MCP Bridge API، يمكنك استخدام أدوات MCP الخاصة به عبر نماذجك المفضلة مع الحفاظ على سير عمل محادثاتك منظمًا في TypingMind.

كيف أوصّل خادم MCP MCP Bridge API بـ TypingMind؟

يمكن توصيل MCP Bridge API بـ TypingMind بإضافة عنوان URL لخادم MCP المستضاف الخاص به. يفيد ذلك عندما تريد اتصال MCP بعيدًا متاحًا من مساحة عملك في TypingMind.

ما الأدوات التي يوفّرها خادم MCP MCP Bridge API في TypingMind؟

يتيح MCP Bridge API إمكانات MCP يمكنك تفعيلها من صفحة الإضافات في TypingMind واستخدامها في المحادثات أو تعيينها لوكلاء ذكاء اصطناعي.

هل أحتاج إلى مشاركة مفاتيح API الخاصة بي مع TypingMind لاستخدام خادم MCP MCP Bridge API؟

لا. يعطي TypingMind الأولوية للعمل المحلي ويُبقي مزوّدي النماذج ومفاتيح API والمطالبات وإعدادات MCP تحت تحكمك. إذا كان MCP Bridge API يتطلب مصادقة، فأضف الترويسات أو إعدادات OAuth أو الإعدادات المحلية المطلوبة لخادم MCP هذا عند إنشاء الاتصال.

خوادم MCP ذات صلة

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا البريدية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇