# Local HTTP interface (for scripts and tools without MCP)

Use the WavRead MCP helper when your client supports MCP: it is the main way to
operate WavRead, and it calls this interface for you. Read this page only when
you are writing a script or using a tool that cannot speak MCP.

This is not a hosted service. There is no cloud endpoint, no key to buy and no
SDK. The running WavRead app answers HTTP requests from the same computer only,
normally at `http://127.0.0.1:8765` (use the running app's port). It refuses
requests that name another host, and it refuses changes that come from another
website's page.

## Start here

`GET /api/v1/capabilities` reports the app version, every route and its methods,
and the settings schema. An older app without it has no local HTTP interface.

## Settings

- `GET /api/v1/settings` returns values, effective defaults and the validation schema.
- `PATCH /api/v1/settings` takes a JSON object of only the fields to change.
  Unspecified fields are kept. Examples: `{"analysis_lyrics":false}`,
  `{"daw":"Logic Pro","imagery":"A railway station after midnight"}`.
  Booleans must be JSON booleans; enums must match the advertised choices.

## Tracks

- `GET /api/v1/tracks` lists saved readings.
- `GET /api/v1/tracks/<name>` returns the reading as JSON. (`/json/<name>` is an
  HTML page, not data.) Quote and encode route segments.
- `GET /track/<name>/stem/<stem>/data` returns one instrument's data.

## Other actions

`GET /api/v1/forms?path=<encoded page>` returns the current form controls and
HTML of any app page, including settings pages. For any action without a JSON
route, inspect the form, then submit the exposed route with its actual method and
fields. The routes and fields are described in
[operating-wavread.md](operating-wavread.md) under "Advanced: any app route".

HTTP redirects alone do not establish success. Read the resulting page or data,
and check `GET /jobs/status` for queued analysis.
