Skip to main content
The SnackBase MCP server can be installed via npm or used directly with npx.

Prerequisites

Before installing the MCP server, ensure you have:
  • Node.js 20+ installed
  • A running SnackBase backend (self-hosted or SnackBase Cloud)
  • An API key from your SnackBase instance

Installation Methods

Install the MCP server globally for system-wide availability:
After installation, the snackbase-mcp command will be available:

Option 2: Local Installation

Install in your project for development:
Run using npx:

Option 3: Docker (Coming Soon)

Verification

Verify the installation by running the server with the required environment variables:
You should see output like:
The MCP server communicates via stdio, so you won’t see an HTTP port. It’s designed to be used by MCP clients like Claude Code or Cursor.

Creating an API Key

You need an API key to use the MCP server. Here’s how to create one:

Using the SnackBase Admin UI

  1. Navigate to your SnackBase Admin UI
  2. Go to SettingsAPI Keys
  3. Click Create API Key
  4. Give it a descriptive name (e.g., “MCP Server”)
  5. Set appropriate permissions (see below)
  6. Copy the generated key

Using the SDK

The permissions you grant to the MCP API key depend on your use case:

For General Development

  • Read access to all collections
  • Create/update/delete access to development collections
  • User management (if testing auth flows)

For Data Analysis Only

  • Read access to relevant collections
  • No write permissions

For Full Admin Access

Use with caution! Only for trusted environments.
Never commit API keys to version control. Store them in environment variables or a secure secrets manager.

Environment Variables

The MCP server requires two environment variables:
The API key format changed in v0.3.0 to use three parts: sb_ak.<payload>.<signature>. Old keys will continue to work, but new keys use this format.

Setting Environment Variables

On macOS/Linux

Add to your shell profile (~/.zshrc, ~/.bashrc):
Then reload: source ~/.zshrc

On Windows (PowerShell)

Or set permanently:

Using .env file (for development)

Create a .env file in your project root:
Then load it before running the server:

Next Steps