CAPI Gateway

io.github.surisoft-io由 GitHub 帳號 surisoft-io 發布v1.0.0更新於 Oct 25, 2026

Apache Camel API Gateway with REST-to-MCP bridging for LLM agents.

發布方自己的服務:core.blue

概覽

AI 產生的概覽

CAPI Gateway 是輕量級 API 閘道,其實驗性 MCP 模式可將 REST 與 MCP 後端暴露為 LLM 代理可用的 MCP 工具。

可以做什麼
探索並列出在 Consul 中註冊的 REST 服務,將其中介資料轉換為 MCP 工具目錄。呼叫這些工具,由 CAPI 將參數轉為 REST 請求並把回應包裝成 MCP 格式。將真正的 MCP Server 後端與 REST 後端彙整到同一個 MCP 端點。以負載平衡、容錯移轉和反向代理標頭代理 REST、WebSocket 與 SSE 流量。套用 OAuth2/OIDC、API Key 與 OPA 授權、流量限制、追蹤與 Prometheus 指標。
適用情境
適用於已在 Consul 後執行 REST 服務、希望助理不必修改後端就能將其當作 MCP 工具呼叫的情況,或想把多個 REST 與 MCP 後端統一在一個 MCP 端點的情況。
執行需求
以 Docker 映像(surisoft/capi-core)透過 stdio 在本機執行,也可用 JAR 或 Helm chart 執行。需要由 CAPI_CONFIG_FILE 環境變數指定的設定檔、帶 MCP 中介資料的 HashiCorp Consul 註冊中心,以及存取閘道埠(MCP 預設 8383)的網路。
安裝前請注意
MCP 閘道標示為實驗性。它會代理請求到你的後端,並可能依設定執行或略過安全策略,對外開放服務前應檢查 OAuth2/OIDC、API Key 與 OPA 設定。Helm 範例以參數傳入 SSL keystore 與密碼,應視為機密處理。工具呼叫會存取第三方 REST 服務。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 CAPI Gateway,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[CAPI]

[CAPI] [License] [Docker Image Version (latest by date)]


[Share your use case with us]

CAPI Gateway

Lightweight API Gateway

CAPI is a lightweight API Gateway and load balancer built on Undertow's async proxy architecture. Services register themselves in HashiCorp Consul, and CAPI automatically discovers them, creates proxy handlers, and applies security, throttling, and observability policies — no database required.

Features

  • REST, WebSocket, and SSE gateway with fully async proxying (zero threads blocked during backend calls)
  • Service discovery via HashiCorp Consul (automatic route creation and removal)
  • OAuth2 / OIDC token validation (multi-provider, cookie-based auth supported)
  • API Key authentication with per-key throttling (via Consul KV)
  • Fine-grained authorization via OPA (Open Policy Agent, async policy evaluation)
  • Distributed throttling (Hazelcast, with Kubernetes discovery)
  • Load balancing (Round Robin) and Failover
  • Distributed tracing (OpenTelemetry / OTLP)
  • Prometheus metrics
  • OpenAPI spec aggregation from upstream services
  • TLS termination and dynamic truststore management (via Consul KV hot-reload)
  • CORS management
  • Admin API with health, metrics, and route inspection
  • Multi-instance support (route targeting per CAPI instance)
  • Reverse proxy headers (X-Forwarded-*)
  • [Experimental] MCP Gateway — expose services as MCP tools for LLM agents (JSON-RPC 2.0 over Streamable HTTP)
  • [Experimental] gRPC Gateway — transparent HTTP/2 reverse proxy for gRPC services with header-based routing

REST-to-MCP Bridging

CAPI's MCP Gateway turns any existing REST API into an MCP tool — no code changes on your backends.

Register a service in Consul with MCP metadata, and LLM agents (Claude Desktop, Cursor, custom agents) can discover and invoke it immediately. Your REST services don't need to know anything about MCP, JSON-RPC, or tool schemas. CAPI handles the translation:

LLM Agent                          CAPI                          Your REST API                                                                 (unchanged)  tools/list  ──────────────►  reads Consul metadata              ◄──────────────  returns tool catalog
  tools/call  ──────────────►  extracts arguments              {"name":"..."}   POST /endpoint  ──────────────►  handles request                               wraps response  ◄──────────────  returns JSON              ◄──────────────  MCP-formatted result

CAPI also supports real MCP Server backends — services that already speak JSON-RPC 2.0. Register them with mcp-type: server and CAPI discovers their tools automatically via tools/list, then proxies tools/call requests transparently. Both REST and MCP Server backends are aggregated under one unified MCP endpoint.

Unlike dedicated MCP gateways that require all backends to be MCP Servers, CAPI bridges the gap between existing REST infrastructure and LLM-native protocols. See the MCP Gateway docs and the demo for a working example with both backend types.

Quickstart

CAPI requires the CAPI_CONFIG_FILE environment variable pointing to a valid configuration file.

Running from JAR

bash
CAPI_CONFIG_FILE=config/config.yaml java -jar capi-core.jar

Running with Docker

bash
docker run -p 8380:8380 -p 8381:8381 \  -v $(pwd)/config/config.yaml:/capi/config/config.yaml \  -e CAPI_CONFIG_FILE=/capi/config/config.yaml \  surisoft/capi-core

Running with Helm (Kubernetes)

A Helm chart is available in helm/capi-core/.

bash
helm install capi-core helm/capi-core
# With custom valueshelm install capi-core helm/capi-core -f my-values.yaml
# Enable SSL and truststorehelm install capi-core helm/capi-core \  --set capi.ssl.enabled=true \  --set capi.ssl.keystoreBase64=<base64-encoded-keystore> \  --set capi.ssl.password=changeit

See helm/capi-core/values.yaml for all available configuration options.

Ports

PortDescriptionConfig key
8380REST API gatewaycapi.rest.port
8381Admin / metricscapi.adminPort
8382WebSocket gatewaycapi.websocket.port
8383MCP Gateway (experimental)capi.mcp.port
8384gRPC Gateway (experimental)capi.grpc.port

Running Modes

The runningMode field controls which types of services CAPI will proxy:

ModeDescription
fullProxies REST, WebSocket, and SSE services (default)
websocketOnly proxies WebSocket services
sseOnly proxies SSE services

Documentation

DocumentDescription
Service RegistrationHow to register services in Consul and configure routing, security, and throttling via metadata
SecurityOAuth2/OIDC and OPA authorization configuration
Admin APIAdmin endpoints reference (health, metrics, routes, OpenAPI)
Configuration ReferenceComplete YAML configuration reference with all fields
MCP Gateway (Experimental)MCP Gateway for LLM tool integration via JSON-RPC 2.0
gRPC Gateway (Experimental)Transparent gRPC reverse proxy with header-based routing

來源:README.md,提交 ff325b9

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Core 整合