# LM Studio

LM Studio supports remote MCP servers with OAuth. Add Cakewalk's gateway URL to `mcp.json` through the in-app editor, and LM Studio opens a browser window on first use to authenticate you against the Cakewalk gateway. No tokens or headers to manage.

## Requirements

* LM Studio version with MCP OAuth support. (Released in 2026.) Earlier versions only handle static Bearer tokens via `headers` and are not compatible with Cakewalk's gateway.

## Install Method

JSON config. Edit `mcp.json` through LM Studio's in-app editor. The OAuth flow auto-triggers on first connection because Cakewalk's gateway supports Dynamic Client Registration, so no `auth` block is needed in the config.

## Step 1: Open mcp.json

1. Open LM Studio.
2. Open the Program section of the LM Studio sidebar.
3. Open the option to edit `mcp.json` (in current LM Studio versions labeled **Install** > **Edit mcp.json**).
4. LM Studio opens `mcp.json` in the in-app editor.

## Step 2: Add the Cakewalk Gateway

Paste the following inside `mcpServers`:

```json
{
  "mcpServers": {
    "cakewalk": {
      "url": "https://mcp-gateway.getcakewalk.io/mcp"
    }
  }
}
```

Save the file. LM Studio reloads MCP servers automatically.

## Step 3: Authenticate

On first use of a Cakewalk tool, LM Studio opens your default browser to the Cakewalk OAuth consent page. Sign in with your Cakewalk account and approve the Connection. LM Studio stores the resulting token securely.

The OAuth callback returns to `http://127.0.0.1:33389/mcp-oauth-callback`, which LM Studio handles internally.

## Verifying It Works

In LM Studio's Program tab, confirm **cakewalk** appears in the MCP server list with the gateway's tools enumerated. In Cakewalk, the LM Studio card on **My Agents** flips to **Connected** after the first agent call.

## Troubleshooting

* **Edit mcp.json menu does not appear:** confirm you are on a recent LM Studio version with MCP OAuth support. Earlier versions only supported header-based authentication and will not handle the OAuth flow with Cakewalk.
* **Browser does not open on first call:** make sure no other process is holding port `33389`, which LM Studio uses for the OAuth callback.
* **OAuth flow returns to an error page:** check that your Cakewalk account is active and that the gateway URL in `mcp.json` exactly matches the one in Cakewalk's Set Up Flow.

## Learn more

* [MCP Integrations in LM Studio](https://lmstudio.ai/docs/integrations/mcp-remote) from LM Studio.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.cakewalk.security/docs/ai-agent-access/connections-and-integrations/agent-platforms/lm-studio.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
