Skip to main content

MCP Server

Manage your BFFless instance directly from AI coding assistants using the Model Context Protocol (MCP). The built-in MCP server exposes all admin operations as tools — projects, deployments, aliases, domains, pipelines, proxy rules, cache rules, and more — so your AI assistant can create, update, and query resources on your behalf.

Overview

The MCP server is available at /mcp on every BFFless instance. It uses the Streamable HTTP transport and authenticates via API key. Any MCP-compatible client can connect — including Claude Code, Cursor, Windsurf, and custom integrations.

What you can do:

  • Create projects and manage deployments
  • Promote and roll back aliases
  • Configure custom domains and subdomains
  • Build data-backed APIs with pipeline schemas and proxy rules
  • Set up file uploads, cache rules, and AI chat pipelines
  • Query and manage pipeline data records
  • Debug pipeline execution with logs
  • Manage users, roles, and API keys

Setup

Prerequisites

  • A running BFFless instance (self-hosted or managed)
  • An API key with appropriate permissions

1. Create an API Key

Navigate to Settings → API Keys in your BFFless admin panel and create a new key. Copy it — you'll need it for the next step.

tip

API keys can be scoped to a specific project or granted global access. For AI assistants, a global key is usually most convenient.

2. Connect Your MCP Client

Claude Code

claude mcp add bffless -t http \
--url https://admin.your-instance.example.com/mcp \
--header "X-API-Key: YOUR_API_KEY"

This adds the server to your ~/.claude.json configuration:

{
"mcpServers": {
"bffless": {
"type": "http",
"url": "https://admin.your-instance.example.com/mcp",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}

Cursor / Other MCP Clients

Add the following to your MCP client configuration:

  • Transport: Streamable HTTP
  • URL: https://admin.your-instance.example.com/mcp
  • Header: X-API-Key: YOUR_API_KEY

3. Verify the Connection

Ask your AI assistant to list your projects:

"List all my BFFless projects"

The assistant will call the list_projects tool and return your project list.

Connecting Multiple Instances

You can connect to multiple BFFless instances simultaneously by giving each a unique name:

claude mcp add bffless-production -t http \
--url https://admin.production.example.com/mcp \
--header "X-API-Key: PROD_KEY"

claude mcp add bffless-staging -t http \
--url https://admin.staging.example.com/mcp \
--header "X-API-Key: STAGING_KEY"

Each instance is fully isolated — tools are scoped to the workspace they're connected to.

Available Tools

Projects

ToolDescription
list_projectsList all projects accessible to the current user
get_projectGet a project by owner and name
create_projectCreate a new project
update_projectUpdate project settings (display name, description, visibility)
delete_projectDelete a project and all its deployments, aliases, and storage files

Deployments & Aliases

ToolDescription
list_deploymentsList deployments with optional filters (repository, branch, commit SHA)
get_deploymentGet deployment details including files and aliases
delete_deploymentDelete a deployment and its files from storage
list_aliasesList aliases for a project
create_aliasCreate a new alias pointing to a commit SHA
update_aliasUpdate an alias to point to a different commit SHA
delete_aliasDelete an alias

Domains

ToolDescription
list_domainsList all domain mappings
get_domainGet domain details
create_domainCreate a subdomain, custom domain, or redirect
update_domainUpdate domain settings
delete_domainRemove a domain mapping

Pipeline Schemas & Data

ToolDescription
list_pipeline_schemasList all schemas for a project
get_pipeline_schemaGet schema details with record count
create_pipeline_schemaCreate a schema with typed fields
update_pipeline_schemaUpdate schema name or fields
delete_pipeline_schemaDelete a schema and all its data
generate_upload_schemaGenerate a file upload schema with upload/serve pipelines
query_pipeline_dataQuery records with pagination, search, and sorting
get_pipeline_recordGet a single record by ID
create_pipeline_recordCreate a new data record
update_pipeline_recordUpdate an existing record
delete_pipeline_recordDelete a record

Proxy Rules

ToolDescription
list_proxy_rule_setsList rule sets for a project
get_proxy_rule_setGet rule set details with all rules
create_proxy_rule_setCreate a new rule set
delete_proxy_rule_setDelete a rule set
get_proxy_ruleGet a single proxy rule
create_proxy_ruleCreate a rule (path + method + pipeline config)
update_proxy_ruleUpdate a proxy rule
delete_proxy_ruleDelete a proxy rule

Cache Rules

ToolDescription
list_cache_rulesList cache rules for a project
get_cache_ruleGet cache rule details
create_cache_ruleCreate a cache policy for a path pattern
delete_cache_ruleDelete a cache rule

Pipeline Debugging

ToolDescription
enable_pipeline_debugToggle debug logging on a proxy rule
list_pipeline_logsList execution logs for a proxy rule
get_pipeline_logGet full execution log with step details
get_pipeline_log_stepGet input/output for a specific pipeline step

Users & API Keys

ToolDescription
list_usersList all users
get_userGet user details
update_user_roleChange a user's role
list_api_keysList all API keys
create_api_keyCreate a new API key
delete_api_keyRevoke an API key

Settings

ToolDescription
get_primary_content_configGet which project/alias serves on the root domain
update_primary_content_configUpdate the primary content configuration

Common Workflows

Deploy a Static Site

Ask your AI assistant:

"Create a new project called my-org/landing-page, then set up a production alias and map it to landing.example.com"

Behind the scenes, the assistant will:

  1. create_project — Create the project
  2. create_alias — Point "production" to the latest deployment
  3. create_domain — Map the subdomain to the project

Build a Data-Backed API

"Create a contacts schema with name, email, and company fields, then set up GET and POST endpoints at /api/contacts"

The assistant will:

  1. create_pipeline_schema — Define the data model
  2. create_proxy_rule_set — Group the API rules
  3. create_proxy_rule — Create GET endpoint with data_query handler
  4. create_proxy_rule — Create POST endpoint with data_create handler

Promote a Deployment

"Show me the latest deployments for my-org/app and promote the most recent one to production"

  1. list_deployments — Find the latest commit SHA
  2. update_alias — Point the production alias to the new SHA

Roll Back

"Roll back the production alias for my-org/app to the previous deployment"

  1. list_deployments — Find the previous commit SHA
  2. update_alias — Point production back to the old SHA

Debug a Pipeline

"Enable debug logging on my /api/contacts endpoint and show me the last few execution logs"

  1. enable_pipeline_debug — Turn on logging for the rule
  2. list_pipeline_logs — View recent executions
  3. get_pipeline_log — Inspect a specific execution's step-by-step data

Technical Details

Authentication

All MCP requests are authenticated via the X-API-Key header. The server uses the same API key system as the REST API — keys created in the admin panel work for both.

Transport

The MCP server uses Streamable HTTP transport in stateless mode with JSON responses enabled. This means:

  • No persistent WebSocket connections required
  • Each request is independent (no session state)
  • Compatible with HTTP proxies and load balancers

Endpoint

The MCP endpoint is always available at:

https://admin.<your-domain>/mcp

For self-hosted instances, this is typically:

https://admin.<PRIMARY_DOMAIN>/mcp

Rate Limiting

MCP requests are subject to the same rate limits as the REST API. For high-volume automation, consider using the REST API directly.

  • Pipelines — Learn about pipeline schemas, field types, and handler configurations
  • Proxy Rules — Detailed guide on setting up API endpoints with proxy rules
  • AI Pipelines — Configure AI-powered chat and content generation