Manifold

Manifold

An MCP gateway that unifies multiple MCP servers and OpenAPI/Swagger REST APIs behind a single MCP interface, with protocol conversion, authentication, and automatic tool generation.

Category
访问服务器

README

Manifold

One interface. Many connections. Manifold.

CI Release Go Report Card License: MIT

English | 日本語

Manifold is a gateway that acts as an MCP server while connecting to multiple external MCP servers and OpenAPI / Swagger-compliant REST APIs on the backend.

Why "Manifold"?

The name Manifold comes from an engine's intake manifold.

An intake manifold is the component that distributes air and fuel evenly and efficiently from a single inlet to multiple cylinders. We named this project Manifold because its structure is similar.

Engine manifold This project
Single inlet Requests from MCP clients
Distribution / routing Protocol conversion / routing
To multiple cylinders To multiple external MCP / REST APIs

Architecture

MCP Client
    │
    ▼
┌─────────────┐
│   Manifold  │   ← this server
└─────────────┘
    │       │
    ▼       ▼
External  OpenAPI / Swagger
MCP       REST API Server
Server

Features

  • OpenAPI / Swagger → MCP conversion: Automatically generates MCP tools from OpenAPI 3.x / Swagger 2.x specifications
  • MCP backend aggregation: Transparent reverse proxy to external MCP servers
  • Built-in OAuth 2.1 server: Authorization server with PKCE (S256) support
  • Pluggable backend authentication: Choose one of static header (authValue) / OAuth 2.0 (oauth2) / API key Token Exchange (tokenExchange)
  • Resource links: Stores binary content from tool responses in S3 and returns download URLs (resource links)
  • Lazy connection: Connects to backends on first request (no backend dependency at gateway startup)
  • Selectable storage: Session / token management backed by Redis or SQLite
  • OpenTelemetry support: OTLP export of traces, metrics, and logs (metrics also support Prometheus-style pull)

Requirements

  • Go 1.26+
  • Redis or SQLite (for session management)

Installation

Download binary

Download the latest binary from Releases.

Build from source

git clone https://github.com/nonchan7720/manifold.git
cd manifold
go build -o manifold .

Docker

docker pull ghcr.io/nonchan7720/manifold:latest

Usage

Start the gateway

# Run the binary
manifold gateway

# Specify a config file explicitly (-c / --config, config name without extension)
manifold gateway -c config

# Run from source
go run main.go gateway

# Docker (working directory is /home/nonroot)
docker run -p 9999:9999 \
  -v $(pwd)/config.yaml:/home/nonroot/config.yaml \
  ghcr.io/nonchan7720/manifold:latest

Docker Compose (development)

Starts a development environment including Redis.

docker compose up -d

Ready-to-run configuration examples are available in the examples/ directory.

Configuration

Place a configuration file (config.yaml) in the current directory or in a config/ subdirectory. Configuration values support environment variable expansion in the form ${VAR} or ${VAR:-default}.

Connecting to an MCP backend

Expose an external MCP server through Manifold.

gateway:
  port: 9999
  # openssl rand -base64 32
  encryptKey: ${ENCRYPT_KEY}

mcpServers:
  my-mcp-server:
    description: External MCP server
    transport: http
    url: http://localhost:8080/mcp

sqlite:
  path: ./tmp/manifold.db

Connecting to an OpenAPI / Swagger backend

Automatically generate MCP tools from an OpenAPI specification.

gateway:
  port: 9999
  encryptKey: ${ENCRYPT_KEY}

mcpServers:
  my-api:
    description: Sample REST API
    spec: https://example.com/api/openapi.json
    baseURL: https://example.com

OpenAPI backend with OAuth 2.0 authentication

gateway:
  port: 9999
  encryptKey: ${ENCRYPT_KEY}

mcpServers:
  my-api:
    description: OAuth-protected API
    spec: https://example.com/api/openapi.json
    baseURL: https://example.com
    oauth2:
      clientID: YOUR_CLIENT_ID
      clientSecret: YOUR_CLIENT_SECRET
      authURL: https://example.com/oauth/authorize
      tokenURL: https://example.com/oauth/token
      scopes:
        - read
        - write

redis:
  addrs:
    - "${REDIS_ADDRS:-localhost:6379}"
  db: ${REDIS_DB:-0}

Configuration reference

gateway

Field Type Description
port int Listening port (default: 8081)
key string TLS private key file path (optional)
cert string TLS certificate file path (optional)
encryptKey string Token encryption key (required). Base64-encoded 32-byte AES-256 key. Generate with openssl rand -base64 32

mcpServers.<name>

Server names (<name>) are used in URL paths, so only alphanumerics, _, and - are allowed.

Field Type Description
description string Server description (required; included in /mcp/list responses)
transport string Transport for MCP backends (http or stdio)
url string Endpoint for the HTTP transport
command string Command for the stdio transport
args []string Arguments for the stdio command
env map[string]string Environment variables for the stdio process
spec string Path or URL of an OpenAPI/Swagger specification
baseURL string API base URL in OpenAPI mode (required when spec is set)
headers map[string]string Extra headers added to API requests
authValue object Static authentication settings (header, prefix, value)
oauth2 object OAuth 2.0 settings (see below)
tokenExchange object Token Exchange settings (see below)

