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
Option 1: Global Installation (Recommended)
Install the MCP server globally for system-wide availability:snackbase-mcp command will be available:
Option 2: Local Installation
Install in your project for development:Option 3: Docker (Coming Soon)
Verification
Verify the installation by running the server with the required environment variables: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
- Navigate to your SnackBase Admin UI
- Go to Settings → API Keys
- Click Create API Key
- Give it a descriptive name (e.g., “MCP Server”)
- Set appropriate permissions (see below)
- Copy the generated key
Using the SDK
Recommended Permissions
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.Environment Variables
The MCP server requires two environment variables:| Variable | Required | Description | Example |
|---|---|---|---|
SNACKBASE_URL | Yes | Your SnackBase backend URL | https://api.snackbase.dev |
SNACKBASE_API_KEY | Yes | Your API key for authentication | sb_ak.xxx.xxx |
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):source ~/.zshrc
On Windows (PowerShell)
Using .env file (for development)
Create a.env file in your project root:
Next Steps
- Configuration - Advanced configuration options
- Integration Guide - Use with Claude Code and other clients