# Build with AI

Set up AI coding agents and assistants to build with Medblocks.

> **Give your AI agent the same context you would give a new engineer.**

Most integrations get built with an AI agent in the loop now, and the difference between a good build and a bad one is what the agent knows before it starts. Brief it well and it writes the integration a senior engineer would. Leave it guessing and it invents SDK methods that never shipped, puts secrets in browser code, and hands you an afternoon of debugging code that merely looked plausible.

So we packaged that context for you. A [skill](#install-the-skill-for-your-coding-agent) that teaches coding agents our integration flows. An [MCP server](/docs/mcp) that turns an assistant into a hands-on operator of your live workspace. [Ready-made prompts](#start-from-a-ready-made-prompt) and clean Markdown exports for everything else. Set up whichever matches how you build.

## Install the skill for your coding agent [#install-the-skill-for-your-coding-agent]

The Medblocks skill teaches agents such as Claude Code, Cursor, and Codex the Patient Access flow, record export, and the security rules that go with them. It also tells the agent to read the live docs and generated API reference instead of relying on memory.

<Tabs items="[&#x22;Claude Code&#x22;, &#x22;Codex&#x22;, &#x22;Cursor&#x22;, &#x22;Skills only&#x22;]" icons="[&#x22;claude-code&#x22;, &#x22;codex&#x22;, &#x22;cursor&#x22;, &#x22;skills&#x22;]">
  <Tab value="Claude Code">
    ```bash
    # Adds the Medblocks marketplace, then installs the skills as a plugin with automatic updates
    claude plugin marketplace add medblocks/skills
    claude plugin install medblocks-skills@medblocks
    ```
  </Tab>

  <Tab value="Codex">
    ```bash
    # Installs the skills to .agents/skills in your repo, which Codex reads natively
    npx skills add medblocks/skills -a codex
    ```
  </Tab>

  <Tab value="Cursor">
    ```bash
    # Installs the skills to .agents/skills in your repo, which Cursor reads natively
    npx skills add medblocks/skills -a cursor
    ```
  </Tab>

  <Tab value="Skills only">
    ```bash
    # One command installs the skills for every agent the skills CLI supports
    npx skills add medblocks/skills
    ```
  </Tab>
</Tabs>

Skills do not read your local files by themselves. They guide the coding agent that is already running in your editor or terminal.

## Connect an assistant to your workspace [#connect-an-assistant-to-your-workspace]

The MCP server does something different from the skill. Where the skill helps an agent write code, the MCP server needs no code at all. Connect it and an assistant such as Claude or ChatGPT can look up who is set up in your workspace, search for hospitals, start portal connections, and read the records that come back, all behind a consent screen where you choose exactly what to grant.

Follow [MCP server](/docs/mcp) to connect Claude Code, Codex, ChatGPT, or claude.ai.

## Start from a ready-made prompt [#start-from-a-ready-made-prompt]

These prompts point an agent at the right docs and give it a work order. Copy one into your tool, or open it directly in Cursor, Claude, or ChatGPT.

<CopyPrompt id="patient-access-build" />

<CopyPrompt id="setup-platform-api" />

## Hand your agent the right docs [#hand-your-agent-the-right-docs]

Every docs page has a Markdown version behind the **Copy Markdown** action at the top of the page, and the docs expose `/docs/llms.txt` as a compact index and `/docs/llms-full.txt` as a full export. Markdown beats copied HTML because tabs, callouts, and code blocks stay parseable.

Which pages to hand over depends on what you are building.

| Building           | Give the agent                                                                                                                                                                                                                                          |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Patient access     | [Patient access overview](/docs/patient-access/overview), [Create patients](/docs/patient-access/create-patients), [Create a patient session](/docs/patient-access/create-patient-session), [Handle the return](/docs/patient-access/handle-the-return) |
| A webhook receiver | [Webhooks](/docs/webhooks), [Signatures](/docs/webhooks/signatures), [Events](/docs/webhooks/events)                                                                                                                                                    |
| Raw REST calls     | [API Reference](/docs/reference/api), [API errors](/docs/reference/errors)                                                                                                                                                                              |

For patient access work, also say whether Medblocks hosts the source search page or you are building source search into your own UI. For TypeScript projects, prefer the SDK. For other stacks, keep the Medblocks API key on the server and treat the reference as the source of truth for request and response shapes.

## Ground rules for any agent [#ground-rules-for-any-agent]

Whichever tool you use, hold the agent to these rules.

* Keep `MEDBLOCKS_API_KEY` on the server, never in browser code.
* Verify webhook signatures before trusting event payloads.
* Use the API Reference as the source of truth for wire shapes.
* Log Medblocks error codes and request IDs on the server.
* Treat the patient return URL as UI state. Confirm record availability with server-side reads or webhooks.

## See also [#see-also]

<RelatedLinks>
  * [Our approach](/docs/our-approach)
  * [MCP server](/docs/mcp)
  * [API Reference](/docs/reference/api)
  * [Patient access quickstart](/docs/patient-access/quickstart)
  * [Webhooks](/docs/webhooks)
</RelatedLinks>

## Need help?

Running into an issue or have a question the docs do not answer? Get support from the Medblocks team through https://forms.gle/dtVxkmfL6Yimp6SBA and we will get back to you.
