MCP Access Point is a lightweight protocol conversion gateway tool designed to establish a communication bridge between traditional HTTP services and MCP (Model Context Protocol) clients. It enables MCP clients to interact directly with existing HTTP services without requiring any server-side interface modifications. This project is built on Pingora - an ultra-high performance gateway proxy librar
Add this skill
npx mdskills install sxhxliang/mcp-access-pointHigh-performance HTTP-to-MCP gateway with multi-tenancy, runtime config management, and comprehensive setup docs
1# MCP Access Point23`MCP Access Point` is a lightweight protocol conversion gateway tool designed to establish a communication bridge between traditional `HTTP` services and `MCP` (Model Context Protocol) clients. It enables MCP clients to interact directly with existing HTTP services without requiring any server-side interface modifications.4<p align="center">5 <a href="./README.md"><img alt="README in English" src="https://img.shields.io/badge/English-4578DA"></a>6 <a href="./README_CN.md"><img alt="简体中文版" src="https://img.shields.io/badge/简体中文-F40002"></a>7 <a href="https://deepwiki.com/sxhxliang/mcp-access-point"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki"></a>8 <a href="https://zread.ai/sxhxliang/mcp-access-point"><img alt="中文文档" src="https://img.shields.io/badge/中文文档-4578DA"></a>9</p>10111213## Introduction14This project is built on `Pingora` - an ultra-high performance gateway proxy library capable of supporting massive-scale request proxy services. Pingora has been used to build services that handle core traffic for the Cloudflare platform, consistently serving over 40 million requests per second across the internet for years. It has become the technical cornerstone supporting a significant proportion of traffic on the Cloudflare platform.1516## HTTP to MCP17This mode allows clients like `Cursor Desktop` to communicate with remote HTTP servers through `SSE`, even when the servers themselves don't support the SSE protocol.1819- Example setup includes two services:20 - Service 1 runs locally at `127.0.0.1:8090`21 - Service 2 runs remotely at `api.example.com`22- Through the `MCP Access Point`, both services can be converted to MCP services without any code modifications.23- Clients communicate with `Service 1` and `Service 2` via the MCP protocol. The MCP Access Point automatically distinguishes MCP requests and forwards them to the appropriate backend services.2425```mermaid26graph LR27 A["Cursor Desktop"] <--> |SSE| B["MCP Access Point"]28 A2["Other Desktop"] <--> |Streamable Http| B["MCP Access Point"]29 B <--> |http 127.0.0.1:8090| C1["Existing API Server"]30 B <--> |https//api.example.com| C2["Existing API Server"]3132 style A2 fill:#ffe6f9,stroke:#333,color:black,stroke-width:2px33 style A fill:#ffe6f9,stroke:#333,color:black,stroke-width:2px34 style B fill:#e6e6af,stroke:#333,color:black,stroke-width:2px35 style C1 fill:#e6ffe6,stroke:#333,color:black,stroke-width:2px36 style C2 fill:#e6ffd6,stroke:#333,color:black,stroke-width:2px37```3839### Transport Type (Specification)40Currently supports `SSE` and `Streamable HTTP` protocols:41- ✅ Streamable HTTP (stateless) 2025-03-2642 - All services: `ip:port/mcp`43 - Single service: `ip:port/api/{service_id}/mcp`4445- ✅ SSE 2024-11-0546 - All services: `ip:port/sse`47 - Single service: `ip:port/api/{service_id}/sse`4849use `IP:PORT/sse` for `SSE`50use `IP:PORT/mcp` for `Streamable HTTP`5152### Supported MCP clients53- ✅ [MCP Inspector](https://github.com/modelcontextprotocol/inspector)54- ✅ [Cursor Desktop](https://docs.cursor.com/context/model-context-protocol)55- ✅ [Windsurf](https://docs.windsurf.com/plugins/cascade/mcp#model-context-protocol-mcp)56- ✅ [VS Code](https://code.visualstudio.com/docs/copilot/chat/mcp-servers)57- ✅ [Trae](https://docs.trae.ai/ide/model-context-protocol)5859## Core Features60- **Protocol Conversion**: Seamless conversion between HTTP and MCP protocols61- **Zero-Intrusive Integration**: Full compatibility with existing HTTP services62- **Client Empowerment**: Enables MCP clients to directly call standard HTTP services63- **Lightweight Proxy**: Minimalist architecture with efficient protocol conversion64- **Multi-tenancy**: Independent configuration and endpoints for each tenant65- **Runtime Configuration Management**: Dynamic configuration updates without service restart66- **Admin API**: RESTful API for real-time configuration management6768## Quick Start6970### Installation71```bash72# Install from source73git clone https://github.com/sxhxliang/mcp-access-point.git74cd mcp-access-point75cargo run -- -c config.yaml7677# Use inspector for debugging (start service first)78npx @modelcontextprotocol/inspector node build/index.js79# Access http://127.0.0.1:6274/80# Select "SSE" and enter 0.0.0.0:8080/sse, then click connect81# or select "Streamable HTTP" and enter 0.0.0.0:8080/mcp82```8384### Multi-tenancy Support85The MCP Access Gateway supports multi-tenancy, where each tenant can configure multiple MCP services accessible via:86- `/api/{mcp-service-id}/sse` (for SSE)87- `/api/{mcp-service-id}/mcp` (for Streamable HTTP)8889Example configuration:90```yaml91# config.yaml example (supports multiple services)9293mcps:94 - id: service-1 # Access via /api/service-1/sse or /api/service-1/mcp95 ... # Service configuration96 - id: service-2 # Access via /api/service-2/sse or /api/service-2/mcp97 ... # Service configuration98 - id: service-3 # Access via /api/service-3/sse or /api/service-3/mcp99 ... # Service configuration100```101102To access all services simultaneously, use:103- `0.0.0.0:8080/mcp` (Streamable HTTP)104- `0.0.0.0:8080/sse` (SSE)105106### Configuration Details1071. **`-c config.yaml`**108 - `-c` (or `--config`) specifies the configuration file path (`config.yaml`).109 - This file defines the APIs that the MCP Access Point will proxy and convert.110111### config.yaml Example112The configuration file supports multi-tenancy, allowing independent configuration of upstream services and routing rules for each MCP service. Key configuration items include:1131141. **mcps** - MCP service list115 - `id`: Unique service identifier used to generate access paths116 - `upstream_id`: Associated upstream service ID117 - `path`: OpenAPI specification file path. Supports local files (e.g., `config/openapi.json`) and remote HTTP/HTTPS URLs (e.g., `https://petstore.swagger.io/v2/swagger.json`). Both JSON and YAML formats are supported.118 - `routes`: Custom routing configuration (optional)119 - `upstream`: Upstream service specific configuration (optional)1201212. **upstreams** - Upstream service configuration122 - `id`: Upstream service ID123 - `nodes`: Backend node addresses and weights124 - `type`: Load balancing algorithm (roundrobin/random/ip_hash)125 - `scheme`: Upstream protocol (http/https)126 - `pass_host`: HTTP Host header handling127 - `upstream_host`: Override Host header value128129Complete configuration example:130```yaml131# config.yaml example (supports multiple services)132mcps:133 - id: service-1 # Unique identifier, accessible via /api/service-1/sse or /api/service-1/mcp134 upstream_id: 1135 path: config/openapi_for_demo_patch1.json # Local OpenAPI spec path136137 - id: service-2 # Unique identifier138 upstream_id: 2139 path: https://petstore.swagger.io/v2/swagger.json # Remote OpenAPI spec140141 - id: service-3142 upstream_id: 3143 routes: # Custom routing144 - id: 1145 operation_id: get_weather146 uri: /points/{latitude},{longitude}147 method: GET148 meta:149 name: Get Weather150 description: Retrieve weather information by coordinates151 inputSchema: # Optional input validation152 type: object153 required:154 - latitude155 - longitude156 properties:157 latitude:158 type: number159 minimum: -90160 maximum: 90161 longitude:162 type: number163 minimum: -180164 maximum: 180165166upstreams: # Required upstream configuration167 - id: 1168 headers: # Headers to send to upstream service169 X-API-Key: "12345-abcdef" # API key170 Authorization: "Bearer token123" # Bearer token171 User-Agent: "MyApp/1.0" # User agent172 Accept: "application/json" # Accept header173 nodes: # Backend nodes (IP or domain)174 "127.0.0.1:8090": 1 # Format: address:weight175176 - id: 2177 nodes:178 "127.0.0.1:8091": 1179180 - id: 3181 nodes:182 "api.weather.gov": 1183 type: roundrobin # Load balancing algorithm184 scheme: https # Protocol185 pass_host: rewrite # Host header handling186 upstream_host: api.weather.gov # Override Host187```188189To run the MCP Access Gateway with config file:190```bash191cargo run -- -c config.yaml192```193194## Running via Docker195196### Run Locally for quick start197198```bash199# Note: Replace /path/to/your/config.yaml with actual path200docker run -d --name mcp-access-point --rm \201 -p 8080:8080 \202 -e port=8080 \203 -v /path/to/your/config.yaml:/app/config/config.yaml \204 ghcr.io/sxhxliang/mcp-access-point:main205```206207208### Build Docker Image (Optional)209- install docker210- clone repository and build image211```bash212# Clone repository213git clone https://github.com/sxhxliang/mcp-access-point.git214cd mcp-access-point215216# Build image217docker build -t liangshihua/mcp-access-point:latest .218```219220- Run Docker Container221```bash222# Using environment variables (service running on host)223# Note: Replace /path/to/your/config.yaml with actual path224225docker run -d --name mcp-access-point --rm \226 -p 8080:8080 \227 -e port=8080 \228 -v /path/to/your/config.yaml:/app/config/config.yaml \229 liangshihua/mcp-access-point:latest230```231232### Environment Variables233- `port`: MCP Access Point listening port (default: 8080)234235## Typical Use Cases236237- **Progressive Architecture Migration**: Facilitate gradual transition from HTTP to MCP238- **Hybrid Architecture Support**: Reuse existing HTTP infrastructure within MCP ecosystem239- **Protocol Compatibility**: Build hybrid systems supporting both protocols240241**Example Scenario**:242When MCP-based AI clients need to interface with legacy HTTP microservices, the MCP Access Gateway acts as a middleware layer enabling seamless protocol conversion.243244Many thanks to [@limcheekin](https://github.com/limcheekin) for writing an article with a practical example: https://limcheekin.medium.com/building-your-first-no-code-mcp-server-the-fabric-integration-story-90da58cdbe1f245246## Runtime Configuration Management247248The MCP Access Point now supports dynamic configuration management through a RESTful Admin API, allowing you to update configurations without restarting the service.249250### Admin API Features251252- **Real-time Configuration Updates**: Modify upstreams, services, routes, and other resources on-the-fly253- **Dependency Validation**: Automatic validation of resource dependencies before changes254- **Batch Operations**: Execute multiple configuration changes atomically255- **Configuration Validation**: Dry-run mode to validate changes before applying256- **Resource Statistics**: Monitor and track configuration state257258### Admin API Configuration259260Add the following to your `config.yaml` to enable the Admin API:261262```yaml263access_point:264 admin:265 address: "127.0.0.1:8081" # Admin API listening address266 api_key: "your-api-key" # Optional API key for authentication267```268269### Admin API Endpoints270271#### Resource Management272- `GET /admin/resources` - Get resource summary and statistics273- `GET /admin/resources/{type}` - List all resources of a specific type274- `GET /admin/resources/{type}/{id}` - Get a specific resource275- `POST /admin/resources/{type}/{id}` - Create a new resource276- `PUT /admin/resources/{type}/{id}` - Update an existing resource277- `DELETE /admin/resources/{type}/{id}` - Delete a resource278279#### Advanced Operations280- `POST /admin/validate/{type}/{id}` - Validate resource configuration281- `POST /admin/batch` - Execute batch operations282- `POST /admin/reload/{type}` - Reload a specific resource type283- `POST /admin/reload/config` - Reload full configuration from file (defaults to `config.yaml`). Optional JSON body: `{ "config_path": "path/to/config.yaml" }`284285#### Supported Resource Types286- `upstreams` - Backend server configurations287- `services` - Service definitions288- `routes` - Routing rules289- `global_rules` - Global plugin rules290- `mcp_services` - MCP service configurations291- `ssls` - SSL certificate configurations292293### Admin API Examples294295#### Create a new upstream296```bash297curl -X POST http://localhost:8081/admin/resources/upstreams/my-upstream \298 -H "Content-Type: application/json" \299 -d '{300 "id": "my-upstream",301 "type": "RoundRobin",302 "nodes": ["127.0.0.1:8001", "127.0.0.1:8002"],303 "timeout": {304 "connect": 5,305 "read": 10,306 "send": 10307 }308 }'309```310311#### Create a service312```bash313curl -X POST http://localhost:8081/admin/resources/services/my-service \314 -H "Content-Type: application/json" \315 -d '{316 "id": "my-service",317 "upstream_id": "my-upstream",318 "hosts": ["api.example.com"]319 }'320```321322#### Batch operations323```bash324curl -X POST http://localhost:8081/admin/batch \325 -H "Content-Type: application/json" \326 -d '{327 "dry_run": false,328 "operations": [329 {330 "operation_type": "create",331 "resource_type": "upstreams",332 "resource_id": "batch-upstream",333 "data": {334 "id": "batch-upstream",335 "type": "Random",336 "nodes": ["192.168.1.10:8080"]337 }338 },339 {340 "operation_type": "create",341 "resource_type": "services",342 "resource_id": "batch-service",343 "data": {344 "id": "batch-service",345 "upstream_id": "batch-upstream"346 }347 }348 ]349 }'350```351352#### Get resource statistics353```bash354curl http://localhost:8081/admin/resources355```356357### Admin Dashboard UI358359- Route: `GET /admin` serves a built-in dashboard (`static/admin_dashboard.html`).360 1) `mcp_services`, 2) `ssls`, 3) `global_rules`, 4) `routes`, 5) `upstreams`, 6) `services`.361- Each card shows `count` and a formatted `last_updated` derived from the API response.362363#### Reload configuration from file364```bash365# Uses default config.yaml366curl -X POST http://localhost:8081/admin/reload/config \367 -H "Content-Type: application/json" \368 -H "x-api-key: your-api-key"369370# Or specify a different config path371curl -X POST http://localhost:8081/admin/reload/config \372 -H "Content-Type: application/json" \373 -H "x-api-key: your-api-key" \374 -d '{"config_path": "./config.yaml"}'375```376377### Testing the Admin API378379Use the provided test script to verify Admin API functionality:380381```bash382# Make the test script executable383chmod +x test-admin-api.sh384385# Run comprehensive API tests386./test-admin-api.sh387```388389For detailed Admin API documentation, see [RUNTIME_CONFIG_API.md](./RUNTIME_CONFIG_API.md).390391## Contribution Guidelines3921. Fork this repository.3932. Create a branch and commit your changes.3943. Create a pull request and wait for it to be merged.3954. Make sure your code follows the Rust coding standards.396
Full transparency — inspect the skill content before installing.