Skip to content
API Bear: spec in, tools out An animated diagram. API Bear reads each operation in an OpenAPI spec and turns it into an MCP tool. An AI assistant is then asked for the last five failed invoices, calls the listInvoices tool, API Bear sends the request straight to your API, and the results come back to the assistant. 1YOUR SPEC 2API BEAR 3MCP TOOLS 4YOUR ASSISTANT openapi.yamlopenapi: 3.1.0paths:/invoices:get:operationId: listInvoices/invoices/{id}:get:operationId: getInvoice/refunds:post:operationId: createRefund $ npx apibear api.yourapp.comHTTPS · DIRECT200 OK GETlistInvoices GETgetInvoice POSTcreateRefund Assistant3 tools readyShow my last 5 failed invoiceslistInvoices status=failed limit=5Here are your 5 latest failed invoices:INV-2041Acme Co$1,240.00failedINV-2038Northwind$86.50failedINV-2033Globex$412.00failedINV-2029Initech$2,975.00failedINV-2024Hooli$59.99failed
Spec in. Tools out.

Your OpenAPI spec is already an MCP server.

Point API Bear at the spec you already have, and every endpoint becomes a tool your AI assistant can call. No server to write, no tool definitions to maintain. It runs on your machine and talks straight to your API.

npx -y apibear --spec ./openapi.json
Works with Claude Desktop · Claude Code · Cursor · VS Code · Windsurf · Kiro · OpenCode · any stdio MCP client

One package, two ways in

Run it, or build on it. Same install.

The CLI and the parser library ship together as apibear, so they can never drift apart.

Build on itNode · Browser · Edge

import "apibear"

Building your own MCP host or agent platform? Import the exact parser the CLI runs: a typed, dependency-free engine that turns OpenAPI 3.0/3.1 into MCP tool definitions.

  • What you test is what you ship. The tools --list-tools prints are the tools your code gets from parseOpenApiToTools.
  • One version to pin. Pin apibear once and you get the same parser whether you run it or import it.
  • One changelog, one repo. A fix lands in the CLI and the library in the same release.

How it works

Three steps. Zero code.

No tool definitions to hand-write, no server to deploy, nothing in the middle.

  1. Point it at your spec

    A local file or an https:// URL, JSON or YAML, OpenAPI 3.0 or 3.1. If the spec doesn't say where the API lives, add --base-url.

  2. Hand it your key

    Pass your token with --header, once or as many times as you need. API Bear adds the headers to every request and sends them only to your API.

  3. Just ask

    Ask for “the last five failed invoices” and your assistant picks the right endpoint, fills in the parameters and reads the result. If the API says no, the error comes back in plain view so the model can fix its request and try again.

Setup

Paste it into your client

Pick your client, swap in your spec and token, and restart. That's the whole install.

claude_desktop_config.json
{
  "mcpServers": {
    "petstore": {
      "command": "npx",
      "args": [
        "-y", "apibear",
        "--spec", "https://petstore3.swagger.io/api/v3/openapi.json",
        "--header", "Authorization: Bearer YOUR_TOKEN"
      ]
    }
  }
}

See your tools before your assistant does

Add --list-tools to preview exactly which tools your spec produces, right in your terminal.

terminal
$ npx -y apibear --spec ./petstore.json --list-tools
listPets      List all pets
createPet     Create a pet
showPetById   Info for a specific pet

Why API Bear

Small, sturdy, and on your side

API Bear does one job and sweats the details that make it work well with a model.

Runs on your machine

Requests go straight from your computer to your API. No proxy, no account, no telemetry.

Fits in the context window

Big spec, small task? --only exposes just the endpoints you name, so the model isn't wading through 400 tools to find 3.

Errors the model can read

When your API returns a 4xx or 5xx, the response body goes back to the model as a tool error, not a crash, so it can adjust and retry.

Never garbles the conversation

Logs go to stderr and the protocol stays on stdout; the two never mix. A chatty spec can't break your client.

Open source, one package

MIT-licensed. One apibear package ships the CLI and a dependency-free parser that runs the same in Node, browsers and Cloudflare Workers.

Honest about its limits

No Swagger 2.0, no file uploads, and tokens live in your client config in plain text. It's all written down: Known limitations.

FAQ

Frequently asked questions

The questions we hear most. Still stuck? See Troubleshooting.

Is it free?

Yes. The apibear package (the CLI and the parser library) is MIT-licensed open source and free to use, forever. The upcoming API Bear Gateway is an optional paid service for teams.

Why is the CLI and the library one package?

So they can't drift. The apibear command runs the same parser you get from import { parseOpenApiToTools } from "apibear", at the same version. Preview your tools with npx apibear --list-tools, then build on them in code knowing the names and schemas will match. The library entry still imports none of the CLI's dependencies, so browser and edge bundles stay small.

Will it work with my API?

If you have an OpenAPI 3.0 or 3.1 document in JSON or YAML, almost certainly. Swagger 2.0 isn't supported, but swagger2openapi converts it in one command. File-upload endpoints and deepObject query parameters aren't supported yet. See Known limitations.

Where do my API keys go?

Into your MCP client's config file (e.g. claude_desktop_config.json), on your machine, in plain text. API Bear only ever sends them to the API in your spec. Treat that file like a .env: don't commit it. If plaintext config won't fly with your security team, that's what the Gateway is for.

Does anything go through your servers?

No. There are no API Bear servers in the loop. When your assistant calls a tool, the request goes directly from your machine to your API.

What if my spec has no servers block, or only relative URLs?

Add --base-url https://api.yourdomain.com and API Bear uses it as the root for every request.

Can I expose only some endpoints?

Yes, and for large APIs you should. --only listInvoices,getInvoice limits the tools to the operationIds you name, which keeps the model focused and saves context.

Why a bear?

Look at the logo's ears. They're the prongs of a plug. Now you can't unsee it.

Coming soon · API Bear Gateway

Bringing your team along?

The API Bear Gateway keeps API keys in an encrypted vault instead of on every laptop, and gives each teammate short-lived access. The CLI stays free and open source.