# list_local_models

URL: https://codepanel.ai/docs/mcp-server/list_local_models

The CodePanel MCP tool that lists the free models on the owner's machine (Ollama, LM Studio, llama.cpp, MLX) a coding agent can run on.

`list_local_models` lists the models served on the owner's own machine, as the local runner last found them on 127.0.0.1: Ollama, LM Studio, llama.cpp's server or MLX's. It needs the `read` scope.

## When to call it

- **Before creating a coding agent that costs nothing to run**: pick a `modelId` here and pass it to [`create_coding_agent`](/docs/mcp-server/create_coding_agent) with provider `local`.
- **When a local agent's runs fail to reach their model**, to see whether the runner still finds it.

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |


It only reads: the server marks it `readOnlyHint: true`, so clients that ask before a write can run it without asking.

## What it returns

`{ provider: "local", models, reportedAt }`. Each model has its `modelId` (`<server>/<model>`, such as `ollama/qwen3-coder:30b`), `server` (`ollama`, `lmstudio`, `llamacpp` or `mlx`), `serverName` and `reportedAt`. The list is empty until the runner reports. It reports when it starts; `codepanel local-models --probe` reports on demand from the same machine.

A local model costs $0 and never goes through the cloud model proxy: the runner calls it on 127.0.0.1, and the run records its tokens at $0 under the local model's id. Only CodePanel's own loop runs it, so an agent on an external CLI harness cannot use one.

## The same step without MCP

| Surface | Form |
| --- | --- |
| HTTP API | `GET /autopilot/models/local` with the `read` scope |
| CLI | `codepanel local-models`, or `codepanel local-models --probe` to look again first |

## What the server tells your agent

The description your agent reads when it lists the tools:

> Use it to find a free model on the owner's machine for a coding agent. Lists what the local runner found on 127.0.0.1 when it last probed (Ollama, LM Studio, llama.cpp or MLX): each modelId (<server>/<model>), its server and when it was reported. Pick one with create_coding_agent or update_coding_agent as provider local and that modelId. Local models cost $0, never go through the cloud proxy, and run only on CodePanel's own loop on that machine. Empty until the runner (or codepanel local-models --probe) reports.

## Related

- [`create_coding_agent`](/docs/mcp-server/create_coding_agent): give an agent a local model.
- [MCP server](/docs/mcp-server): install, sign-in and every other tool.
