# MCP servers

> Connect Claude, Cursor, VS Code and other AI tools to AppHelm over MCP, with the public docs server and the product server that reads and changes your workspace through an API key.

Source: https://apphelm.dev/docs/mcp

AppHelm runs two [Model Context Protocol](https://modelcontextprotocol.io) servers. Both use the Streamable HTTP transport, so any client that can connect to a remote MCP server by URL can use them.

| Server | URL | Key | What it does |
| --- | --- | --- | --- |
| Docs | `https://apphelm.dev/mcp/docs` | None | Searches and returns these docs and the install steps for a platform. Read-only and public. |
| Product | `https://apphelm.dev/mcp` | A server API key (`ahl_live_…`) as a Bearer token | Reads your products, analytics, flags, errors, logs and more, and makes the changes your key's scopes allow. |

Use the docs server when an assistant should set AppHelm up or answer questions about it. Use the product server when it should work with your own data.

## The docs server

The docs server needs no account and no key, and never accepts or returns one. It serves the same pages as this site, every language included. Every tool is read-only.

### Tools

| Tool | Input | Returns |
| --- | --- | --- |
| `list_doc_pages` | none | Every page: slug, title, section, description, its URL and its markdown URL (the OpenAPI document for the API reference) |
| `search_docs` | `{ query, limit? }`: `query` is 2 to 200 characters, `limit` 1 to 25 | The best matching sections, with a snippet and their URLs |
| `get_doc_page` | `{ slug, language? }` | One page as markdown. Without `language` it has the code for every platform, each labelled; with one (for example `python`, `nextjs`, `ios`) only that platform's code |
| `get_install_plan` | `{ platform, productId?, workspaceId? }` | The install steps for one platform: package source, install command, environment variables, files with code and how to check it works. The same plan `npx @sansavision/apphelm init` and the Setup wizard produce. Pass your ids to have them filled in; keys are always placeholders you replace |

The `platform` ids are the install platforms: `nextjs`, `react`, `vue`, `svelte`, `html`, `node`, `react-native`, `ios`, `android`, `python`, `jvm`, `go`, `ruby`, `php`, `flutter`, `dotnet`, `elixir` and `rust`. `language` takes those ids and `curl`.

### Resource and prompt

| Kind | Name | What it is |
| --- | --- | --- |
| Resource | `apphelm-docs://llms.txt` | The docs map: every page with its markdown link, the same text as `https://apphelm.dev/llms.txt` |
| Prompt | `install_apphelm` | Takes an optional `platform`. Asks the assistant to work out the platform from the project files (when not given), call `get_install_plan`, ask you for the product id and keys instead of inventing them, add the files and install command, and tell you how to check the first event arrived |

### Connect the docs server

Claude Desktop: claude_desktop_config.json:
```json
{
  "mcpServers": {
    "apphelm-docs": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://apphelm.dev/mcp/docs"]
    }
  }
}
```

In Claude Desktop you can also add it under **Settings → Connectors → Add custom connector** with the URL `https://apphelm.dev/mcp/docs`; no key is needed. The JSON above uses `mcp-remote`, a small bridge that runs the remote server through `npx` (Node.js must be installed).

The same server in the other clients:

Claude Code:
```bash
claude mcp add --transport http apphelm-docs https://apphelm.dev/mcp/docs
```

Cursor: ~/.cursor/mcp.json (or .cursor/mcp.json in a project):
```json
{ "mcpServers": { "apphelm-docs": { "url": "https://apphelm.dev/mcp/docs" } } }
```

VS Code: .vscode/mcp.json:
```json
{ "servers": { "apphelm-docs": { "type": "http", "url": "https://apphelm.dev/mcp/docs" } } }
```

Windsurf: ~/.codeium/windsurf/mcp_config.json:
```json
{ "mcpServers": { "apphelm-docs": { "serverUrl": "https://apphelm.dev/mcp/docs" } } }
```

Clients without MCP can read the same content as plain markdown: every page is at `https://apphelm.dev/docs/<slug>.md`, `https://apphelm.dev/llms.txt` lists them all, and `https://apphelm.dev/llms-full.txt` is every page in one file. [Set up with AI](https://apphelm.dev/docs/ai-setup) shows prompts that use them.

## The product server

The product server works on your workspace through a server API key. Every tool call is checked against the key's scopes and products, written to the workspace audit log (`mcp.tool_called`, with the tool and the outcome), and answered in one envelope:

```json
{ "ok": true, "data": { … }, "meta": { "service": "apphelm", "version": "1.6.0", "correlationId": "…" } }
{ "ok": false, "error": { "code": "insufficient_scope", "message": "flags:write is required for this tool.", "retryable": false }, "meta": { … } }
```

`retryable: true` means the same call may succeed later. Quote `correlationId` when you contact support.

### Create a key for the assistant
In AppHelm open **Settings → API keys** and create a server key. Give it only the scopes the assistant needs (see [Scopes](#scopes)) and, if it should see only some products, limit it to those. The key is shown once. [Keys, scopes and environments](https://apphelm.dev/docs/keys-and-environments) explains keys in full.

### Put the key in an environment variable
Keep it out of files you commit:

```bash
export APPHELM_API_KEY=ahl_live_…
```

### Add the server to your client
Use the configuration for your client below. The server answers `401` before any MCP message when the key is missing, revoked or mistyped.

### Check it works
Ask the assistant to "list my AppHelm products". It should name each product the key can see.

### Connect the product server

Claude Desktop: claude_desktop_config.json:
```json
{
  "mcpServers": {
    "apphelm": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://apphelm.dev/mcp", "--header", "Authorization:${APPHELM_AUTH}"],
      "env": { "APPHELM_AUTH": "Bearer ahl_live_…" }
    }
  }
}
```

Claude Desktop's custom connectors cannot send a Bearer header, so the configuration above runs the server through `mcp-remote`, which adds the header. Write `Authorization:${APPHELM_AUTH}` without a space after the colon: some clients split arguments on spaces. Restart Claude Desktop after editing the file.

Claude Code (reads the key from your shell when you run the command):
```bash
claude mcp add --transport http apphelm https://apphelm.dev/mcp \
  --header "Authorization: Bearer $APPHELM_API_KEY"

claude mcp list   # apphelm should show as connected
```

Add `--scope project` to share the server with your team through `.mcp.json`; each person then needs the header with their own key, so prefer the default (local) scope for keys.

Cursor: ~/.cursor/mcp.json:
```json
{
  "mcpServers": {
    "apphelm": {
      "url": "https://apphelm.dev/mcp",
      "headers": { "Authorization": "Bearer ${env:APPHELM_API_KEY}" }
    }
  }
}
```

VS Code: .vscode/mcp.json (asks for the key once and stores it securely):
```json
{
  "inputs": [{ "type": "promptString", "id": "apphelm-key", "description": "AppHelm server API key", "password": true }],
  "servers": {
    "apphelm": {
      "type": "http",
      "url": "https://apphelm.dev/mcp",
      "headers": { "Authorization": "Bearer ${input:apphelm-key}" }
    }
  }
}
```

Windsurf: ~/.codeium/windsurf/mcp_config.json:
```json
{
  "mcpServers": {
    "apphelm": {
      "serverUrl": "https://apphelm.dev/mcp",
      "headers": { "Authorization": "Bearer ahl_live_…" }
    }
  }
}
```

The Windsurf file holds the key itself, so keep it out of any repository. Any other client works the same way: the URL `https://apphelm.dev/mcp` and the header `Authorization: Bearer <key>`. To look at the server by hand, run `npx @modelcontextprotocol/inspector`, choose Streamable HTTP and add the header.

> **A browser key is not enough:** The product server accepts server keys (`ahl_live_…`) only. A browser key (`ahl_pub_…`) is answered `401`. Never paste a server key into a chat or a file that is shared; give the assistant a key with the fewest scopes that do the job, and revoke it in Settings → API keys when you no longer need it.

## Scopes

A tool runs only when the key holds its scope. Without it the tool answers `insufficient_scope` and names the scope. A key created without a scope list gets every scope except the **explicit-only** ones, which an owner or admin must tick by name, because they change what live users see or reach outside AppHelm.

| Scope | Default | Enables |
| --- | --- | --- |
| `products:read` | yes | Products and their health, flags (without the assignment salt), flag change drafts |
| `metrics:read` | yes | Approved metrics, LLM cost and usage |
| `insights:read` | yes | Evidence-backed insights and their evidence |
| `sessions:read` | yes | Session replay metadata and LLM traces |
| `logs:read` | yes | Log search, histograms, single lines, log alerts |
| `incidents:read` | yes | Reliability incidents |
| `usage:read` | yes | Usage, plan entitlements and showback |
| `issues:read` | yes | Error issues and events, traces and spans, releases |
| `issues:write` | yes | Resolve, ignore, reopen, assign and prioritise issues |
| `monitors:read` | yes | Cron monitors, uptime checks and their history |
| `experiments:read` | yes | Experiments and their results |
| `surveys:read` | yes | Surveys and their results |
| `analytics:read` | yes | Saved insights, dashboards, annotations, insight alerts and subscriptions, SQL |
| `segments:read` | yes | Cohorts and segment comparisons |
| `pipelines:read` | yes | Data pipelines and their deliveries |
| `imports:read` | yes | PostHog migrations, data sources and warehouse tables |
| `customers:read` | yes | Customer profiles (masked), customer threads, the identity merge queue |
| `customers:write` | yes | Merge, reject or split people (with a key for every product made by an owner or admin) |
| `accounts:read`, `findings:read`, `interventions:read`, `roadmap:read` | yes | Account summaries, qualified findings, intervention results, roadmap evidence |
| `feedback:write`, `interventions:write`, `actions:draft` | yes | Drafts for a person to review: why-moment surveys, interventions, actions |
| `ai:investigate` | yes | Beam investigations; each uses the workspace's AI credits |
| `products:write` | explicit | Create products and browser keys; rename, archive and restore products |
| `flags:write` | explicit | Create, change, schedule and archive flags, including turning them on for live traffic |
| `experiments:write` | explicit | Create, change, launch, stop and ship experiments |
| `surveys:write` | explicit | Create, change, launch and stop surveys |
| `analytics:write` | explicit | Create and change saved insights, dashboards, annotations, insight alerts and subscriptions |
| `cohorts:write` | explicit | Create and change static cohorts |
| `pipelines:write` | explicit | Create, change, test and delete data pipelines |
| `imports:write` | explicit | Start and control PostHog migrations; connect and change data sources |
| `members:read`, `members:write`, `audit:read` | explicit | The team and the audit log (each needs a key for every product) |

Changes made through an explicit-only scope are made in the name of the person who created the key, and several of them also require that person to be an owner or admin. If their role or product access changes, the tool is refused even though the key still holds the scope. Scopes that start with `registry:`, and `ecosystem:execute` and `integrations:read`, are for Sansa Vision's internal services; a customer key that holds them gets `internal_only` from those tools.

A key limited to some products sees only those products in every tool. A tool given a product outside the key's list answers `product_scope_denied`. The workspace's demo product is never served or changed over MCP, whatever the key: its ids answer `not_found`.

## Tools

Every tool name starts with `apphelm_`. **Read** tools change nothing. **Write** tools change something, as described; **Draft** tools store or return a proposal and change nothing until a person accepts it in AppHelm. Every write tool takes an `idempotencyKey` (8 to 160 characters) unless noted, so a retry with the same key returns the first answer instead of acting twice.

### Products and setup

| Tool | Does | Kind | Scope |
| --- | --- | --- | --- |
| `apphelm_list_products` | Lists the products the key can see, with their current health | Read | `products:read` |
| `apphelm_get_product_health` | One product: its outcome and current health metrics | Read | `products:read` |
| `apphelm_query_metric` | One approved metric (`activation`, `retention`, `reliability`, `monthlyValue`, `eventsIngested`, `aiCreditsUsed`) with its definition, timezone, sampling and late-data state | Read | `metrics:read` |
| `apphelm_get_usage_costs` | This month's usage, plan entitlements and showback | Read | `usage:read` |
| `apphelm_create_product` | Creates a product and its first browser key (`ahl_pub_…`, returned once) for 1 to 5 exact https origins, optionally with a draft outcome from a template. Needs a key for all products; counts against the plan's product limit; never creates server keys | Write | `products:write` |
| `apphelm_create_browser_key` | Mints another browser key for one product, for 1 to 5 exact https origins (returned once) | Write | `products:write` |
| `apphelm_update_product` | Renames a product, or archives or restores it (`confirmed: true`) | Write | `products:write` |

### Insights and Beam

| Tool | Does | Kind | Scope |
| --- | --- | --- | --- |
| `apphelm_list_insights` | Ranked evidence-backed insights, optionally for one product | Read | `insights:read` |
| `apphelm_get_insight_evidence` | One insight with its evidence, counter-signals, impact and recommendation | Read | `insights:read` |
| `apphelm_ask_beam` | Runs one Beam investigation of a product (`productId`, `question`). Metered: uses the workspace's AI credits. A retry with the same `idempotencyKey` returns the first answer and is not charged again | Write (metered) | `ai:investigate` |
| `apphelm_draft_action` | Drafts an action from an insight for a person to review. Nothing runs | Draft | `actions:draft` |

### Feature flags

| Tool | Does | Kind | Scope |
| --- | --- | --- | --- |
| `apphelm_list_flags` | Flags of the key's products, optionally one product, without the assignment salt | Read | `products:read` |
| `apphelm_draft_flag_change` | Checks a rollout change to an existing flag and returns it as a proposal. Nothing is applied: a person makes the change in AppHelm | Draft | `products:read` |
| `apphelm_create_flag` | Creates a boolean, multivariate or remote-config flag with its variants, payloads, conditions and per-environment state. `status: "draft"` (the default) evaluates off; `active` serves at once | Write | `flags:write` |
| `apphelm_update_flag` | Changes a flag: name, rollout, variants, conditions, environments or status (`active`, `disabled`, `killed`). Moving people between variants of a live flag needs `confirmReassignment: true` and is refused while an experiment runs on it | Write | `flags:write` |
| `apphelm_archive_flag` | Archives a disabled flag; refused while it is active or used by an experiment, an intervention or another flag | Write | `flags:write` |
| `apphelm_schedule_flag_change` | Schedules an activation, a disable, a rollout or new variants between one minute and one year ahead; it runs within five minutes of `runAt` | Write | `flags:write` |
| `apphelm_cancel_flag_schedule` | Cancels a pending scheduled change (`fsc_…`) | Write | `flags:write` |

### Experiments

| Tool | Does | Kind | Scope |
| --- | --- | --- | --- |
| `apphelm_list_experiments` | Experiments of the key's products: status, flag, metrics, stats engine, kind and decision | Read | `experiments:read` |
| `apphelm_get_experiment_results` | One experiment's full analysis: exposures, holdout, sample ratio check, Bayesian and frequentist results per metric, the sample-size plan and a verdict | Read | `experiments:read` |
| `apphelm_create_experiment` | Creates a draft experiment on an existing flag. A draft changes nothing until launched | Write | `experiments:write` |
| `apphelm_update_experiment` | Changes an experiment's metrics, engine, exposure event, window, end date or web variants; results are recomputed | Write | `experiments:write` |
| `apphelm_launch_experiment` | Starts the experiment and activates its flag: people are served variants from now | Write | `experiments:write` |
| `apphelm_stop_experiment` | Stops the experiment and disables its flag; results so far are kept | Write | `experiments:write` |
| `apphelm_ship_experiment_variant` | Ends the experiment and rolls its flag out to 100% on one variant, with a decision `note`. Cannot be undone through MCP | Write | `experiments:write` |

### Surveys

| Tool | Does | Kind | Scope |
| --- | --- | --- | --- |
| `apphelm_list_surveys` | Survey programs of the key's products, every version, with questions, targeting, display rules and status | Read | `surveys:read` |
| `apphelm_get_survey_results` | One survey's responses, NPS, CSAT or average score, per-question breakdown, weekly trend and open-text answers, with filters | Read | `surveys:read` |
| `apphelm_create_survey` | Creates a draft survey. It shows nothing until launched | Write | `surveys:write` |
| `apphelm_update_survey` | Drafts the next version with the given fields changed; the running version keeps running | Write | `surveys:write` |
| `apphelm_launch_survey` | Activates a survey version, so it is shown to the people it targets. Refused unless the privacy checks the console applies pass | Write | `surveys:write` |
| `apphelm_stop_survey` | Pauses a survey; responses are kept | Write | `surveys:write` |

### Analytics, dashboards and SQL

| Tool | Does | Kind | Scope |
| --- | --- | --- | --- |
| `apphelm_list_saved_insights` | Saved insights, filtered by product, kind, tag or a search | Read | `analytics:read` |
| `apphelm_get_saved_insight` | One saved insight with its query; `run: true` adds its result now | Read | `analytics:read` |
| `apphelm_list_dashboards` | Dashboards of the key's products, and the dashboard templates | Read | `analytics:read` |
| `apphelm_get_dashboard` | One dashboard's tiles and filters; `run: true` adds each tile's result | Read | `analytics:read` |
| `apphelm_list_annotations` | Chart annotations of a product over the last days (default 30, at most 90) | Read | `analytics:read` |
| `apphelm_list_insight_alerts` | Insight alerts with condition, channels, state and last value | Read | `analytics:read` |
| `apphelm_list_insight_subscriptions` | Scheduled email subscriptions of insights and dashboards | Read | `analytics:read` |
| `apphelm_list_cohorts` | Cohorts, dynamic and static, with member counts | Read | `segments:read` |
| `apphelm_run_sql` | Runs one read-only `SELECT` in AppHelm SQL over one product's events, persons, sessions, groups, cohort members, LLM generations and synced tables. 100 rows by default, `LIMIT` up to 10,000; shares the workspace's 60 runs a minute | Read | `analytics:read` |
| `apphelm_change_saved_insight` | Creates, changes, duplicates or deletes a saved insight (`change.action`: `insight.create`, `insight.update`, …) | Write | `analytics:write` |
| `apphelm_change_dashboard` | Creates a dashboard (also from a template), changes its filters, adds, sizes, reorders or removes tiles, duplicates or deletes it | Write | `analytics:write` |
| `apphelm_change_annotation` | Adds, changes or deletes a chart annotation | Write | `analytics:write` |
| `apphelm_change_insight_alert` | Creates, changes, disables or deletes a threshold alert on a trend, notifying by email, Slack and webhook | Write | `analytics:write` |
| `apphelm_change_insight_subscription` | Creates, changes, pauses or deletes a daily, weekly or monthly email of an insight or dashboard | Write | `analytics:write` |
| `apphelm_change_cohort` | Creates a static cohort from distinct ids or emails (hashed, never stored), from an insight result or by freezing a segment; changes its people or archives it. Flags can target cohorts | Write | `cohorts:write` |

### Sessions and LLM analytics

| Tool | Does | Kind | Scope |
| --- | --- | --- | --- |
| `apphelm_search_sessions` | Searches recorded sessions by friction, person, duration, event, URL, errors and device. Metadata only: captured text is never returned | Read | `sessions:read` |
| `apphelm_get_llm_costs` | Cost, calls, tokens, latency p50 and p95 and error rate of a product's LLM calls over 1 to 90 days, by day, model and provider | Read | `metrics:read` |
| `apphelm_list_llm_traces` | A product's LLM traces, filtered by model, person, errors or minimum cost, sorted by time, cost or latency. Never prompts | Read | `sessions:read` |
| `apphelm_get_llm_trace` | One LLM trace with its spans, generations, feedback and metrics. Prompts and completions only with `includeContent: true`, and only if your app captured them | Read | `sessions:read` |

### Logs

| Tool | Does | Kind | Scope |
| --- | --- | --- | --- |
| `apphelm_search_logs` | Searches a product's log lines, newest first (`level:error service:api timeout key=value trace:… person:…`); bounded reads with `scan.complete` and `nextCursor` | Read | `logs:read` |
| `apphelm_get_log_histogram` | Lines per time bucket and level for a search over a range | Read | `logs:read` |
| `apphelm_get_log` | One log line with its attributes and links: its trace, the issues in that trace, the customer and the replay | Read | `logs:read` |
| `apphelm_list_log_alerts` | A product's log alerts and saved log searches (change them through the REST API) | Read | `logs:read` |

### Errors, traces, releases and monitors

These need a workspace API key.

| Tool | Does | Kind | Scope |
| --- | --- | --- | --- |
| `apphelm_search_issues` | A product's error issues matching a search (`is:unresolved level:error release:2.4.0 assigned:none times_seen:>10 …`), with counts, priority, assignee and releases | Read | `issues:read` |
| `apphelm_get_issue` | One issue: its latest stack (symbolicated when maps or symbols were uploaded), breadcrumbs, tags, users affected and 30-day trend | Read | `issues:read` |
| `apphelm_list_issue_events` | An issue's events, newest first, by environment or release | Read | `issues:read` |
| `apphelm_search_issue_events` | Searches a product's error events across issues over 1 to 90 days; 60 searches a minute per key | Read | `issues:read` |
| `apphelm_update_issue` | Resolves (optionally in the next release), ignores, reopens or assigns an issue, or sets its priority | Write | `issues:write` |
| `apphelm_get_trace` | One trace by its 32-hex id, with every stored transaction and its spans | Read | `issues:read` |
| `apphelm_search_spans` | Searches a product's spans (`span.op:db span.duration:>500ms http.status_code:>=500 …`) over 1 hour to 30 days; 60 searches a minute per key | Read | `issues:read` |
| `apphelm_list_releases` | Releases active in the last 1 to 90 days, with adoption, crash-free sessions and users, new and regressed issues, deploys | Read | `issues:read` |
| `apphelm_get_release` | One release: sessions and crashes per day, a breakdown per environment, deploys, new and regressed issues | Read | `issues:read` |
| `apphelm_list_incidents` | Current or past reliability incidents, from status components, cron monitors and error spikes | Read | `incidents:read` |
| `apphelm_list_monitors` | A product's cron monitors and uptime check, with their status | Read | `monitors:read` |
| `apphelm_get_monitor_history` | A cron monitor's check-ins (`mon_…`, kept 30 days) or an uptime check's results (`stm_…`, kept 90 days) | Read | `monitors:read` |

### Customers and customer intelligence

| Tool | Does | Kind | Scope |
| --- | --- | --- | --- |
| `apphelm_search_customers` | Searches customer profiles, with personal data masked | Read | `customers:read` |
| `apphelm_get_customer_thread` | One customer's timeline (`cus_…`) with its source evidence | Read | `customers:read` |
| `apphelm_get_account_summary` | One account's members, states, outcomes and evidence coverage | Read | `accounts:read` |
| `apphelm_compare_segments` | Two segments side by side: outcomes, retention, feedback, revenue, reliability and quality | Read | `segments:read` |
| `apphelm_get_qualified_findings` | Statistically qualified findings with their uncertainty and caveats | Read | `findings:read` |
| `apphelm_get_finding_evidence` | One finding's definitions, uncertainty, validation, cohort counts and source trace | Read | `findings:read` |
| `apphelm_draft_why_moment` | Stores a draft survey question for a person to review. It never activates or sends a survey | Draft | `feedback:write` |
| `apphelm_draft_intervention` | Stores a validated intervention draft for a person to review. It cannot approve, launch or deliver | Draft | `interventions:write` |
| `apphelm_get_intervention_results` | An intervention's exposure, holdout, uncertainty and claim class | Read | `interventions:read` |
| `apphelm_get_roadmap_evidence_pack` | A roadmap item's source trace, claims, counter-evidence and coverage | Read | `roadmap:read` |
| `apphelm_list_identity_queue` | Pending person merge candidates and active identity links, masked | Read | `customers:read` |
| `apphelm_decide_identity` | Merges a candidate into one person, rejects it, or splits a link (reversible with split). Takes an `operationId` (a UUID) instead of an `idempotencyKey` | Write | `customers:write` |

The customer-intelligence answers carry `meta.provenance`: the workspace and products they cover, the scope they used, the evidence ids, the claim class, how fresh the data is, the statistical confidence (or `null`; none is invented), what was redacted, and links to the pages in AppHelm.

### Data pipelines

| Tool | Does | Kind | Scope |
| --- | --- | --- | --- |
| `apphelm_list_pipelines` | Realtime destinations and batch exports, with settings, filters, mapping and recent deliveries. Never credentials | Read | `pipelines:read` |
| `apphelm_list_pipeline_runs` | A destination's deliveries and dead letters (`pld_…`), or an export's runs and backfills (`plx_…`) | Read | `pipelines:read` |
| `apphelm_change_pipeline` | Creates, changes, pauses, resumes or deletes a destination or a batch export; retries dead letters; queues or cancels a backfill. Credentials are sealed and never returned | Write | `pipelines:write` |
| `apphelm_test_pipeline` | Runs a sample event through a destination and returns the request it would send; `send: true` delivers it once. For an export, checks the credentials and target. No `idempotencyKey` | Write | `pipelines:write` |

### Imports and data sources

| Tool | Does | Kind | Scope |
| --- | --- | --- | --- |
| `apphelm_list_posthog_migrations` | The workspace's PostHog migrations with status, phase and progress | Read | `imports:read` |
| `apphelm_get_posthog_migration` | One migration: its dry-run report, progress, each definition's outcome and its event batches | Read | `imports:read` |
| `apphelm_start_posthog_migration` | Starts a migration from the PostHog API into one product. It builds the report first and writes nothing until it is started with the next tool | Write | `imports:write` |
| `apphelm_change_posthog_migration` | `start`, `pause`, `resume`, `cancel`, `discard`, `undo` (within 30 days) or `replace_key` | Write | `imports:write` |
| `apphelm_list_data_sources` | Connected data sources with status, schedule and tables; only a credential's last four characters | Read | `imports:read` |
| `apphelm_list_warehouse_tables` | Synced tables with their SQL names, columns and types | Read | `imports:read` |
| `apphelm_connect_data_source` | Connects Stripe, HubSpot, Shopify, a database, a warehouse, files or a Google Sheet. The credential is checked, sealed and never returned | Write | `imports:write` |
| `apphelm_change_data_source` | Changes, pauses, resumes or syncs a source, or removes it with its rows (`remove: true`). No `idempotencyKey` | Write | `imports:write` |

### Team and audit log

| Tool | Does | Kind | Scope |
| --- | --- | --- | --- |
| `apphelm_list_members` | Members, pending invitations and seats | Read | `members:read` |
| `apphelm_change_member` | Invites someone by email (sends the invitation), changes a role, removes a member or revokes an invitation. Only an owner touches owners; the last owner is never removed | Write | `members:write` |
| `apphelm_list_audit_log` | One page of the audit log, newest first, with secrets and emails masked | Read | `audit:read` |

Deleting a person is deliberately not an MCP tool: it is permanent, and stays on the REST API (`POST /api/v1/privacy/delete`) with a written confirmation.

### Internal services

These tools are for Sansa Vision's own services, which connect with workload identities. A customer key gets `internal_only`, `workload_required` or `internal_product_required` from them.

| Tool | Does | Kind | Scope |
| --- | --- | --- | --- |
| `apphelm_discover_services` | Reads the internal service registry | Read | `registry:read` |
| `apphelm_get_service_registration` | Reads back a service's registration and its status | Read | `registry:read` |
| `apphelm_upsert_service_registration` | Submits a service manifest for independent approval | Write | `registry:write` |
| `apphelm_record_registration_evidence` | Records a verifier's evidence receipt | Write | `registry:evidence:write` |
| `apphelm_verify_service_registration` | Applies a verifier's approval decision | Write | `registry:verify` |
| `apphelm_report_service_health` | Reports a registered service's health | Write | `registry:health:write` |
| `apphelm_rotate_workload_credential` | Replaces the calling workload's own credential | Write | `registry:credentials:rotate` |
| `apphelm_resolve_capability` | Picks a healthy provider route for a capability | Read | `registry:resolve` |
| `apphelm_get_integration_status` | Reads internal integration decisions and their last check | Read | `integrations:read` |
| `apphelm_research_customer_evidence` | Searches and verifies source-backed customer evidence in YouSaid | Write (metered) | `ecosystem:execute` |
| `apphelm_review_documentation` | Lists Kiteframe documentation for diagnosis | Write (metered) | `ecosystem:execute` |
| `apphelm_create_kiteframe_documentation_draft` | Saves a confirmed private documentation draft in Kiteframe | Draft | `ecosystem:execute` |
| `apphelm_validate_promotion_readiness` | Checks AppHelm's Yieldline readiness profile; never spends or publishes | Write (metered) | `ecosystem:execute` |
| `apphelm_create_showmesh_preview` | Legacy Showmesh draft flow; never publishes | Draft | `ecosystem:execute` |
| `apphelm_create_showmesh_private_preview` | Creates and verifies a private Showmesh preview for 1 to 24 hours | Draft | `ecosystem:execute` |

Older integrations may still call a few tools by their names without the prefix (`list_products`, `get_product_health`, `query_metric`, `list_insights`, `get_insight_evidence`, `search_sessions`, `list_incidents`, `get_usage_costs`, `ask_beam`, `draft_action`). They behave the same; use the prefixed names in anything new.

## Resources and prompts

| Kind | Name | What it is |
| --- | --- | --- |
| Resource | `apphelm://capabilities` | AppHelm's capability manifest (JSON): the service, its endpoints (API, OpenAPI, MCP) and versions |
| Resource | `apphelm://service-registry` | The internal service registry. An empty list for customer keys |
| Prompt | `apphelm_investigate_product` | Takes `productId` and `question` and asks the assistant to investigate the product with AppHelm's evidence tools only, state counter-signals and uncertainty, and take no action |

## Safety

AppHelm's MCP tools fall into three groups, and the scope decides which a key can reach:

- **Reads** change nothing. Personal data is masked or withheld: session search never returns captured text, LLM content needs `includeContent: true`, customer profiles are masked, and the audit log masks secrets and emails.
- **Drafts** never act. A flag change draft is only returned to the assistant; why-moment, intervention and action drafts are stored for an owner or admin to adopt or reject in **Action Inbox → Agent drafts** (`/app/inbox?view=drafts`).
- **Direct changes** act at once, with no confirmation step in AppHelm: the explicit-only scope is the approval. Turning a flag on, launching an experiment or survey, creating a pipeline (which sends live events to a third party), inviting people and starting a migration all affect real users or data. A well-behaved assistant says what it is about to do first; ask it to, and keep explicit-only scopes off keys that don't need them.

Every change is audited under the key and the person who created it, and runs through the same code as the REST API, with the same limits and refusals. `idempotencyKey` makes a retry safe: the same key with the same input returns the first answer (marked `replayed: true` where the tool says so), the same key with different input is refused with `idempotency_conflict`, and a key whose first call is still running answers `idempotency_in_flight` (retryable). Secrets the first answer held, such as a new browser key, are never returned again on a replay.

## Example prompts

With the product server connected, prompts like these work:

- "List my AppHelm products and tell me which one has the lowest reliability this week."
- "What are the five unresolved errors with the most users in prd_… since release 2.4.0? Show the stack of the worst one."
- "Search the logs of prd_… for `level:error service:api` in the last hour and group them by message."
- "How is the pricing-test experiment doing? Is there a winner yet, and is the sample ratio healthy?"
- "Create a draft flag called new-onboarding at 10% rollout. Don't turn it on." (needs `flags:write`)
- "Run SQL on prd_…: daily signups for the last 30 days, by utm_source."
- "Which LLM model cost us the most last week, and what was its p95 latency?"
- "Read the report of my PostHog migration and list every item that did not map, with the reason."

With the docs server: "Use the AppHelm docs to add AppHelm to this Next.js app", or "Search the AppHelm docs for how to upload source maps from GitHub Actions".

## Troubleshooting

| Symptom | Likely cause | What to do |
| --- | --- | --- |
| `401` when connecting, or the client says it cannot authenticate | The header is missing, the key is mistyped or revoked, or it is a browser key | Send `Authorization: Bearer ahl_live_…` with an active server key; in Claude Desktop check the `mcp-remote` header argument |
| A tool answers `insufficient_scope` | The key lacks the scope in the message | Create a key with that scope in Settings → API keys (explicit-only scopes must be ticked by name) |
| A tool answers `product_scope_denied` | The key is limited to other products | Use one of the key's products, or a key that includes this one |
| A tool answers `workspace_key_required` | The call came from a workload identity | Use a workspace server key |
| `not_found` for an id you can see in the app | It belongs to the demo product, or the id is wrong | Use a real product; the demo product is not available over MCP |
| A change is refused although the key has the scope | The person who created the key is no longer an owner or admin, or lost access to the product | Ask an owner or admin to create a new key |
| `idempotency_conflict` | The same `idempotencyKey` was used with different input | Use a new key for a new change |
| A SQL query answers `sql_busy` or a rate limit | Another query of the workspace is running, or 60 runs a minute were used | Retry after a moment |
| The client lists no tools | The client connected to the wrong URL or transport | Use `https://apphelm.dev/mcp` with the HTTP (Streamable HTTP) transport, not SSE |
