使用说明
MCP Bridge
A powerful bridge application that enables seamless communication between local Model Context Protocol (MCP) servers and remote AI agents, allowing distributed AI workflows where business logic runs remotely while maintaining local system access.
⚠️ Project Status: This project is currently under development and is not ready for use. APIs, configurations, and features are subject to change.
Overview
MCP Bridge solves the challenge of connecting remote AI agents with local system resources through the Model Context Protocol. This architecture enables powerful use cases where AI agents running on remote servers need to interact with local applications, browsers, or system resources while keeping the core business logic centralized.
Architecture
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Remote Agent │◄──►│ MCP Bridge │◄──►│ Local MCP │
│ (Remote Server)│ │ │ │ Client │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│
▼
┌─────────────────┐
│ Local Resources │
│ • Browser │
│ • File System │
│ • Applications │
└─────────────────┘
Key Features
- 🌐 Remote-Local Bridge: Connect remote AI agents with local MCP servers
- 🔒 Secure Communication: Encrypted communication between remote and local components
- 🎯 Flexible Deployment: Deploy business logic remotely while maintaining local access
- ⚡ Real-time Sync: Low-latency communication for responsive interactions
- 🔧 Easy Integration: Simple setup and configuration process
Use Cases
Web Application Automation
Remote agents can control local browsers to:
- Perform automated testing of web applications
- Execute complex user workflows
- Gather data from web services
- Interact with local development environments
Local System Integration
Enable remote agents to:
- Access local file systems
- Interact with desktop applications
- Monitor system resources
- Execute local scripts and commands
Distributed AI Workflows
- Centralized Logic: Keep AI models and business logic on powerful remote servers
- Local Execution: Execute tasks that require local system access
- Hybrid Processing: Combine remote intelligence with local capabilities
Project Structure
TBD
Quick Start
Prerequisites
- Python 3.8+
- uv (Fast Python package manager)
- Local MCP server setup
- Network connectivity between local and remote environments
Installation
-
Clone the repository
git clone https://github.com/sarathak/mcp-bridge.git cd mcp-bridge -
Set up the local client
cd local-client uv sync -
Configure the remote adapter
cd ../remote-adapter uv sync
Configuration
-
Local Client Configuration (
local-client/config.json){ "local_mcp_endpoint": "http://localhost:3000", "remote_bridge_url": "wss://your-remote-server.com/bridge", "auth_token": "your-auth-token", "log_level": "INFO" } -
Remote Adapter Configuration (
remote-adapter/config.json){ "bridge_port": 8080, "allowed_origins": ["https://your-domain.com"], "mcp_protocol_version": "1.0", "max_connections": 100 }
Usage Examples
TBD
Security Considerations
- Authentication: All connections require valid authentication tokens
- Encryption: End-to-end encryption for all communications
- Access Control: Configurable permissions for local resource access
- Audit Logging: Complete logging of all bridge operations
Development
Running in Development Mode
-
Start the local client
cd local-client uv run python -m src.main # or with auto-reload for development uv run watchdog --auto-restart src/ -
Start the remote adapter
cd remote-adapter uv run python -m src.server # or with auto-reload for development uv run watchdog --auto-restart src/
Testing
# Run all tests
uv run pytest
# Run integration tests
uv run pytest tests/integration/
# Run specific test suite
uv run pytest tests/test_bridge.py
# Run with coverage
uv run pytest --cov=src tests/
Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and add tests
- Commit your changes:
git commit -am 'Add new feature' - Push to the branch:
git push origin feature-name - Submit a pull request
Roadmap
- [ ] WebSocket connection optimization
- [ ] Multi-protocol support (HTTP, gRPC)
- [ ] Enhanced security features
- [ ] Docker containerization
- [ ] Kubernetes deployment support
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
- Documentation: docs/
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Acknowledgments
- Model Context Protocol (MCP) specification
- WebSocket protocol standards
- Open source community contributors
⚠️ Development Notice: This project is actively under development. Features may be incomplete, APIs are unstable, and breaking changes may occur frequently. Please check back for updates or consider contributing to help move the project forward.