# Connect LM Studio (local models)

> Run an open model on your own computer with LM Studio and give it your WordPress site's tools through MCP, with the Add to LM Studio button or mcp.json.

LM Studio runs open models such as Qwen or Llama on your own computer. Because the model runs on your computer, the AI's work on your site does not go through a cloud AI service.

## Before you start

- LM Studio 0.3.17 or newer, and a model that supports tool use.
- A connection for LM Studio. Open **PowerWP AI › Connections**, choose **Create connection**, pick **LM Studio**, name it and choose what it may do. Choose **Create key and show steps**: the window shows the steps below with your address and key already in them. The key is shown once. Here it appears as `<your key>`.

## Option 1: one click

:::steps
1. In the setup window, click **Add to LM Studio**.
2. LM Studio opens and asks you to install your site's server. Confirm it.
3. Load a model with tool support and start a chat. LM Studio may ask you to allow each tool call.
:::

## Option 2: add it by hand

:::steps
1. In LM Studio, open the **Program** tab in the right sidebar, then **Install › Edit mcp.json**.
2. Paste the JSON below and save. If the file already lists other servers, paste only the `your-store` entry inside `mcpServers`, after the last entry, with a comma between the two.
3. Load a model with tool support and start a chat.
:::

```json
{
  "mcpServers": {
    "your-store": {
      "url": "https://your-store.com/wp-json/wpai/v1/mcp",
      "headers": { "X-WPAI-Token": "<your key>" }
    }
  }
}
```

## Check it works

Name the tool so the model knows what to do:

```
Use the site_overview tool and summarize my site.
```

The model answers with your WordPress version, theme and plugins.

> [!TIP] Small local models can handle many tools less reliably. Use the largest model your computer runs well and keep requests simple. Start with the Read-only diagnostics preset.

## Troubleshooting

- **The model answers without using your site.** Pick a model that supports tool use, and ask for one tool by name.
- **Your site is not listed.** Check your LM Studio version (0.3.17 or newer) and that `mcp.json` is valid JSON.
- **401 "Authentication required".** The key was copied incompletely. Keys cannot be shown twice: revoke the connection and create a new one.
- **403 or 429.** 403 means your IP address is not on the connection's allow-list, or a firewall blocks `/wp-json/wpai/v1/`. 429 means too many requests: wait a few minutes.

## Related

:::cards
- [Choose how to connect](/docs/connect/) — All supported apps.
- [Other MCP apps](/docs/connect/other-apps/) — Any app with remote MCP support.
- [Permissions and presets](/docs/concepts/permissions/) — Decide what the model may do.
:::

Source: https://powerwp.ai/docs/connect/lm-studio/
