Guides

MCP (connect an AI coding tool)

Mudbase runs a Model Context Protocol server so AI coding tools - Claude Code, Claude Desktop, Cursor, Windsurf, VS Code, Cline, or any other MCP client - can build against your project directly: create collections, read and write documents, manage files, invoke functions, and more, without you writing integration code. Connection details for your own project are on the MCP console page; this guide is its reference.

MCP access is included on the Basic, Starter, Growth, Scale, and Enterprise plans. It's also open to the Free plan for a limited time, through November 1, 2026 (UTC) - after that, Free-plan access reverts and a paid plan is required.

Connecting

Auth is the same API key you already use for the REST API - there is no separate MCP token. Any active key for the project works as the bearer credential. The fastest path is the MCP console page: click Generate MCP key to mint a least-privilege key scoped to the MCP tools, and the console fills the snippet for your chosen client with the live key inline (shown once). The blocks below use <YOUR_API_KEY> as a stand-in - replace it with your key.

Every client speaks the same Streamable-HTTP transport with an X-API-Key header; only the config file shape differs. Pick your client below.

Claude Code (CLI):

Shell
claude mcp add --transport http mudbase https://api.mudbase.dev/mcp --header "X-API-Key: <YOUR_API_KEY>"
claude mcp add --transport http mudbase https://api.mudbase.dev/mcp --header "X-API-Key: <YOUR_API_KEY>"

Claude Desktop (claude_desktop_config.json):

JSON
{
  "mcpServers": {
    "mudbase": {
      "url": "https://api.mudbase.dev/mcp",
      "headers": { "X-API-Key": "<YOUR_API_KEY>" }
    }
  }
}
{
  "mcpServers": {
    "mudbase": {
      "url": "https://api.mudbase.dev/mcp",
      "headers": { "X-API-Key": "<YOUR_API_KEY>" }
    }
  }
}

Cursor (~/.cursor/mcp.json):

JSON
{
  "mcpServers": {
    "mudbase": {
      "url": "https://api.mudbase.dev/mcp",
      "headers": { "X-API-Key": "<YOUR_API_KEY>" }
    }
  }
}
{
  "mcpServers": {
    "mudbase": {
      "url": "https://api.mudbase.dev/mcp",
      "headers": { "X-API-Key": "<YOUR_API_KEY>" }
    }
  }
}

Windsurf (~/.codeium/windsurf/mcp_config.json):

JSON
{
  "mcpServers": {
    "mudbase": {
      "serverUrl": "https://api.mudbase.dev/mcp",
      "headers": { "X-API-Key": "<YOUR_API_KEY>" }
    }
  }
}
{
  "mcpServers": {
    "mudbase": {
      "serverUrl": "https://api.mudbase.dev/mcp",
      "headers": { "X-API-Key": "<YOUR_API_KEY>" }
    }
  }
}

VS Code (.vscode/mcp.json - also covers the Continue extension):

JSON
{
  "servers": {
    "mudbase": {
      "type": "http",
      "url": "https://api.mudbase.dev/mcp",
      "headers": { "X-API-Key": "<YOUR_API_KEY>" }
    }
  }
}
{
  "servers": {
    "mudbase": {
      "type": "http",
      "url": "https://api.mudbase.dev/mcp",
      "headers": { "X-API-Key": "<YOUR_API_KEY>" }
    }
  }
}

Cline (cline_mcp_settings.json):

JSON
{
  "mcpServers": {
    "mudbase": {
      "type": "streamableHttp",
      "url": "https://api.mudbase.dev/mcp",
      "headers": { "X-API-Key": "<YOUR_API_KEY>" }
    }
  }
}
{
  "mcpServers": {
    "mudbase": {
      "type": "streamableHttp",
      "url": "https://api.mudbase.dev/mcp",
      "headers": { "X-API-Key": "<YOUR_API_KEY>" }
    }
  }
}

Any other Streamable-HTTP client: point it at the endpoint with the X-API-Key header set (some clients accept Authorization: Bearer <key> instead):

Endpoint https://api.mudbase.dev/mcp Transport Streamable HTTP Auth header X-API-Key: <YOUR_API_KEY>

If your organization has dedicated infrastructure, connect to your dedicated host instead of api.mudbase.dev - the exact URL is shown on the console page.

Other ways to build with AI tools

The hosted endpoint above is the primary way to connect an AI coding tool, but two more options exist depending on what you're building.

Standalone MCP server package

A separate, published package you run locally with npx - no account setup beyond the API key, useful for a simpler or stdio-only MCP host:

Shell
npx mudbase-mcp-server
npx mudbase-mcp-server

Configure it with one environment variable; it resolves the platform host itself, no header wiring or endpoint URL needed:

JSON
{
  "mcpServers": {
    "mudbase": {
      "command": "npx",
      "args": ["mudbase-mcp-server"],
      "env": { "MUDBASE_API_KEY": "<YOUR_API_KEY>" }
    }
  }
}
{
  "mcpServers": {
    "mudbase": {
      "command": "npx",
      "args": ["mudbase-mcp-server"],
      "env": { "MUDBASE_API_KEY": "<YOUR_API_KEY>" }
    }
  }
}

