{"id":27743109,"url":"https://github.com/sxhxliang/mcp-access-point","last_synced_at":"2025-10-05T21:20:16.942Z","repository":{"id":286812372,"uuid":"961469209","full_name":"sxhxliang/mcp-access-point","owner":"sxhxliang","description":"Turn a web server into an MCP server in one click without making any code changes.","archived":false,"fork":false,"pushed_at":"2025-09-30T08:39:37.000Z","size":694,"stargazers_count":129,"open_issues_count":0,"forks_count":24,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-30T09:28:20.448Z","etag":null,"topics":["gateway","mcp","mcp-servers","proxy"],"latest_commit_sha":null,"homepage":"https://deepwiki.com/sxhxliang/mcp-access-point","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sxhxliang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-06T15:35:00.000Z","updated_at":"2025-09-30T09:12:19.000Z","dependencies_parsed_at":"2025-04-08T14:23:17.843Z","dependency_job_id":"c49c490f-9796-4b11-9bdd-95ba91f9e142","html_url":"https://github.com/sxhxliang/mcp-access-point","commit_stats":null,"previous_names":["sxhxliang/mcp-access-point"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/sxhxliang/mcp-access-point","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sxhxliang%2Fmcp-access-point","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sxhxliang%2Fmcp-access-point/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sxhxliang%2Fmcp-access-point/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sxhxliang%2Fmcp-access-point/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sxhxliang","download_url":"https://codeload.github.com/sxhxliang/mcp-access-point/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sxhxliang%2Fmcp-access-point/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278522053,"owners_count":26000779,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gateway","mcp","mcp-servers","proxy"],"created_at":"2025-04-28T17:00:54.307Z","updated_at":"2025-10-05T21:20:16.936Z","avatar_url":"https://github.com/sxhxliang.png","language":"Rust","funding_links":[],"categories":["CI/CD \u0026 DevOps Pipelines","Aggregators \u0026 Gateways","MCP Middleware \u0026 Orchestration","Aggregators","📚 Projects (1974 total)","サーバー実装","Rust","🔧 Utilities","📂 카테고리"],"sub_categories":["🔗 Aggregators","Gateways \u0026 Proxies","MCP Servers","🔗 \u003ca name=\"aggregators\"\u003e\u003c/a\u003eアグリゲーター"],"readme":"# MCP Access Point  \r\n\r\n`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.  \r\n\u003cp align=\"center\"\u003e\r\n  \u003ca href=\"./README.md\"\u003e\u003cimg alt=\"README in English\" src=\"https://img.shields.io/badge/English-4578DA\"\u003e\u003c/a\u003e\r\n  \u003ca href=\"./README_CN.md\"\u003e\u003cimg alt=\"简体中文版\" src=\"https://img.shields.io/badge/简体中文-F40002\"\u003e\u003c/a\u003e\r\n  \u003ca href=\"https://deepwiki.com/sxhxliang/mcp-access-point\"\u003e\u003cimg src=\"https://deepwiki.com/badge.svg\" alt=\"Ask DeepWiki\"\u003e\u003c/a\u003e\r\n  \u003ca href=\"https://zread.ai/sxhxliang/mcp-access-point\"\u003e\u003cimg alt=\"中文文档\" src=\"https://img.shields.io/badge/中文文档-4578DA\"\u003e\u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\n![Admin Dashboard](assets/admin_dashboard.png)\r\n\r\n## Introduction  \r\nThis 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.\r\n\r\n## HTTP to MCP  \r\nThis 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.\r\n\r\n- Example setup includes two services:  \r\n  - Service 1 runs locally at `127.0.0.1:8090`  \r\n  - Service 2 runs remotely at `api.example.com`  \r\n- Through the `MCP Access Point`, both services can be converted to MCP services without any code modifications.  \r\n- 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.\r\n\r\n```mermaid\r\ngraph LR\r\n   A[\"Cursor Desktop\"] \u003c--\u003e |SSE| B[\"MCP Access Point\"]\r\n   A2[\"Other Desktop\"] \u003c--\u003e |Streamable Http| B[\"MCP Access Point\"]\r\n   B \u003c--\u003e |http 127.0.0.1:8090| C1[\"Existing API Server\"]\r\n   B \u003c--\u003e |https//api.example.com| C2[\"Existing API Server\"]\r\n  \r\n   style A2 fill:#ffe6f9,stroke:#333,color:black,stroke-width:2px\r\n   style A fill:#ffe6f9,stroke:#333,color:black,stroke-width:2px\r\n   style B fill:#e6e6af,stroke:#333,color:black,stroke-width:2px\r\n   style C1 fill:#e6ffe6,stroke:#333,color:black,stroke-width:2px\r\n   style C2 fill:#e6ffd6,stroke:#333,color:black,stroke-width:2px\r\n```\r\n\r\n### Transport Type (Specification)\r\nCurrently supports `SSE` and `Streamable HTTP` protocols:\r\n- ✅ Streamable HTTP (stateless) 2025-03-26\r\n  - All services: `ip:port/mcp`\r\n  - Single service: `ip:port/api/{service_id}/mcp`\r\n  \r\n- ✅ SSE 2024-11-05\r\n  - All services: `ip:port/sse`\r\n  - Single service: `ip:port/api/{service_id}/sse`\r\n\r\nuse `IP:PORT/sse` for `SSE` \r\nuse `IP:PORT/mcp` for `Streamable HTTP` \r\n\r\n### Supported MCP clients\r\n- ✅ [MCP Inspector](https://github.com/modelcontextprotocol/inspector)\r\n- ✅ [Cursor Desktop](https://docs.cursor.com/context/model-context-protocol)\r\n- ✅ [Windsurf](https://docs.windsurf.com/plugins/cascade/mcp#model-context-protocol-mcp)\r\n- ✅ [VS Code](https://code.visualstudio.com/docs/copilot/chat/mcp-servers)\r\n- ✅ [Trae](https://docs.trae.ai/ide/model-context-protocol)\r\n\r\n## Core Features\r\n- **Protocol Conversion**: Seamless conversion between HTTP and MCP protocols\r\n- **Zero-Intrusive Integration**: Full compatibility with existing HTTP services\r\n- **Client Empowerment**: Enables MCP clients to directly call standard HTTP services\r\n- **Lightweight Proxy**: Minimalist architecture with efficient protocol conversion\r\n- **Multi-tenancy**: Independent configuration and endpoints for each tenant\r\n- **Runtime Configuration Management**: Dynamic configuration updates without service restart\r\n- **Admin API**: RESTful API for real-time configuration management\r\n\r\n## Quick Start  \r\n\r\n### Installation  \r\n```bash\r\n# Install from source\r\ngit clone https://github.com/sxhxliang/mcp-access-point.git\r\ncd mcp-access-point\r\ncargo run -- -c config.yaml\r\n\r\n# Use inspector for debugging (start service first)\r\nnpx @modelcontextprotocol/inspector node build/index.js\r\n# Access http://127.0.0.1:6274/\r\n# Select \"SSE\" and enter 0.0.0.0:8080/sse, then click connect\r\n# or select \"Streamable HTTP\" and enter 0.0.0.0:8080/mcp\r\n```\r\n\r\n### Multi-tenancy Support\r\nThe MCP Access Gateway supports multi-tenancy, where each tenant can configure multiple MCP services accessible via:\r\n- `/api/{mcp-service-id}/sse` (for SSE)\r\n- `/api/{mcp-service-id}/mcp` (for Streamable HTTP)\r\n\r\nExample configuration:\r\n```yaml\r\n# config.yaml example (supports multiple services)\r\n\r\nmcps:\r\n  - id: service-1 # Access via /api/service-1/sse or /api/service-1/mcp\r\n    ... # Service configuration\r\n  - id: service-2 # Access via /api/service-2/sse or /api/service-2/mcp\r\n    ... # Service configuration\r\n  - id: service-3 # Access via /api/service-3/sse or /api/service-3/mcp\r\n    ... # Service configuration\r\n```\r\n\r\nTo access all services simultaneously, use:\r\n- `0.0.0.0:8080/mcp` (Streamable HTTP)\r\n- `0.0.0.0:8080/sse` (SSE)\r\n\r\n### Configuration Details\r\n1. **`-c config.yaml`**\r\n   - `-c` (or `--config`) specifies the configuration file path (`config.yaml`).\r\n   - This file defines the APIs that the MCP Access Point will proxy and convert.\r\n\r\n### config.yaml Example\r\nThe configuration file supports multi-tenancy, allowing independent configuration of upstream services and routing rules for each MCP service. Key configuration items include:\r\n\r\n1. **mcps** - MCP service list\r\n   - `id`: Unique service identifier used to generate access paths\r\n   - `upstream_id`: Associated upstream service ID\r\n   - `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.\r\n   - `routes`: Custom routing configuration (optional)\r\n   - `upstream`: Upstream service specific configuration (optional)\r\n\r\n2. **upstreams** - Upstream service configuration\r\n   - `id`: Upstream service ID\r\n   - `nodes`: Backend node addresses and weights\r\n   - `type`: Load balancing algorithm (roundrobin/random/ip_hash)\r\n   - `scheme`: Upstream protocol (http/https)\r\n   - `pass_host`: HTTP Host header handling\r\n   - `upstream_host`: Override Host header value\r\n\r\nComplete configuration example:\r\n```yaml\r\n# config.yaml example (supports multiple services)\r\nmcps:\r\n  - id: service-1 # Unique identifier, accessible via /api/service-1/sse or /api/service-1/mcp\r\n    upstream_id: 1\r\n    path: config/openapi_for_demo_patch1.json # Local OpenAPI spec path\r\n\r\n  - id: service-2 # Unique identifier\r\n    upstream_id: 2\r\n    path: https://petstore.swagger.io/v2/swagger.json # Remote OpenAPI spec\r\n\r\n  - id: service-3 \r\n    upstream_id: 3\r\n    routes: # Custom routing\r\n      - id: 1\r\n        operation_id: get_weather\r\n        uri: /points/{latitude},{longitude}\r\n        method: GET\r\n        meta:\r\n          name: Get Weather\r\n          description: Retrieve weather information by coordinates\r\n          inputSchema: # Optional input validation\r\n            type: object\r\n            required:\r\n              - latitude\r\n              - longitude\r\n            properties:\r\n              latitude:\r\n                type: number\r\n                minimum: -90\r\n                maximum: 90\r\n              longitude:\r\n                type: number\r\n                minimum: -180\r\n                maximum: 180\r\n\r\nupstreams: # Required upstream configuration\r\n  - id: 1\r\n    headers: # Headers to send to upstream service\r\n      X-API-Key: \"12345-abcdef\"        # API key\r\n      Authorization: \"Bearer token123\" # Bearer token\r\n      User-Agent: \"MyApp/1.0\"          # User agent\r\n      Accept: \"application/json\"       # Accept header\r\n    nodes: # Backend nodes (IP or domain)\r\n      \"127.0.0.1:8090\": 1 # Format: address:weight\r\n\r\n  - id: 2 \r\n    nodes:\r\n      \"127.0.0.1:8091\": 1\r\n\r\n  - id: 3 \r\n    nodes:\r\n      \"api.weather.gov\": 1\r\n    type: roundrobin # Load balancing algorithm\r\n    scheme: https # Protocol\r\n    pass_host: rewrite # Host header handling\r\n    upstream_host: api.weather.gov # Override Host\r\n```\r\n\r\nTo run the MCP Access Gateway with config file:\r\n```bash\r\ncargo run -- -c config.yaml\r\n```\r\n\r\n## Running via Docker  \r\n\r\n### Run Locally for quick start\r\n\r\n```bash\r\n# Note: Replace /path/to/your/config.yaml with actual path\r\ndocker run -d --name mcp-access-point --rm \\\r\n  -p 8080:8080 \\\r\n  -e port=8080 \\\r\n  -v /path/to/your/config.yaml:/app/config/config.yaml \\\r\n  ghcr.io/sxhxliang/mcp-access-point:main\r\n```\r\n\r\n\r\n### Build Docker Image (Optional)  \r\n- install docker\r\n- clone repository and build image\r\n```bash\r\n# Clone repository\r\ngit clone https://github.com/sxhxliang/mcp-access-point.git\r\ncd mcp-access-point\r\n\r\n# Build image\r\ndocker build -t liangshihua/mcp-access-point:latest .\r\n```\r\n\r\n- Run Docker Container\r\n```bash\r\n# Using environment variables (service running on host)\r\n# Note: Replace /path/to/your/config.yaml with actual path\r\n\r\ndocker run -d --name mcp-access-point --rm \\\r\n  -p 8080:8080 \\\r\n  -e port=8080 \\\r\n  -v /path/to/your/config.yaml:/app/config/config.yaml \\\r\n  liangshihua/mcp-access-point:latest\r\n```\r\n\r\n### Environment Variables  \r\n- `port`: MCP Access Point listening port (default: 8080)\r\n\r\n## Typical Use Cases  \r\n\r\n- **Progressive Architecture Migration**: Facilitate gradual transition from HTTP to MCP  \r\n- **Hybrid Architecture Support**: Reuse existing HTTP infrastructure within MCP ecosystem  \r\n- **Protocol Compatibility**: Build hybrid systems supporting both protocols  \r\n\r\n**Example Scenario**:  \r\nWhen MCP-based AI clients need to interface with legacy HTTP microservices, the MCP Access Gateway acts as a middleware layer enabling seamless protocol conversion.\r\n\r\nMany 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\r\n\r\n## Runtime Configuration Management\r\n\r\nThe MCP Access Point now supports dynamic configuration management through a RESTful Admin API, allowing you to update configurations without restarting the service.\r\n\r\n### Admin API Features\r\n\r\n- **Real-time Configuration Updates**: Modify upstreams, services, routes, and other resources on-the-fly\r\n- **Dependency Validation**: Automatic validation of resource dependencies before changes\r\n- **Batch Operations**: Execute multiple configuration changes atomically\r\n- **Configuration Validation**: Dry-run mode to validate changes before applying\r\n- **Resource Statistics**: Monitor and track configuration state\r\n\r\n### Admin API Configuration\r\n\r\nAdd the following to your `config.yaml` to enable the Admin API:\r\n\r\n```yaml\r\naccess_point:\r\n  admin:\r\n    address: \"127.0.0.1:8081\"  # Admin API listening address\r\n    api_key: \"your-api-key\"    # Optional API key for authentication\r\n```\r\n\r\n### Admin API Endpoints\r\n\r\n#### Resource Management\r\n- `GET /admin/resources` - Get resource summary and statistics\r\n- `GET /admin/resources/{type}` - List all resources of a specific type\r\n- `GET /admin/resources/{type}/{id}` - Get a specific resource\r\n- `POST /admin/resources/{type}/{id}` - Create a new resource\r\n- `PUT /admin/resources/{type}/{id}` - Update an existing resource\r\n- `DELETE /admin/resources/{type}/{id}` - Delete a resource\r\n\r\n#### Advanced Operations\r\n- `POST /admin/validate/{type}/{id}` - Validate resource configuration\r\n- `POST /admin/batch` - Execute batch operations\r\n- `POST /admin/reload/{type}` - Reload a specific resource type\r\n- `POST /admin/reload/config` - Reload full configuration from file (defaults to `config.yaml`). Optional JSON body: `{ \"config_path\": \"path/to/config.yaml\" }`\r\n\r\n#### Supported Resource Types\r\n- `upstreams` - Backend server configurations\r\n- `services` - Service definitions\r\n- `routes` - Routing rules\r\n- `global_rules` - Global plugin rules\r\n- `mcp_services` - MCP service configurations\r\n- `ssls` - SSL certificate configurations\r\n\r\n### Admin API Examples\r\n\r\n#### Create a new upstream\r\n```bash\r\ncurl -X POST http://localhost:8081/admin/resources/upstreams/my-upstream \\\r\n  -H \"Content-Type: application/json\" \\\r\n  -d '{\r\n    \"id\": \"my-upstream\",\r\n    \"type\": \"RoundRobin\",\r\n    \"nodes\": [\"127.0.0.1:8001\", \"127.0.0.1:8002\"],\r\n    \"timeout\": {\r\n      \"connect\": 5,\r\n      \"read\": 10,\r\n      \"send\": 10\r\n    }\r\n  }'\r\n```\r\n\r\n#### Create a service\r\n```bash\r\ncurl -X POST http://localhost:8081/admin/resources/services/my-service \\\r\n  -H \"Content-Type: application/json\" \\\r\n  -d '{\r\n    \"id\": \"my-service\",\r\n    \"upstream_id\": \"my-upstream\",\r\n    \"hosts\": [\"api.example.com\"]\r\n  }'\r\n```\r\n\r\n#### Batch operations\r\n```bash\r\ncurl -X POST http://localhost:8081/admin/batch \\\r\n  -H \"Content-Type: application/json\" \\\r\n  -d '{\r\n    \"dry_run\": false,\r\n    \"operations\": [\r\n      {\r\n        \"operation_type\": \"create\",\r\n        \"resource_type\": \"upstreams\",\r\n        \"resource_id\": \"batch-upstream\",\r\n        \"data\": {\r\n          \"id\": \"batch-upstream\",\r\n          \"type\": \"Random\",\r\n          \"nodes\": [\"192.168.1.10:8080\"]\r\n        }\r\n      },\r\n      {\r\n        \"operation_type\": \"create\",\r\n        \"resource_type\": \"services\",\r\n        \"resource_id\": \"batch-service\",\r\n        \"data\": {\r\n          \"id\": \"batch-service\",\r\n          \"upstream_id\": \"batch-upstream\"\r\n        }\r\n      }\r\n    ]\r\n  }'\r\n```\r\n\r\n#### Get resource statistics\r\n```bash\r\ncurl http://localhost:8081/admin/resources\r\n```\r\n\r\n### Admin Dashboard UI\r\n\r\n- Route: `GET /admin` serves a built-in dashboard (`static/admin_dashboard.html`).\r\n  1) `mcp_services`, 2) `ssls`, 3) `global_rules`, 4) `routes`, 5) `upstreams`, 6) `services`.\r\n- Each card shows `count` and a formatted `last_updated` derived from the API response.\r\n\r\n#### Reload configuration from file\r\n```bash\r\n# Uses default config.yaml\r\ncurl -X POST http://localhost:8081/admin/reload/config \\\r\n  -H \"Content-Type: application/json\" \\\r\n  -H \"x-api-key: your-api-key\"\r\n\r\n# Or specify a different config path\r\ncurl -X POST http://localhost:8081/admin/reload/config \\\r\n  -H \"Content-Type: application/json\" \\\r\n  -H \"x-api-key: your-api-key\" \\\r\n  -d '{\"config_path\": \"./config.yaml\"}'\r\n```\r\n\r\n### Testing the Admin API\r\n\r\nUse the provided test script to verify Admin API functionality:\r\n\r\n```bash\r\n# Make the test script executable\r\nchmod +x test-admin-api.sh\r\n\r\n# Run comprehensive API tests\r\n./test-admin-api.sh\r\n```\r\n\r\nFor detailed Admin API documentation, see [RUNTIME_CONFIG_API.md](./RUNTIME_CONFIG_API.md).\r\n\r\n## Contribution Guidelines\r\n1. Fork this repository.\r\n2. Create a branch and commit your changes.\r\n3. Create a pull request and wait for it to be merged.\r\n4. Make sure your code follows the Rust coding standards.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsxhxliang%2Fmcp-access-point","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsxhxliang%2Fmcp-access-point","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsxhxliang%2Fmcp-access-point/lists"}