> ## Documentation Index
> Fetch the complete documentation index at: https://docs.withmethod.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Endpoints

> Save methods, retrieve versions, and upload run records.

# Method API and MCP

Use [Method CLI](/guides/build) to create, edit, save, and run methods. The CLI handles browser sign-in, saved versions, and run uploads.

## Saved files and runs

The CLI uses these routes on the selected server. Requests require the computer's access token. Keep tokens out of method files and logs.

| Route                                         | Purpose                                                                                                                             |
| --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `POST /api/cli/methods`                       | Save a new method. Supply `workflow` and a UUID `request_id`. Reuse that ID after an uncertain response.                            |
| `GET /api/cli/methods/:id?version=:versionId` | Read a saved version. Without `version`, read the current version.                                                                  |
| `POST /api/cli/methods/:id`                   | Save a new version. Supply `workflow`, `base_version`, and `reason`. A changed base causes a conflict.                              |
| `PUT /api/cli/runs/:id`                       | Upload a run record. Supply `workflow_id`, `version_id`, increasing `sequence`, and `inspection`. Method CLI handles this protocol. |

New methods use `format: method/2`. The server validates names, data shapes, checks, and dependencies before saving. A saved version has not necessarily passed a run. Each run names the exact saved version it used.

## MCP 5.2

Connect to `https://dark-wave-v6i08.run.mcp-use.com/mcp` with Streamable HTTP and OAuth with PKCE.

| Tool                | Purpose                                            |
| ------------------- | -------------------------------------------------- |
| `list_methods`      | List saved methods.                                |
| `get_method`        | Read a method's status and available records.      |
| `rename_method`     | Change its display name.                           |
| `get_method_source` | Read the exact source text and its format version. |
| `get_agent_prompt`  | Read the saved general agent instructions.         |

A source response includes `method_id`, `version_id`, `schema_version`, `source`, and its `sha256`. Preserve the source text when checking this hash. Historical files can report `workflow/1`; new files report `method/2`. The executor also accepts `workflow/2` without changing its saved hash. Only `workflow/1` needs a rewrite before execution.

Run the `.method` file through Method to get separate actions and checks, saved results, and dashboard logs. Copying a general prompt into an agent does not start Method's executor.

The old `/api/workflows` and `/api/cli/workflows` routes and the four legacy MCP tool names remain available. JSON fields such as `workflow` and `workflow_id` are kept for existing clients.
