Skip to content
Back to search

mcp-access-point

Turn a web server into an MCP server in one click without making any code changes.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/sxhxliang--mcp-access-point/badge.svg)](/listings/sxhxliang--mcp-access-point)

HTML

<a href="/listings/sxhxliang--mcp-access-point"><img src="/api/listings/sxhxliang--mcp-access-point/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Installation

# Install from source
git clone https://github.com/sxhxliang/mcp-access-point.git
cd mcp-access-point
cargo run -- -c config.yaml

# Use inspector for debugging (start service first)
npx @modelcontextprotocol/inspector node build/index.js
# Access http://127.0.0.1:6274/
# Select "SSE" and enter 0.0.0.0:8080/sse, then click connect
# or select "Streamable HTTP" and enter 0.0.0.0:8080/mcp

Multi-tenancy Support

The MCP Access Gateway supports multi-tenancy, where each tenant can configure multiple MCP services accessible via: - `/api/{mcp-service-id}/sse` (for SSE) - `/api/{mcp-service-id}/mcp` (for Streamable HTTP)

Example configuration:

# config.yaml example (supports multiple services)

mcps:
  - id: service-1 # Access via /api/service-1/sse or /api/service-1/mcp
    ... # Service configuration
  - id: service-2 # Access via /api/service-2/sse or /api/service-2/mcp
    ... # Service configuration
  - id: service-3 # Access via /api/service-3/sse or /api/service-3/mcp
    ... # Service configuration

To access all services simultaneously, use: - `0.0.0.0:8080/mcp` (Streamable HTTP) - `0.0.0.0:8080/sse` (SSE)

Configuration Details

1. **`-c config.yaml`** - `-c` (or `--config`) specifies the configuration file path (`config.yaml`). - This file defines the APIs that the MCP Access Point will proxy and convert.

config.yaml Example

The configuration file supports multi-tenancy, allowing independent configuration of upstream services and routing rules for each MCP service. Key configuration items include:

1. **mcps** - MCP service list - `id`: Unique service identifier used to generate access paths - `upstream_id`: Associated upstream service ID - `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. - `routes`: Custom routing configuration (optional) - `upstream`: Upstream service specific configuration (optional)

2. **upstreams** - Upstream service configuration - `id`: Upstream service ID - `nodes`: Backend node addresses and weights - `type`: Load balancing algorithm (roundrobin/random/ip_hash) - `scheme`: Upstream protocol (http/https) - `pass_host`: HTTP Host header handling - `upstream_host`: Override Host header value

Complete configuration example:

# config.yaml example (supports multiple services)
mcps:
  - id: service-1 # Unique identifier, accessible via /api/service-1/sse or /api/service-1/mcp
    upstream_id: 1
    path: config/openapi_for_demo_patch1.json # Local OpenAPI spec path

  - id: service-2 # Unique identifier
    upstream_id: 2
    path: https://petstore.swagger.io/v2/swagger.json # Remote OpenAPI spec

  - id: service-3 
    upstream_id: 3
    routes: # Custom routing
      - id: 1
        operation_id: get_weather
        uri: /points/{latitude},{longitude}
        method: GET
        meta:
          name: Get Weather
          description: Retrieve weather information by coordinates
          inputSchema: # Optional input validation
            type: object
            required:
              - latitude
              - longitude
            properties:
              latitude:
                type: number
                minimum: -90
                maximum: 90
              longitude:
                type: number
                minimum: -180
                maximum: 180

upstreams: # Required upstream configuration
  - id: 1
    headers: # Headers to send to upstream service
      X-API-Key: "12345-abcdef"        # API key
      Authorization: "Bearer token123" # Bearer token
      User-Agent: "MyApp/1.0"          # User agent
      Accept: "application/json"       # Accept header
    nodes: # Backend nodes (IP or domain)
      "127.0.0.1:8090": 1 # Format: address:weight

  - id: 2 
    nodes:
      "127.0.0.1:8091": 1

  - id: 3 

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 395 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # MCP Access Point
  2. `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.
  3. <p align="center">
  4. <a href="./README.md"><img alt="README in English" src="https://img.shields.io/badge/English-4578DA"></a>
  5. <a href="./README_CN.md"><img alt="简体中文版" src="https://img.shields.io/badge/简体中文-F40002"></a>
  6. <a href="https://deepwiki.com/sxhxliang/mcp-access-point"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki"></a>
  7. <a href="https://zread.ai/sxhxliang/mcp-access-point"><img alt="中文文档" src="https://img.shields.io/badge/中文文档-4578DA"></a>
  8. </p>
  9. ![Admin Dashboard](assets/admin_dashboard.png)
  10. ## Introduction
  11. This 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.
  12. ## HTTP to MCP
  13. This 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.
  14. - Example setup includes two services:
  15. - Service 1 runs locally at `127.0.0.1:8090`
  16. - Service 2 runs remotely at `api.example.com`
  17. - Through the `MCP Access Point`, both services can be converted to MCP services without any code modifications.
  18. - 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.
  19. ```mermaid
  20. graph LR
  21. A["Cursor Desktop"] <--> |SSE| B["MCP Access Point"]
  22. A2["Other Desktop"] <--> |Streamable Http| B["MCP Access Point"]
  23. B <--> |http 127.0.0.1:8090| C1["Existing API Server"]
  24. B <--> |https//api.example.com| C2["Existing API Server"]
  25. style A2 fill:#ffe6f9,stroke:#333,color:black,stroke-width:2px
  26. style A fill:#ffe6f9,stroke:#333,color:black,stroke-width:2px
  27. style B fill:#e6e6af,stroke:#333,color:black,stroke-width:2px
  28. style C1 fill:#e6ffe6,stroke:#333,color:black,stroke-width:2px
  29. style C2 fill:#e6ffd6,stroke:#333,color:black,stroke-width:2px
  30. ```
  31. ### Transport Type (Specification)
  32. Currently supports `SSE` and `Streamable HTTP` protocols:
  33. - ✅ Streamable HTTP (stateless) 2025-03-26
  34. - All services: `ip:port/mcp`
  35. - Single service: `ip:port/api/{service_id}/mcp`
  36. - ✅ SSE 2024-11-05
  37. - All services: `ip:port/sse`
  38. - Single service: `ip:port/api/{service_id}/sse`
  39. use `IP:PORT/sse` for `SSE`
  40. use `IP:PORT/mcp` for `Streamable HTTP`
  41. ### Supported MCP clients
  42. - ✅ [MCP Inspector](https://github.com/modelcontextprotocol/inspector)
  43. - ✅ [Cursor Desktop](https://docs.cursor.com/context/model-context-protocol)
  44. - ✅ [Windsurf](https://docs.windsurf.com/plugins/cascade/mcp#model-context-protocol-mcp)
  45. - ✅ [VS Code](https://code.visualstudio.com/docs/copilot/chat/mcp-servers)
  46. - ✅ [Trae](https://docs.trae.ai/ide/model-context-protocol)
  47. ## Core Features
  48. - **Protocol Conversion**: Seamless conversion between HTTP and MCP protocols
  49. - **Zero-Intrusive Integration**: Full compatibility with existing HTTP services
  50. - **Client Empowerment**: Enables MCP clients to directly call standard HTTP services
  51. - **Lightweight Proxy**: Minimalist architecture with efficient protocol conversion
  52. - **Multi-tenancy**: Independent configuration and endpoints for each tenant
  53. - **Runtime Configuration Management**: Dynamic configuration updates without service restart
  54. - **Admin API**: RESTful API for real-time configuration management
  55. ## Quick Start
  56. ### Installation
  57. ```bash
  58. # Install from source
  59. git clone https://github.com/sxhxliang/mcp-access-point.git
  60. cd mcp-access-point
  61. cargo run -- -c config.yaml
  62. # Use inspector for debugging (start service first)
  63. npx @modelcontextprotocol/inspector node build/index.js
  64. # Access http://127.0.0.1:6274/
  65. # Select "SSE" and enter 0.0.0.0:8080/sse, then click connect
  66. # or select "Streamable HTTP" and enter 0.0.0.0:8080/mcp
  67. ```
  68. ### Multi-tenancy Support
  69. The MCP Access Gateway supports multi-tenancy, where each tenant can configure multiple MCP services accessible via:
  70. - `/api/{mcp-service-id}/sse` (for SSE)
  71. - `/api/{mcp-service-id}/mcp` (for Streamable HTTP)
  72. Example configuration:
  73. ```yaml
  74. # config.yaml example (supports multiple services)
  75. mcps:
  76. - id: service-1 # Access via /api/service-1/sse or /api/service-1/mcp
  77. ... # Service configuration
  78. - id: service-2 # Access via /api/service-2/sse or /api/service-2/mcp
  79. ... # Service configuration
  80. - id: service-3 # Access via /api/service-3/sse or /api/service-3/mcp
  81. ... # Service configuration
  82. ```
  83. To access all services simultaneously, use:
  84. - `0.0.0.0:8080/mcp` (Streamable HTTP)
  85. - `0.0.0.0:8080/sse` (SSE)
  86. ### Configuration Details
  87. 1. **`-c config.yaml`**
  88. - `-c` (or `--config`) specifies the configuration file path (`config.yaml`).
  89. - This file defines the APIs that the MCP Access Point will proxy and convert.
  90. ### config.yaml Example
  91. The configuration file supports multi-tenancy, allowing independent configuration of upstream services and routing rules for each MCP service. Key configuration items include:
  92. 1. **mcps** - MCP service list
  93. - `id`: Unique service identifier used to generate access paths
  94. - `upstream_id`: Associated upstream service ID
  95. - `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.
  96. - `routes`: Custom routing configuration (optional)
  97. - `upstream`: Upstream service specific configuration (optional)
  98. 2. **upstreams** - Upstream service configuration
  99. - `id`: Upstream service ID
  100. - `nodes`: Backend node addresses and weights
  101. - `type`: Load balancing algorithm (roundrobin/random/ip_hash)
  102. - `scheme`: Upstream protocol (http/https)
  103. - `pass_host`: HTTP Host header handling
  104. - `upstream_host`: Override Host header value
  105. Complete configuration example:
  106. ```yaml
  107. # config.yaml example (supports multiple services)
  108. mcps:
  109. - id: service-1 # Unique identifier, accessible via /api/service-1/sse or /api/service-1/mcp
  110. upstream_id: 1
  111. path: config/openapi_for_demo_patch1.json # Local OpenAPI spec path
  112. - id: service-2 # Unique identifier
  113. upstream_id: 2
  114. path: https://petstore.swagger.io/v2/swagger.json # Remote OpenAPI spec
  115. - id: service-3
  116. upstream_id: 3
  117. routes: # Custom routing
  118. - id: 1
  119. operation_id: get_weather
  120. uri: /points/{latitude},{longitude}
  121. method: GET
  122. meta:
  123. name: Get Weather
  124. description: Retrieve weather information by coordinates
  125. inputSchema: # Optional input validation
  126. type: object
  127. required:
  128. - latitude
  129. - longitude
  130. properties:
  131. latitude:
  132. type: number
  133. minimum: -90
  134. maximum: 90
  135. longitude:
  136. type: number
  137. minimum: -180
  138. maximum: 180
  139. upstreams: # Required upstream configuration
  140. - id: 1
  141. headers: # Headers to send to upstream service
  142. X-API-Key: "12345-abcdef" # API key
  143. Authorization: "Bearer token123" # Bearer token
  144. User-Agent: "MyApp/1.0" # User agent
  145. Accept: "application/json" # Accept header
  146. nodes: # Backend nodes (IP or domain)
  147. "127.0.0.1:8090": 1 # Format: address:weight
  148. - id: 2
  149. nodes:
  150. "127.0.0.1:8091": 1
  151. - id: 3
  152. nodes:
  153. "api.weather.gov": 1
  154. type: roundrobin # Load balancing algorithm
  155. scheme: https # Protocol
  156. pass_host: rewrite # Host header handling
  157. upstream_host: api.weather.gov # Override Host
  158. ```
  159. To run the MCP Access Gateway with config file:
  160. ```bash
  161. cargo run -- -c config.yaml
  162. ```
  163. ## Running via Docker
  164. ### Run Locally for quick start
  165. ```bash
  166. # Note: Replace /path/to/your/config.yaml with actual path
  167. docker run -d --name mcp-access-point --rm \
  168. -p 8080:8080 \
  169. -e port=8080 \
  170. -v /path/to/your/config.yaml:/app/config/config.yaml \
  171. ghcr.io/sxhxliang/mcp-access-point:main
  172. ```
  173. ### Build Docker Image (Optional)
  174. - install docker
  175. - clone repository and build image
  176. ```bash
  177. # Clone repository
  178. git clone https://github.com/sxhxliang/mcp-access-point.git
  179. cd mcp-access-point
  180. # Build image
  181. docker build -t liangshihua/mcp-access-point:latest .
  182. ```
  183. - Run Docker Container
  184. ```bash
  185. # Using environment variables (service running on host)
  186. # Note: Replace /path/to/your/config.yaml with actual path
  187. docker run -d --name mcp-access-point --rm \
  188. -p 8080:8080 \
  189. -e port=8080 \
  190. -v /path/to/your/config.yaml:/app/config/config.yaml \
  191. liangshihua/mcp-access-point:latest
  192. ```
  193. ### Environment Variables
  194. - `port`: MCP Access Point listening port (default: 8080)
  195. ## Typical Use Cases
  196. - **Progressive Architecture Migration**: Facilitate gradual transition from HTTP to MCP
  197. - **Hybrid Architecture Support**: Reuse existing HTTP infrastructure within MCP ecosystem
  198. - **Protocol Compatibility**: Build hybrid systems supporting both protocols
  199. **Example Scenario**:
  200. When MCP-based AI clients need to interface with legacy HTTP microservices, the MCP Access Gateway acts as a middleware layer enabling seamless protocol conversion.
  201. Many 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-90da58cdbe1f
  202. ## Runtime Configuration Management
  203. The MCP Access Point now supports dynamic configuration management through a RESTful Admin API, allowing you to update configurations without restarting the service.
  204. ### Admin API Features
  205. - **Real-time Configuration Updates**: Modify upstreams, services, routes, and other resources on-the-fly
  206. - **Dependency Validation**: Automatic validation of resource dependencies before changes
  207. - **Batch Operations**: Execute multiple configuration changes atomically
  208. - **Configuration Validation**: Dry-run mode to validate changes before applying
  209. - **Resource Statistics**: Monitor and track configuration state
  210. ### Admin API Configuration
  211. Add the following to your `config.yaml` to enable the Admin API:
  212. ```yaml
  213. access_point:
  214. admin:
  215. address: "127.0.0.1:8081" # Admin API listening address
  216. api_key: "your-api-key" # Optional API key for authentication
  217. ```
  218. ### Admin API Endpoints
  219. #### Resource Management
  220. - `GET /admin/resources` - Get resource summary and statistics
  221. - `GET /admin/resources/{type}` - List all resources of a specific type
  222. - `GET /admin/resources/{type}/{id}` - Get a specific resource
  223. - `POST /admin/resources/{type}/{id}` - Create a new resource
  224. - `PUT /admin/resources/{type}/{id}` - Update an existing resource
  225. - `DELETE /admin/resources/{type}/{id}` - Delete a resource
  226. #### Advanced Operations
  227. - `POST /admin/validate/{type}/{id}` - Validate resource configuration
  228. - `POST /admin/batch` - Execute batch operations
  229. - `POST /admin/reload/{type}` - Reload a specific resource type
  230. - `POST /admin/reload/config` - Reload full configuration from file (defaults to `config.yaml`). Optional JSON body: `{ "config_path": "path/to/config.yaml" }`
  231. #### Supported Resource Types
  232. - `upstreams` - Backend server configurations
  233. - `services` - Service definitions
  234. - `routes` - Routing rules
  235. - `global_rules` - Global plugin rules
  236. - `mcp_services` - MCP service configurations
  237. - `ssls` - SSL certificate configurations
  238. ### Admin API Examples
  239. #### Create a new upstream
  240. ```bash
  241. curl -X POST http://localhost:8081/admin/resources/upstreams/my-upstream \
  242. -H "Content-Type: application/json" \
  243. -d '{
  244. "id": "my-upstream",
  245. "type": "RoundRobin",
  246. "nodes": ["127.0.0.1:8001", "127.0.0.1:8002"],
  247. "timeout": {
  248. "connect": 5,
  249. "read": 10,
  250. "send": 10
  251. }
  252. }'
  253. ```
  254. #### Create a service
  255. ```bash
  256. curl -X POST http://localhost:8081/admin/resources/services/my-service \
  257. -H "Content-Type: application/json" \
  258. -d '{
  259. "id": "my-service",
  260. "upstream_id": "my-upstream",
  261. "hosts": ["api.example.com"]
  262. }'
  263. ```
  264. #### Batch operations
  265. ```bash
  266. curl -X POST http://localhost:8081/admin/batch \
  267. -H "Content-Type: application/json" \
  268. -d '{
  269. "dry_run": false,
  270. "operations": [
  271. {
  272. "operation_type": "create",
  273. "resource_type": "upstreams",
  274. "resource_id": "batch-upstream",
  275. "data": {
  276. "id": "batch-upstream",
  277. "type": "Random",
  278. "nodes": ["192.168.1.10:8080"]
  279. }
  280. },
  281. {
  282. "operation_type": "create",
  283. "resource_type": "services",
  284. "resource_id": "batch-service",
  285. "data": {
  286. "id": "batch-service",
  287. "upstream_id": "batch-upstream"
  288. }
  289. }
  290. ]
  291. }'
  292. ```
  293. #### Get resource statistics
  294. ```bash
  295. curl http://localhost:8081/admin/resources
  296. ```
  297. ### Admin Dashboard UI
  298. - Route: `GET /admin` serves a built-in dashboard (`static/admin_dashboard.html`).
  299. 1) `mcp_services`, 2) `ssls`, 3) `global_rules`, 4) `routes`, 5) `upstreams`, 6) `services`.
  300. - Each card shows `count` and a formatted `last_updated` derived from the API response.
  301. #### Reload configuration from file
  302. ```bash
  303. # Uses default config.yaml
  304. curl -X POST http://localhost:8081/admin/reload/config \
  305. -H "Content-Type: application/json" \
  306. -H "x-api-key: your-api-key"
  307. # Or specify a different config path
  308. curl -X POST http://localhost:8081/admin/reload/config \
  309. -H "Content-Type: application/json" \
  310. -H "x-api-key: your-api-key" \
  311. -d '{"config_path": "./config.yaml"}'
  312. ```
  313. ### Testing the Admin API
  314. Use the provided test script to verify Admin API functionality:
  315. ```bash
  316. # Make the test script executable
  317. chmod +x test-admin-api.sh
  318. # Run comprehensive API tests
  319. ./test-admin-api.sh
  320. ```
  321. For detailed Admin API documentation, see [RUNTIME_CONFIG_API.md](./RUNTIME_CONFIG_API.md).
  322. ## Contribution Guidelines
  323. 1. Fork this repository.
  324. 2. Create a branch and commit your changes.
  325. 3. Create a pull request and wait for it to be merged.
  326. 4. Make sure your code follows the Rust coding standards.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.