# Your REST API is Already an MCP Server

> Point Gatana at an OpenAPI spec and every endpoint becomes a typed MCP tool — no wrapper code to write or maintain.

Erik Jonsson Thorén, Founder, Gatana. Published 2026-07-08. Human-readable version: https://www.gatana.ai/blog/your-rest-api-is-already-an-mcp-server

## The wrapper problem

If you have a REST API and you want AI agents to use it, the standard advice right now is to build an MCP server that wraps it. In practice that means writing a tool definition for every endpoint, mapping parameters to HTTP requests, re-implementing auth you already solved once, and then keeping all of it in sync as the API changes.

That's a lot of work to re-describe something you've already described. If your API has an OpenAPI spec, the tool names, parameters, types, and descriptions all exist — they're just in a format MCP clients don't read.

So we made Gatana read it.

## How it works

Paste an OpenAPI 3.x or Swagger 2.0 spec into Gatana, or point it at a URL where one is hosted. Each operation in the spec becomes an MCP tool, using the schemas and descriptions you already wrote:

```yaml
# Your existing spec:
/github/pulls/{owner}/{repo}/{pull_number}:
  get:
    operationId: getPullRequest
    summary: Get details of a pull request
    parameters:
      - name: owner
        in: path
        required: true
        schema: { type: string }
      - name: repo
        in: path
        required: true
        schema: { type: string }
      - name: pull_number
        in: path
        required: true
        schema: { type: integer }

# Gatana turns this into a `getPullRequest` MCP tool with
# typed parameters and live execution against your API.
```

Agents call `getPullRequest(owner, repo, pull_number)` like any other MCP tool. The fact that there's a REST API behind it is an implementation detail they never see.

A few things happen under the hood that you'd otherwise have to build yourself:

* **Schema extraction** — path parameters, query strings, headers, and request bodies are pulled from the spec, with nested `$ref`s resolved, so each tool has a complete self-contained schema.
* **HTTP translation** — Gatana handles path substitution, query assembly, headers, body serialization, and response parsing. Errors come back as readable messages rather than raw HTTP failures.
* **Sync** — if you point at a hosted spec URL, the tools update as your API evolves, so there's no second source of truth to maintain.

Both Swagger 2.0 and OpenAPI 3.x are supported.

## Pointing it at your environments

Two settings cover most real-world setups:

* **Base URL override** lets you use the same spec against development or production without editing the spec itself.
* **Custom headers** let you attach an `Authorization` header, API key, or tenant identifier to every call. These work with Gatana's [Credentials system](https://docs.gatana.ai/credentials), so secrets stay managed and rotatable instead of living in your config.

There's also a test button that validates the spec before you save — it shows the API title, version, operation count, and resolved endpoints, so you can catch problems before an agent does.

## Beyond a single API

Once an API is in Gatana, it plugs into everything else: bundle it with other servers into [Profiles](https://docs.gatana.ai/profiles) so agents get a curated toolset, control who can use it with [Teams](https://docs.gatana.ai/people-and-teams/), and combine it with [Code Mode](https://docs.gatana.ai/code-mode/) to let agents orchestrate many endpoints in one sandboxed execution instead of making a round trip per call.

The point isn't just skipping some boilerplate. It's that the API your team already built — documented, secured, in production — becomes usable by agents without anyone writing or maintaining a wrapper for it.

---

<Callout type="info">

**Setting up an OpenAPI server takes a couple of minutes.** The [OpenAPI/Swagger documentation](https://docs.gatana.ai/docs/adding-servers/servers-openapi-swagger) has the full walkthrough.

</Callout>
