mcpify

command module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2026 License: MIT Imports: 3 Imported by: 0

README

mcpify

Turn any OpenAPI 3.x spec into a working MCP server in one command.

Point it at a spec (a file or a URL) and every API operation becomes an MCP tool. There is no code to generate and nothing to wire up: mcpify reads the spec, exposes one tool per operation, and proxies each tool call to the real API.

mcpify ls openapi.yaml        # preview the tools a spec exposes
mcpify openapi.yaml           # serve it as an MCP server over stdio

Install

curl -fsSL https://raw.githubusercontent.com/aloki-alok/mcpify/main/install.sh | sh

Or with Go (1.26+):

go install github.com/aloki-alok/mcpify@latest

Or grab a prebuilt binary from the releases page, or build from source:

git clone https://github.com/aloki-alok/mcpify
cd mcpify
go build -o mcpify .

Use

Preview what a spec turns into, without starting anything:

mcpify ls https://petstore3.swagger.io/api/v3/openapi.json

Serve a spec over stdio, the transport MCP clients use when they spawn a server:

mcpify ./petstore.yaml

Serve over HTTP instead:

mcpify --http :8080 ./petstore.yaml

Forward auth and override the upstream base URL:

mcpify --base https://api.example.com -H "Authorization: Bearer $TOKEN" spec.json

Expose only read operations (GET and HEAD):

mcpify --read-only spec.yaml
Plug into an MCP client

Any client that launches a server over stdio works. For example:

{
  "mcpServers": {
    "petstore": {
      "command": "mcpify",
      "args": ["--base", "https://api.example.com", "/path/to/openapi.json"]
    }
  }
}

How arguments map

Each operation's path, query, header, and cookie parameters become tool arguments. A JSON request body whose schema is an object is flattened so its fields are top-level arguments too; a parameter wins if it shares a name. Other body shapes (an array, a scalar) are taken as a single body argument. mcpify routes each argument back to the right place when it builds the upstream request.

Options

Flag Meaning
--base <url> upstream base URL, overriding the spec's servers
-H, --header "Name: value" header sent on every upstream request (repeatable)
--http <addr> serve over HTTP at addr instead of stdio
--read-only expose only GET and HEAD operations
--timeout <dur> upstream request timeout (default 30s)

Scope

OpenAPI 3.0 and 3.1, in JSON or YAML. One operation maps to one tool. Auth is pass-through: the headers you supply are forwarded upstream. Swagger 2.0 is not supported.

License

MIT

Documentation

Overview

Command mcpify turns any OpenAPI 3.x spec into a working MCP server in one command: every API operation becomes an MCP tool that proxies the real HTTP call. See DESIGN.md.

Directories

Path Synopsis
internal
cli
Package cli is mcpify's command surface: parse arguments, load an OpenAPI spec, and either serve it as an MCP server or preview the tools it would expose.
Package cli is mcpify's command surface: parse arguments, load an OpenAPI spec, and either serve it as an MCP server or preview the tools it would expose.
openapi
Package openapi parses the subset of an OpenAPI 3.x document that mcpify needs to expose each operation as an MCP tool: the servers, and for every operation its method, path, parameters, and JSON request body.
Package openapi parses the subset of an OpenAPI 3.x document that mcpify needs to expose each operation as an MCP tool: the servers, and for every operation its method, path, parameters, and JSON request body.
server
Package server wires a parsed OpenAPI document into a running MCP server: every tool definition gets a handler that proxies the call to the upstream API and formats the response back into an MCP result.
Package server wires a parsed OpenAPI document into a running MCP server: every tool definition gets a handler that proxies the call to the upstream API and formats the response back into an MCP result.
tool
Package tool turns OpenAPI operations into MCP tool definitions and builds the upstream HTTP request for a tool call.
Package tool turns OpenAPI operations into MCP tool definitions and builds the upstream HTTP request for a tool call.
ui
Package ui holds mcpify's terminal styling: ANSI colors that switch off when output is not a terminal, plus the wordmark.
Package ui holds mcpify's terminal styling: ANSI colors that switch off when output is not a terminal, plus the wordmark.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL