yas-mcp

yas-mcp

Yet another Swagger MCP. A Rust server that turns OpenAPI specs into MCP tools.

The problem

Every API has a swagger.json. Every AI assistant needs MCP tools to call APIs. Writing MCP servers by hand is tedious. This should be automated.

Why I wrote it

After building mcp-prefect in Python, I wanted something faster and more portable. I also noticed every existing swagger-to-mcp tool was written in JavaScript or Python. Rust gives you a single binary with no runtime dependencies.

The MCP ecosystem was exploding in mid 2025 and everyone was hand-rolling MCP servers for their APIs. This seemed silly, it dawned on me while i was copying and pasting wrapper endpoints, oh, … hmm, i bet these are all described in the fastAPI spec of prefect. If you already have an OpenAPI spec, the MCP server should be generated automatically. heck why not.

What it does

Point it at an OpenAPI spec:

yas-mcp --swagger-file api.yaml --mode stdio

It parses the spec and exposes every endpoint as an MCP tool. AI assistants can then call your API through the standard MCP protocol.

Here:

{"jsonrpc":"2.0","id":1,"method":"tools/list"}

Paste that into stdin when running in stdio mode. You should get back a response with all the MCP tools generated from your OpenAPI spec.

Other useful requests:

{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}
{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_todos","arguments":{}}}

Features

Why Rust

Fast startup matters for MCP servers — they often spawn per-session. A Rust binary starts instantly. No Python interpreter, no Node runtime, no cold start.

Also I just wanted to write more Rust.

Security

If you’re loading an untrusted OpenAPI spec, run it sandboxed. Tool descriptions are attacker-controlled input. A malicious spec could try to exfiltrate data through crafted descriptions.

The README includes a bubblewrap example for sandboxing, or just run it in Docker.

Additionally there is a half working implementation which enables Oauth2 via keycloak, its not done yet, I haven’t had a need for it … yet.

Usage

Basic:

yas-mcp --swagger-file path/to/openapi.yaml --mode stdio

With config file:

server:
  mode: stdio
  name: yas-mcp

endpoint:
  base_url: http://localhost:8080
  auth_type: none

swagger_file: api.yaml

Filter routes with adjustments.yaml:

routes:
  - path: /users/me
    methods: [GET]
  - path: /todos
    methods: [GET, POST]

Edit

SSE is deprecated

Source

github.com/allen-munsch/yas-mcp