npm package: @pb-org/mcp-server
Description: MCP server for ProjectBloom AI Agent API - exposes brand info and tools to MCP clients (Cursor, Claude Desktop, etc.)
Latest version: 1.0.0

# ProjectBloom MCP Server

This MCP server exposes ProjectBloom brand data to MCP-capable clients (Cursor, Claude Desktop, etc.). The AI agent can ask for your ProjectBloom API key (or use a pre-configured one) and then answer questions about your brand using the **get_brand_info** tool.

## Prerequisites

- Node.js 18+
- A ProjectBloom API key (AI Function Calling integration) for the brand you want to query
- Your Supabase project URL (used as the base for ProjectBloom Edge Functions)

## Configuration

Set these in your environment or in your MCP client config:

| Variable | Description |
|----------|-------------|
| `PROJECTBLOOM_API_KEY` | Your ProjectBloom API key (from the app: Integrations → AI Function Calling → Generate key). **Required.** |
| `PROJECTBLOOM_BASE_URL` or `SUPABASE_URL` | Base URL of your Supabase project, e.g. `https://<project-ref>.supabase.co`. **Required.** |

## Install and run (any MCP client)

Using the published package you can run the MCP server without cloning or building:

```bash
npx @pb-org/mcp-server
```

Set `PROJECTBLOOM_API_KEY` and `PROJECTBLOOM_BASE_URL` (or `SUPABASE_URL`) in your environment first, or configure them in your MCP client as shown below. Use this same `command` + `args` in any client that supports stdio MCP servers.

## OpenClaw configuration

**Prerequisite:** Node.js 18+ (for `npx`).

Add the ProjectBloom MCP server as a toolset in your OpenClaw config. Config is usually at `~/.openclaw/openclaw.json` or in your project’s `openclaw.json` / `openclaw.yaml`.

**JSON (`openclaw.json`):**

```json
{
  "tools": {
    "toolsets": [
      {
        "command": "npx",
        "args": ["@pb-org/mcp-server"],
        "env": {
          "PROJECTBLOOM_API_KEY": "your_api_key_here",
          "PROJECTBLOOM_BASE_URL": "https://YOUR_PROJECT_REF.supabase.co"
        }
      }
    ],
    "refresh_toolsets_on_run": true
  }
}
```

**YAML (`openclaw.yaml`):**

```yaml
tools:
  toolsets:
    - command: npx
      args:
        - "@pb-org/mcp-server"
      env:
        PROJECTBLOOM_API_KEY: "your_api_key_here"
        PROJECTBLOOM_BASE_URL: "https://YOUR_PROJECT_REF.supabase.co"
  refresh_toolsets_on_run: true
```

Replace `your_api_key_here` and `YOUR_PROJECT_REF` with your ProjectBloom API key and Supabase project reference. Set `refresh_toolsets_on_run: true` if your OpenClaw version supports it so tools are discovered reliably. Restart OpenClaw after changing config.

## Cursor configuration

Add the MCP server to Cursor (e.g. in Cursor Settings → MCP or `.cursor/mcp.json`). You can use the published package with `npx` (no clone or path needed):

```json
{
  "mcpServers": {
    "pb-org": {
      "command": "npx",
      "args": ["@pb-org/mcp-server"],
      "env": {
        "PROJECTBLOOM_API_KEY": "your_api_key_here",
        "PROJECTBLOOM_BASE_URL": "https://your-project.supabase.co"
      }
    }
  }
}
```

Alternatively, with a local clone use `"command": "node"` and `"args": ["/absolute/path/to/mcp-server/dist/index.js"]`.

## Claude Desktop configuration

Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or the equivalent config file on your OS. You can use the published package with `npx`:

```json
{
  "mcpServers": {
    "pb-org": {
      "command": "npx",
      "args": ["@pb-org/mcp-server"],
      "env": {
        "PROJECTBLOOM_API_KEY": "your_api_key_here",
        "PROJECTBLOOM_BASE_URL": "https://your-project.supabase.co"
      }
    }
  }
}
```

Restart Claude Desktop after changing the config.

## Development setup (clone and build)

If you are contributing to the MCP server, clone the repo and build locally:

```bash
cd mcp-server
npm install
npm run build
node dist/index.js
```

For development with auto-reload:

```bash
npm run dev
```

(Requires `tsx`; install with `npm install -D tsx` if needed.)

## Tools

### get_brand_info

Returns the full brand details for the brand associated with the configured API key (name, description, mission, vision, tagline, tone of voice, colors, fonts, products, target audience, social channels, calendars). The AI can use this to answer user questions about the brand.

- **Arguments:** None.
- **Returns:** JSON object with brand data.

## API key setup

1. Sign in to ProjectBloom and open the organization and brand.
2. Go to **Integrations** (or **API keys**) for that brand.
3. Select **AI Function Calling** and generate a new key.
4. Copy the key and set it as `PROJECTBLOOM_API_KEY`. Store it securely; it may not be shown again.

See [docs/ai-agent-api.md](../docs/ai-agent-api.md) for full API documentation.

## Publishing (maintainers)

From the `mcp-server/` directory:

1. Bump the version in `package.json` if needed.
2. Run `npm run build` (or rely on `prepublishOnly` during publish).
3. Run `npm publish --access public` (required for scoped package `@pb-org/mcp-server` if the npm org is not paid if the npm org is not paid).

Ensure you are logged in to npm (`npm login`) before publishing.