Skip to main content
LM Studio runs local models and can also act as an MCP host. It supports remote MCP servers through an mcp.json file, edited from the Program tab and Perfai MCP is a remote server.
LM Studio’s own model is local and free to run — but tool-calling against an 18-tool MCP server needs a model that’s actually capable of structured tool use. Small quantized models can fail to respond at all.

Get an API key

Perfai Cloud authenticates LM Studio with a Perfai API key. Create one and copy it — Perfai shows the full key only once. You’ll paste it into mcp.json as Bearer pfk_xxxxxxxxxxxx_....

Installation

  1. Open LM Studio and go to Developer → Local Server.
  2. Click the Program tab.
  3. This opens (or lets you edit) mcp.json. Add the following:
  1. Save the file. LM Studio reconnects to configured MCP servers automatically.

Verify the server is connected

  1. In the Program tab, check that perfai-cloud shows as connected with 19 tools listed.
  2. If it fails to connect, re-check that the Authorization header is Bearer followed by the full key, with no trailing whitespace. A 401 means the key has expired or been revoked — create a new one and update the config.
A successful connection here only means LM Studio can see the server’s tools — it doesn’t guarantee your local model can actually call them.

Confirm you’re signed in

The API key signs you in — there is no separate login step. Every tool call runs as the user who created the key, with that user’s organizations and role. In LM Studio’s chat, type:
It answers with the key’s id (pfk_xxxxxxxxxxxx_…), never the secret. If a tool call fails with 401, the key has expired or been revoked — create a new one and update the connector.

Register an app and run a scan


Fix and verify