It covers a narrower surface than the hosted endpoint above - collections, documents, search, and storage, about 14 tools versus the 38 listed below, with no functions, webhooks, messaging, users, or add-ons. Reach for the hosted endpoint when an agent needs the full platform surface.

AI coding skill

For an agent that reads project context rather than calling tools directly, mudbase-skill is a Claude Skill that teaches it the full SDK client, every auth flow, the data contract, storage, realtime, webhooks, both MCP surfaces above, and more - so it already knows how Mudbase works before you start prompting, instead of you pasting API docs into every conversation.

Clone it into your skills directory and any coding agent that reads SKILL.md picks it up automatically:

Shell
git clone https://github.com/themudhaxk/mudbase-skill.git ~/.claude/skills/mudbase
git clone https://github.com/themudhaxk/mudbase-skill.git ~/.claude/skills/mudbase

It isn't Claude Code-specific - SKILL.md is a plain Markdown file, so any tool that can be pointed at project context (Cursor rules, a pasted system prompt, and so on) works the same way. See the mudbase-skill repository for every install path and what each reference file covers.

Available tools

Every tool is scoped to the project the API key belongs to, and to that key's own permission grants - a key created with read-only database access gets a permission error from create_document/update_document/delete_document exactly as it would calling the REST API directly. Writes made through MCP trigger the same Functions/Webhooks events a REST write would.

Project

ToolDescription
get_project_infoGet basic information about the current project.
get_project_usageGet the current project's usage statistics against its org's plan limits.

Database

ToolDescription
list_collectionsList the database collections in the current project.
get_collection_schemaGet a collection's field schema (name, type, required, validation) - call this before querying or writing so field names/types are known.
create_collectionCreate a new collection with a field schema.
update_collectionUpdate a collection's fields, permissions, or settings. Only the properties provided are changed.
delete_collectionDelete a collection and its field schema. Does not delete the underlying documents' storage.
query_documentsQuery documents with an optional filter, sort, and pagination. Excludes documents past their configured soft-hide expiration unless includeExpired is set, same as the REST API.
get_documentGet a single document by id. Excludes a document past its configured soft-hide expiration unless includeExpired is set, same as the REST API.
create_documentCreate a document (validated against the collection's schema).
update_documentUpdate fields on an existing document.
delete_documentDelete a document.

Relationships (read-only)

ToolDescription
list_relationshipsList the declared relationships (foreign-key metadata between collections) in the current project.
get_relationshipGet a single declared relationship definition by id.

Creating, updating, deleting, or repairing relationships is not exposed over MCP: those REST endpoints require an owner or admin console role, a concept API keys (and so MCP clients) don't have. This is a deliberate, permanent exclusion, not a gap to be filled later.

Search

ToolDescription
search_documentsFree-text search across one or more collections in the current project, with relevance ranking. Distinct from query_documents, which runs a structured per-collection filter with no text ranking.

Storage

ToolDescription
list_filesList files in the project's storage, optionally scoped to one bucket.
upload_fileUpload a file (base64-encoded content).
get_file_urlGet a signed, time-limited download URL for a file.
delete_fileDelete a file.
list_bucketsList the storage buckets in the current project.
create_bucketCreate a new storage bucket in the current project.

Functions

ToolDescription
list_functionsList the serverless functions deployed in this project.
invoke_functionInvoke a deployed function with a JSON payload and return its result.
get_functionGet a deployed function's full definition, including its code.
create_functionCreate a new serverless function in this project.
update_functionUpdate a function's code, trigger, environment, or metadata. Only the properties provided are changed.
delete_functionDelete a function from this project.
get_function_logsGet recent execution history (logs) for a function.

A function's code runs with this project's backend privileges on every future invocation, so create_function and update_function let an MCP client author and deploy arbitrary server-side logic into the project, not just read or write data rows. Scope any API key you hand to an MCP client accordingly - grant functions permissions only to keys/agents you trust with that level of access.

Webhooks

ToolDescription
get_webhook_configGet the project's configured webhook URL and subscribed events (read-only).
list_webhook_deliveriesList recent webhook delivery attempts for this project, with their status (read-only).

Messaging

ToolDescription
send_emailSend an email from this project. Enqueues for delivery and returns a job id.
list_email_templatesList the email templates available to this project (built-in, platform default, and project-customized).
send_smsSend an SMS from this project.
get_message_historyGet the send history for this project's messaging (email, SMS, push), with delivery status.

send_email and send_sms trigger a real outbound message to a real recipient as soon as an MCP client calls them - there is no preview-only mode. They're bound by the same trust and quota rules their REST equivalents already have (an unverified org's owner cannot send email until they verify, and both channels are capped by the project's plan).

Users

ToolDescription
list_usersList end-users registered in this project (never returns credentials).
get_userGet a single end-user by id (never returns credentials).

Add-ons

ToolDescription
list_addonsList the available add-ons (PDF, QR code, CSV, ICS, vCard, …).
generate_addonRun an add-on with the given input and return the result link or inline data.

Errors

StatusMeaning
401Missing or invalid API key.
402The org's plan doesn't include MCP access.
500The MCP request failed server-side.

A tool call itself can also fail with a permission error (returned as a normal MCP tool result with isError: true, not an HTTP status) if the API key's permissions don't include the resource/action the tool needs - e.g. create_document on a key scoped to read-only database access.

Chat with us