Model Context Protocol

Operate Askery from any AI agent.

A thin MCP bridge over the public API. Drop it into Claude Desktop, Cursor, or any MCP-capable client and your agent can build forms, fetch responses, and codegen Decision Engines - by name.

An AI assistant orb connected by thin lines to a constellation of typed tool icons

What it is

The Askery MCP server is a tiny stdio program that exposes the public REST API as a catalog of typed tools. The agent calls askery_generate_form with a brief; the server forwards it to POST /api/v1/forms/ai/generate with your API key; the JSON response goes back to the agent. Same API, same permissions, same audit trail as everything else you do on Askery.

Every tool maps 1:1 to a documented endpoint, so the behaviour is identical whether you use the tool, curl, or the dashboard. There's no second contract to learn.

Install

One snippet, every MCP-capable client. Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, Cline, Zed, Goose, JetBrains AI, Codex CLI, and Gemini CLI all consume the same shape:

{
  "mcpServers": {
    "askery": {
      "command": "npx",
      "args": ["-y", "@askeryforms/mcp"],
      "env": {
        "ASKERY_API_KEY": "ak_live_..."
      }
    }
  }
}

The exact paths and per-agent gotchas (root-key differences for VS Code, Zed, and Goose; TOML for Codex; YAML for Continue) are spelled out on the setup guide.

Mint a key at /dashboard/api-keys. Pick the scopes that match the tools you intend to expose; the server returns clean errors when a tool is called without the required scope, so you don't need to over-grant up front.

Test it

The Model Context Protocol team ships an interactive inspector. Run it pointed at the Askery server and you can list, call, and explore every tool:

bunx @modelcontextprotocol/inspector \
  bun /path/to/askery/mcp/server.ts

Tool catalog

25 tools, organised by what they touch. Required scope is shown so you know what to enable on the key.

ToolScopeWhat it does
askery_list_formsforms:readList forms in the workspace.
askery_get_formforms:readFetch one form's full canonical definition.
askery_create_formforms:writeCreate a form from a FormDefinition.
askery_generate_formai:runGenerate a form from a natural-language brief.
askery_edit_formai:runAI-edit a stored form. Supports preview mode.
askery_publish_formforms:writePublish a form (auto-generates a slug if needed).
askery_archive_formforms:writeArchive a form (status → closed).
askery_duplicate_formforms:writeMake a fresh draft copy of a form.
askery_list_responsesresponses:readList responses (with status, since, until, email filters and cursor pagination).
askery_get_responseresponses:readFetch one response with answers folded in.
askery_export_responses_csvresponses:readPull all responses as CSV text.
askery_get_intelligenceforms:readRead Form Intelligence config (mode, rules, decision code, sections).
askery_save_decision_codeforms:writeSave Decision Engine code (with validation).
askery_generate_decision_codeai:runCodegen Decision Engine code from a brief (IR → render → critique).
askery_test_decision_codeintelligence:runRun DE code in the WASM sandbox against synthetic answers. 0 credits.
askery_regenerate_resultintelligence:runClear the cached AI outcome on a response and recompute.
askery_list_webhooksforms:readList webhook subscriptions.
askery_create_webhookwebhooks:writeCreate a webhook subscription; secret returned once.
askery_delete_webhookwebhooks:writeDelete a webhook subscription.
askery_import_formimports:runPull a canonical form definition from any third-party form URL.
askery_prefill_linkforms:readBuild a respondent URL with answer values pre-loaded into matching questions.
askery_workspaceworkspace:readWorkspace identity, plan, credit balance.
askery_usageworkspace:readCredit balance + recent ledger entries.
askery_audit_logworkspace:readWorkspace activity log (with filters).
askery_form_analyticsforms:readPer-form analytics: views, starts, completions, funnel, per-question summaries.

Worked example

A typical agent conversation, after MCP is wired up:

You: Build me a 5-question NPS survey for our enterprise customers.

Agent → askery_generate_form({ brief: "...", save: true, status: "draft" })
       ← { id, slug, definition, ... }

You: Publish it.

Agent → askery_publish_form({ id: "..." })
       ← { id, status: "published", slug: "..." }

You: How are responses coming in?

Agent → askery_form_analytics({ id: "..." })
       ← { summary: { views, completions, completionRate, ... } }

You: Anyone score below 6? Show their answers.

Agent → askery_list_responses({ id, ... })
       ← filters in-app, returns the rows with answers folded in.

Errors

When a tool call fails, the server returns the API's structured error envelope verbatim. The agent sees the code, the human message, the request_id for support, and (when relevant) a docs_url. That's enough for the agent to decide whether to retry, ask you, or escalate.

Beyond MCP - the underlying API

The MCP server is a convenience. The same operations are available via the public REST API for traditional integrations (cron jobs, internal tools, BI pipelines, Lambdas). Full spec at /api/v1/openapi.json and /developers.