authValue / oauth2 / tokenExchange are mutually exclusive; only one may be configured at a time.

mcpServers.<name>.oauth2

Field Type Description
clientID string Client ID (required)
clientSecret string Client secret (required)
authURL string Authorization endpoint (required; absolute URL)
tokenURL string Token endpoint (required; absolute URL)
scopes []string Scopes to request

mcpServers.<name>.tokenExchange

Exchanges the API key received from the client for an OAuth token at the specified token exchange endpoint, and uses it for backend requests. Exchange results are cached, and rate limits (429) are respected.

Field Type Description
url string Absolute URL of the token exchange endpoint (required)

redis

Field Type Description
url string Redis URL (e.g. redis://user:pass@localhost:6379/0)
addrs []string List of host:port pairs (for Cluster/Sentinel)
user string Username
password string Password
db int Database number
master_name string Sentinel master name
tls bool Enable TLS
cluster_mode bool Enable Cluster mode

sqlite

Field Type Description
path string Database file path (:memory: for in-memory)

Either redis or sqlite must be configured.

storage

Stores content included in OpenAPI/Swagger tool responses (images, binaries, etc.) in external storage and returns resource links (download URLs). When unset, no storage is used.

Field Type Description
type string Storage type. Currently only s3 is supported
hostURL string Host for download URLs (when set, content is served via Manifold's /media/download/{id})
s3.bucket string S3 bucket name (required when type: s3)
s3.keyPrefix string S3 object key prefix (required when type: s3)
storage:
  type: s3
  hostURL: https://manifold.example.com
  s3:
    bucket: my-bucket
    keyPrefix: manifold/media

fileFetch

When a URL is passed to a file input field of an OpenAPI/Swagger tool, Manifold downloads the file from that URL. As an SSRF countermeasure, connections to private/loopback/link-local IPs and the http:// scheme are rejected by default.

Field Type Description
allowLocal bool Allow connections to private/loopback IPs and http:// (for testing with local stacks; default: false)
allowedHosts []string Allowlist of hosts (hostname, or host:port). Empty allows all hosts (private IP blocking still applies)
maxSize int64 Maximum bytes for downloaded/base64/text content. 0 or unset defaults to 524288000 (500 MiB)

Each field can also be overridden via environment variables (FILEFETCH_MAXSIZE, FILEFETCH_ALLOWLOCAL, FILEFETCH_ALLOWEDHOSTS).

fileFetch:
  allowLocal: false
  maxSize: 524288000 # 500MiB
  # allowedHosts:
  #   - example.com
  #   - files.example.com:8443

telemetry

Output settings for traces, metrics, and logs via OpenTelemetry.

Field Type Description
serviceName string Service name
environment string Environment name (deployment.environment attribute)
gzipCompression bool Gzip compression for OTLP export
trace object Trace settings (enabled, http, grpc)
metrics object Metrics settings (enabled, exporterType: push / pull, http, grpc)
logs object Log settings (enabled, http, grpc)

For the http / grpc exporters, specify addr (host:port) or url. grpc also accepts insecure. With metrics.exporterType: pull, Prometheus-format metrics are exposed at the /metrics endpoint instead of OTLP push.

telemetry:
  serviceName: manifold
  trace:
    enabled: true
    grpc:
      addr: localhost:4317
      insecure: true
  metrics:
    enabled: true
    exporterType: push
    grpc:
      addr: localhost:4317
      insecure: true
  logs:
    enabled: true
    grpc:
      addr: localhost:4317
      insecure: true

HTTP endpoints

The HTTP endpoints exposed by Manifold.

MCP

Method Path Description
POST /mcp/{server_name} MCP requests (Streamable HTTP)
GET /mcp/list List registered servers (names and descriptions)

OAuth 2.1

Method Path Description
GET /.well-known/oauth-authorization-server/mcp/{server_name} Authorization Server metadata
GET /.well-known/oauth-protected-resource/mcp/{server_name} Protected Resource metadata
GET /{server_name}/auth/login Redirect to the login page
GET /{server_name}/auth/callback OAuth callback
POST /{server_name}/auth/token Token issuance
POST /{server_name}/auth/clients Dynamic client registration (RFC 7591)
GET /authorize, /callback Aliases without a server name
POST /token, /register Aliases without a server name

Other

Method Path Description
GET /media/download/{id} Download stored content (only when storage.hostURL is set)
GET /metrics Prometheus metrics (only when telemetry.metrics.exporterType: pull)

Development

See CONTRIBUTING.md for how to set up a development environment and submit changes.

Test

make test

Lint

make lint

Inspiration

This project is inspired by the Agent / MCP Gateway of LiteLLM.

Just as LiteLLM's MCP Gateway provides a unified access point to multiple MCP servers, Manifold aims to be a gateway that connects a single MCP interface to many MCP servers / REST APIs.

License

MIT License

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选