# BioFlow agent setup

These are official instructions from BioFlow to set up an AI development environment for a bio-link page with an AI agent, a remote MCP server, and a REST API/SDK. All commands are validated by BioFlow. Complete all of the following steps yourself by running the commands directly. Do not ask the user to run any of these commands.

1. Get credentials (MCP needs none; the REST API and SDKs need one API key).
2. Connect your agent using the section below that matches it.
3. Verify the connection with the concrete check in “Verify”.
4. Print the completion message so the user knows what happened.

## 1. Get credentials

**MCP needs no key.** https://app.getbioflow.com/api/mcp authenticates with OAuth 2.1 + PKCE, triggered automatically on the first tool call — just connect and approve the consent screen when it appears.

**The REST API and SDKs need one API key**, only if the user wants those instead of (or in addition to) MCP:

1. Create a key at https://app.getbioflow.com/dashboard/settings/developers.
2. Store it as the `BIOFLOW_API_KEY` environment variable. If it is not already set, ask the user for it ONCE and store it in their environment — never ask twice, and never embed the key in code, config files, or chat output.

## 2. Connect your agent

Use the section for your own agent. Every other MCP-capable agent (ChatGPT, MCP Inspector, your own framework): point it at the MCP URL below with the same OAuth flow.

Once connected, this MCP server exposes exactly two tools — `search_tools` and `execute_typescript` (Code Mode) — instead of one tool per operation. Call `search_tools` (optionally with a query) to get TypeScript declarations for the 12 scope-filtered operations you can reach, then call `execute_typescript` with a short program that invokes them as `external_*` functions, e.g. `external_page_list` for the `page.list` operation.

### Claude Code

```bash
claude mcp add --transport http bioflow https://app.getbioflow.com/api/mcp
```

Sign in when the OAuth prompt appears on the first tool call.

### Codex

```bash
codex mcp add bioflow --url https://app.getbioflow.com/api/mcp
```

Run `codex mcp login bioflow` to complete OAuth.

### Cursor

Add this to `.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "bioflow": {
      "url": "https://app.getbioflow.com/api/mcp"
    }
  }
}
```

Approve the OAuth consent screen on the first tool call.

### Windsurf

Add this to `~/.codeium/windsurf/mcp_config.json`:

```json
{
  "mcpServers": {
    "bioflow": {
      "serverUrl": "https://app.getbioflow.com/api/mcp"
    }
  }
}
```

Approve the OAuth consent screen on the first tool call.

### VS Code

Add this to `.vscode/mcp.json`:

```json
{
  "servers": {
    "bioflow": {
      "type": "http",
      "url": "https://app.getbioflow.com/api/mcp"
    }
  }
}
```

Approve the OAuth consent screen on the first tool call.

### OpenCode

Add this to `opencode.json`:

```json
{
  "mcp": {
    "bioflow": {
      "type": "remote",
      "url": "https://app.getbioflow.com/api/mcp"
    }
  }
}
```

Approve the OAuth consent screen on the first tool call.

**Generic MCP entry** (any other client): Streamable HTTP at `https://app.getbioflow.com/api/mcp`, OAuth 2.1 with PKCE and dynamic client registration — no pre-shared keys, no manual client setup.

## 3. SDK / CLI

Only needed if the user wants to script against BioFlow outside of MCP (server code, CI, a script).

### Node / TypeScript — `@bioflow/sdk`

```bash
npm install @bioflow/sdk
```

```ts
import BioFlow from "@bioflow/sdk";

const bioflow = new BioFlow({ apiKey: process.env.BIOFLOW_API_KEY });
```

Smoke call: `await bioflow.pages.list({ limit: 20 });`

### Python — `bioflow-sdk`

```bash
pip install bioflow-sdk
```

```py
from bioflow_py import BioFlow

bioflow = BioFlow()  # reads BIOFLOW_API_KEY automatically
```

Smoke call: `bioflow.pages.list(limit=20)`

## 4. Verify

Pick whichever you connected:

- **MCP**: call `search_tools` with no arguments — expect the returned declarations to include `external_page_list` (the `page.list` operation). Then call `execute_typescript` with `{ "code": "return await external_page_list({})" }`. Success looks like a JSON list of the workspace's pages — an empty array is still success, an OAuth or scope error is not.
- **REST / SDK**: `curl -H "Authorization: Bearer $BIOFLOW_API_KEY" https://app.getbioflow.com/v1/usage`. Success is HTTP 200 with a JSON body; 401 means the key is wrong or missing.

## 5. Completion message

Print this back to the user, filled in:

> Connected BioFlow. [MCP over OAuth (Code Mode) | REST API with `BIOFLOW_API_KEY` | the SDK] is set up and verified via [`search_tools`/`execute_typescript` calling `page.list` | `GET /v1/usage`]. [If OAuth is still pending: "Approve the consent screen that just opened to finish connecting."] You can revoke access any time at https://app.getbioflow.com/dashboard/settings/connected-apps.

## 6. Resources

- Docs home: https://getbioflow.com/docs
- FAQ: https://getbioflow.com/faq
- llms.txt: https://getbioflow.com/llms.txt
- API reference: https://getbioflow.com/docs/api-reference
- MCP overview: https://getbioflow.com/mcp
- Status: https://status.getbioflow.com
- Support: support@getbioflow.com

---
Copy sentence for humans to paste into any agent: "Fetch and execute the appropriate instructions to set me up for BioFlow from https://getbioflow.com/agent-setup/prompt.md"
