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

# Integrate with AI

> Connect the Flabs docs MCP to your AI code editor and let it build the integration for you.

Every page of this documentation is also available to AI coding assistants through our
**Model Context Protocol (MCP) server**. Point your editor at it once, then ask your
assistant to "integrate with Flabs" — it reads the live API reference, auth flow,
schemas and webhook specs on demand and writes the integration code for you.

<Note>
  MCP server URL:  `https://developer.flabslis.com/mcp`
</Note>

## How it works

```mermaid theme={null}
flowchart LR
    A[You ask your AI<br/>“integrate with Flabs”] --> B[AI queries the<br/>Flabs docs MCP]
    B --> C[Reads auth, CRM,<br/>billing & webhook specs]
    C --> D[Writes the integration<br/>code in your project]
```

The MCP exposes the same content you're reading now — the auth token flow, CRM lead/booking
endpoints, the billing pre-booking API, webhook events and the OpenAPI specs — as structured,
searchable context. Your assistant pulls only the pages it needs, so it generates code against
the **current** API instead of guessing.

## 1. Add the MCP server to your editor

Pick your tool. The server is a remote HTTP MCP — no install, no API key needed to read the docs.

<Tabs>
  <Tab title="Cursor">
    Add to `.cursor/mcp.json` in your project (or the global config):

    ```json theme={null}
    {
      "mcpServers": {
        "flabs-developer": {
          "url": "https://developer.flabslis.com/mcp"
        }
      }
    }
    ```
  </Tab>

  <Tab title="Claude Code">
    Run in your project directory:

    ```bash theme={null}
    claude mcp add --transport http flabs-developer https://developer.flabslis.com/mcp
    ```
  </Tab>

  <Tab title="VS Code (Copilot)">
    Add to `.vscode/mcp.json`:

    ```json theme={null}
    {
      "servers": {
        "flabs-developer": {
          "type": "http",
          "url": "https://developer.flabslis.com/mcp"
        }
      }
    }
    ```
  </Tab>

  <Tab title="Windsurf">
    Add to `~/.codeium/windsurf/mcp_config.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "flabs-developer": {
          "serverUrl": "https://developer.flabslis.com/mcp"
        }
      }
    }
    ```
  </Tab>
</Tabs>

Reload your editor so it picks up the new server. You should see a **flabs-developer** MCP
with two tools: a docs **search** and a read-only docs **filesystem**.

## 2. Ask the AI to integrate

Once the server is connected, describe what you want in plain language. The assistant will
search the docs, read the relevant endpoints, and scaffold the code. A few prompts that work well:

```text theme={null}
Using the flabs-developer MCP, add a Flabs integration to this project:
authenticate with my client credentials, fetch my branches, and create a CRM lead.
```

```text theme={null}
Set up a webhook handler for Flabs bill.completed and report.completed events,
following the payload structure in the flabs-developer docs.
```

```text theme={null}
I'm a corporate (party-scoped) account. Wire up test-pricing lookups and lead
creation scoped to my corporateUser, per the Flabs party-scoped guide.
```

The assistant pulls the exact request/response shapes, required fields, rate limits and
error codes from the docs — so the generated client matches the real API.

<Warning>
  The MCP only exposes **public documentation**. Never put your `clientID`,
  `clientSecret`, or tokens into prompts or commit them to source control — load them
  from environment variables or a secrets manager. See the
  [Authentication guide](/auth/introduction).
</Warning>

## What the assistant can build

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/auth/introduction">
    Token generation and refresh handling with your client credentials.
  </Card>

  <Card title="CRM leads & bookings" icon="user-plus" href="/crm/introduction">
    Branch lookup, test/package pricing, and lead/booking creation.
  </Card>

  <Card title="Billing pre-bookings" icon="credit-card" href="/billing/introduction">
    Create pre-bookings that kick off the lab workflow.
  </Card>

  <Card title="Webhook handlers" icon="webhook" href="/webhooks/introduction">
    Endpoints that react to bill, report and CRM events.
  </Card>
</CardGroup>

## Tips for better results

* **Tell it your account mode.** Mention whether you're catch-all (default) or
  [party-scoped](/crm/party-scoped) so it scopes calls correctly.
* **Name your stack.** "in Node/Express", "in Python/FastAPI", etc. produces idiomatic code.
* **Ask it to verify against the docs.** "Double-check the required fields against the
  flabs-developer MCP" catches missed parameters before you run anything.

## Support

Stuck or need credentials? Reach our team at **[hello@flabs.in](mailto:hello@flabs.in)** or **+91 7253928905**,
Monday to Friday, 9 AM to 6 PM IST.
