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

# Generate implementation prompts with the API and MCP

> How to generate and fetch Anthropic Claude implementation prompts via the REST API and MCP tools.

Use implementation prompts when you want an AI coding agent to pick up a feedback request and implement it. Project Echo turns the request into agent-ready **Markdown** using **Anthropic Claude Sonnet** (default API model id: `claude-sonnet-4-5`).

You can generate prompts in the staff app (see [How to generate an implementation prompt](/requests/generate-an-implementation-prompt)), or automate with the REST API and MCP.

## What the model uses

Claude receives:

* Request title and description
* Public comments
* Internal notes (staff-only)

The stored prompt may therefore include internal-note content. Anyone with `requests:read` can later read that prompt via API/MCP.

## Permissions

| Action | Permission |
| - | - |
| Read a stored prompt | `requests:read` |
| Generate or regenerate | `requests:update` |

Create or update a key under **API & MCP**. Existing keys do **not** gain new abilities automatically—edit the key or create a new one (Contributor preset includes `requests:update`).

## REST API

Base URL: `https://api.projectecho.io/v1`

Authenticate with both headers on every call:

* `Authorization: Bearer pe_api_…`
* `X-PE-API-Key-Id: <key-uuid>`

### Get the stored prompt

```bash theme={null}
curl -s "https://api.projectecho.io/v1/requests/REQUEST_ID/implementation-prompt" \
  -H "Authorization: Bearer pe_api_YOUR_TOKEN" \
  -H "X-PE-API-Key-Id: YOUR_KEY_ID"
```

Returns `{ "prompt", "generated_at", "generated_by" }`, or `404` if none exists yet.

### Generate or regenerate

```bash theme={null}
curl -s -X POST "https://api.projectecho.io/v1/requests/REQUEST_ID/implementation-prompt" \
  -H "Authorization: Bearer pe_api_YOUR_TOKEN" \
  -H "X-PE-API-Key-Id: YOUR_KEY_ID" \
  -H "Content-Type: application/json"
```

Overwrites any previous prompt and returns the full Markdown. Soft rate limit: about **30 generations per workspace per hour**.

### Discover readiness on `get_request`

`GET /v1/requests/:id` includes:

* `implementation_prompt`
* `implementation_prompt_generated_at`
* `implementation_prompt_generated_by`

List responses include `implementation_prompt_generated_at` (without the full prompt body).

## MCP tools

With [MCP connected](/api-mcp-and-embed/connect-mcp) (`@project-echo/mcp` **0.2.1+**):

| Tool | Maps to |
| - | - |
| `get_implementation_prompt` | `GET /v1/requests/:id/implementation-prompt` |
| `generate_implementation_prompt` | `POST /v1/requests/:id/implementation-prompt` |

Both take `request_id`.

Example (Cursor / Claude agent):

```text theme={null}
Generate an implementation prompt for request ae9ca609-a24c-4703-b501-673e227cc705
using generate_implementation_prompt, then show me the Markdown.
```

If those tools are missing after an upgrade, reinstall `@project-echo/mcp@latest` and restart the MCP server in your client.

## Model (Anthropic)

| Detail | Value |
| - | - |
| Provider | **Anthropic** |
| Model class | **Claude Sonnet** |
| Default API model id | `claude-sonnet-4-5` |

Echo calls Anthropic’s Messages API on the server. API keys for Anthropic are **not** configured in your MCP client—only your Project Echo API key is.

## Privacy and safety notes

* Generated prompts can embed **internal notes**. Treat stored prompts like staff-sensitive content.
* Prefer least-privilege keys; only grant `requests:update` to agents that should regenerate prompts.
* Generation is rate-limited to reduce accidental loops.

## Related

* [How to generate an implementation prompt](/requests/generate-an-implementation-prompt) (staff app)
* [Use the Project Echo REST API](/api-mcp-and-embed/use-rest-api)
* [Connect AI tools with MCP](/api-mcp-and-embed/connect-mcp)
* [Create and manage API keys](/api-mcp-and-embed/create-manage-api-keys)
