---
title: "MCP tools"
description: "Connect Apiweld to Claude Code, Cursor, or any MCP client so your agent can search APIs, add endpoints, check drift, and fix breaking changes."
---

> Documentation Index
> Fetch the complete documentation index at: https://apiweld.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP tools

`apiweld mcp` runs Apiweld as a [Model Context Protocol](https://modelcontextprotocol.io) server. Your coding agent starts it as a subprocess and talks to it over stdin and stdout. It doesn't open a port.

Every tool runs the same code as a [CLI](/cli) command, so anything the agent does, you can run again from a shell.

## Connect your agent

### Claude Code

```sh
claude mcp add apiweld -- npx apiweld mcp
```
### Cursor

Add this to `.cursor/mcp.json` in your project:

```json title=".cursor/mcp.json"
{
  "mcpServers": {
"apiweld": {
  "command": "npx",
  "args": ["apiweld", "mcp"]
}
  }
}
```
### Other clients

Any client that supports stdio servers works. Use `npx` as the command and `apiweld mcp` as the arguments. If `apiweld` is installed in the project, `apiweld` with the argument `mcp` works too.

Then run `npx apiweld init --agents`. It adds a short note to `AGENTS.md` and `CLAUDE.md` telling the agent to use Apiweld for third-party APIs instead of writing HTTP calls by hand or installing a full SDK. You can edit the note freely. Apiweld won't add it again once it's there.

## Tools

| Tool | Same as | What the agent gets back |
| --- | --- | --- |
| `search_apis` | `apiweld search <query>` | Matching APIs, with a one-line description and how recently the spec changed. |
| `search_operations` | `apiweld search <query> --ops [--api id]` | Matching endpoints, across all APIs or within one. |
| `describe_operation` | `apiweld show <api> <operation>` | A short TypeScript-style signature of the endpoint (see below). |
| `add_operations` | `apiweld add <api> <operation>…` | Updates the config and generates the client. Returns the import path and an example call. |
| `remove_operations` | `apiweld remove <api> <operation>…` | Removes endpoints and regenerates the client. |
| `check_drift` | `apiweld check [api]` | Upstream changes to the selected endpoints, labelled breaking, risky, or safe. |
| `get_heal_plan` | `apiweld heal <api>` | For a breaking change: what changed, which call sites break, and hints for the fix. |
| `verify` | `apiweld verify` | The type-check result, plus your test command's result if you configured one. |

An operation can be an operation id (`PostRefunds`) or `METHOD /path` (`POST /v1/refunds`).

## Compact signatures

Full OpenAPI schemas are long and eat context. `describe_operation` returns the endpoint in the shape of the code the agent is about to write:

```ts
// stripe · POST /v1/refunds · auth: bearer (secret key)
createRefund(body: {
  charge?: string;            // ID of the charge to refund
  payment_intent?: string;
  amount?: number;            // minor units; defaults to the full amount
  reason?: "duplicate" | "fraudulent" | "requested_by_customer";
  metadata?: Record<string, string>;
}): Promise<Refund>           // errors: 400, 401, 402, 404
```

Nested types stay collapsed. The agent can pass a `depth` to expand them, the same as `apiweld show --depth n`.

## What the server can change

The server only writes to:

- the `output` directory with the generated clients
- `apiweld.config.ts`
- `apiweld.lock.json`
- `.apiweld/`, which holds reports and the runtime drift log

It never edits your application code. When a breaking change needs call sites updated, the agent makes those edits itself, as normal changes you can review.

Source: https://apiweld.dev/mcp/index.mdx
