Skip to content

MCP Server (AI Assistants)

Bambuddy has a built-in Model Context Protocol (MCP) endpoint. AI assistants that speak MCP, such as Claude, ChatGPT or an MCP-capable IDE, can use it to check on your printers, look through the queue and the archive, and, if you let them, pause or stop a print.

The assistant signs in with a Bambuddy API key, and the key's permissions decide what it can do. There is no separate permission model to learn.


Turning it on

The endpoint is off by default. An administrator switches it on under Settings → API Keys → MCP server (AI assistants) → Enable MCP endpoint. While it is off, /mcp answers 404.

It also needs authentication to be on: the switch cannot be turned on without it, and /mcp answers 403 to every request if authentication is turned off later.

Once it is on, the card shows the address to give your assistant:

https://your-bambuddy-host/mcp

The transport is streamable HTTP. Bambuddy answers each request on its own (stateless, plain JSON responses), so it works behind reverse proxies and MCP gateways that do not keep sessions. Clients send POST; there is no server-to-client stream, so a GET on /mcp answers 405.

Authentication

Every request needs an API key, sent the same way as for the REST API:

Authorization: Bearer bb_xxxxxxxx

or

X-API-Key: bb_xxxxxxxx

A missing or invalid key gets 401. A browser session token is not accepted here: create a key for the assistant.

Browser origins

A request that carries an Origin header comes from a web page, and Bambuddy refuses it with 403 unless the origin is your Settings → Network → External URL. Without an External URL, every request with an Origin header is refused. MCP clients, gateways and proxies that call /mcp from a server or a desktop app send no Origin, so this does not affect them.

This is what the MCP specification asks of servers: it stops a web page you happen to open from reaching your Bambuddy through your browser (DNS rebinding).

Why authentication is required

With authentication off, the REST API treats every caller as trusted and returns secrets such as your printers' LAN access codes. Through MCP those would end up with the AI provider, so /mcp only works with authentication on.

Which key to create

Create a key just for the assistant, with only the permissions it needs, and limit it to some printers if you like. For example:

You want the assistant to... Tick
Answer questions about printers, prints, queue, archive, library Read Status
Add jobs to the queue, reorder or remove them, reprint an archive Read Status, Manage Queue
Pause, resume or stop a print, set temperatures, move axes Read Status, Control Printer

The key's printer list applies too: the assistant does not see printers outside it, and a call for one of them fails as if the printer did not exist.

Who should own the key

A key acts with its owner's permissions as well as its own, and the owner decides whether queued jobs wait for review. A key created by an administrator can queue jobs that start on their own.

For an assistant, create a separate user that is not an administrator and has neither Print Without Review (queue:start_unreviewed) nor Update All Queue (queue:update_all), then create the key while signed in as that user. Every job the assistant queues then waits in the queue until a person starts it, even if the key has Manage Queue.

Tools

The tools are generated from Bambuddy's REST API: one tool per route, named after the route (for example list_printers, get_printer_status, pause_print, add_to_queue). New routes show up as tools without any configuration.

Each call is sent to that route with the assistant's API key, so every check the route makes applies exactly as it does for any other API client. A key only sees the tools it can use: a key with Read Status alone sees the read tools, the queue ones (queue_overview, list_queue) included, but none that control a printer or change the queue.

A call that takes longer than two minutes is stopped and returns an error. If the route itself fails, the tool returns Internal server error and the details go to the Bambuddy log, as they do for the REST API.

Two extra tools give a compact picture, and are the best place for an assistant to start:

Tool Returns
printer_overview Every printer the key may see: connection, state, current job, progress, minutes left, layer, temperatures, HMS errors and loaded filament
queue_overview Queue counts by status and the items in dispatch order, with the printer or model each waits for and why it has not started (pending and printing by default)

What is not exposed

Some routes never become tools, whatever the key:

  • sign-in, users, groups, API keys and connected apps
  • signing in to or out of another service (Bambu Cloud, Orca Cloud, 3DFP), and any route that takes a password or token
  • administrator-only routes (API keys can never use them anyway)
  • the webhook endpoints and the SpoolBuddy and slicer device protocols
  • file uploads and live camera streams
  • routes that return a file: archive, library and printer file downloads, timelapses, photos and thumbnails, CSV and project exports, label PDFs
  • routes that hand out a token or a link: slicer and media download tokens, printer file download jobs, the Bambu Cloud token
  • the GET form of a route that changes something (the camera stop route also answers GET for browsers; only its POST is a tool)
  • backups, updates, support bundles and system administration

Annotations

Every tool carries MCP annotations, so a client can tell a status read from a print cancel and ask you before it does anything that matters:

Kind of route Annotation
GET (reads) readOnlyHint
Anything that starts, stops, pauses, heats, moves or sends files or G-code to a printer, queues a job or reprints destructiveHint, not idempotent
DELETE and PUT destructiveHint, idempotent
Creating something new, when the route neither reaches a printer nor changes rows that already exist not destructive
Other changes destructiveHint
Routes that talk to an outside service (Bambu Cloud, MakerWorld, Spoolman, Home Assistant, notification providers, ...) openWorldHint

How the client uses these hints is up to the client. Claude, for example, asks before calling a tool that is not read-only.

Connecting a client

Claude Code

claude mcp add --transport http bambuddy https://your-bambuddy-host/mcp \
  --header "Authorization: Bearer bb_xxxxxxxx"

Other clients

Any client that supports remote MCP servers over streamable HTTP with a custom header works: give it the URL above and the Authorization header. Clients that only support OAuth for remote servers need an MCP gateway or proxy in front that adds the header.

Troubleshooting

Symptom Cause
404 on /mcp The endpoint is not enabled in Settings
403 The MCP endpoint needs authentication to be enabled Authentication is off; turn it on (see Turning it on)
401 API key required No key was sent, or it was sent in a header Bambuddy does not read
401 Invalid API key The key is wrong, disabled or expired
403 Origin not allowed The request came from a web page whose origin is not your External URL (see Browser origins)
503 Bambuddy could not read its database; try again
A tool is missing The key lacks the permission that route needs, or the route is one that is not exposed
A call returns HTTP 404 The printer is outside the key's printer list, or does not exist
A call returns HTTP 403 The key's owner lacks the permission the route checks: a key acts with its owner's permissions as well as its own
A call returns Internal server error The route failed; the details are in the Bambuddy log