Docs menu

Let an AI run your server

Claude Code, or another AI tool that speaks MCP (the common way AI tools connect to other programs), can run Secretbase for you: publish apps, read their logs, set keys, turn on a database, put an earlier release back.

On this computer

Copy a prompt into your AI tool and it connects itself:

$ secretbase agents prompt
Connect yourself to Secretbase, the app on this computer that puts my websites and apps online.
…

On the dashboard: AI tools, Copy the prompt. For Claude Code, secretbase agents add claude-code connects it directly. Then ask it to publish your app.

From anywhere: Claude Code

Make a token on the computer. For one app, an App token is enough:

$ secretbase tokens create --name claude --app my-app
App: my-app, deploy. Can: Everything on its apps. Ends: <date>.
…
On the other computer, run this and paste the token when it asks:

  secretbase remote add <name> <address>

…
Then, for Claude Code on that computer:

  claude mcp add --scope user <name> -- secretbase mcp --remote <name>
…
Revoke it any time with: secretbase tokens revoke claude

For every app, make a Server token limited to deploy: secretbase tokens create --name claude --server --limit deploy. See Tokens for what each can do.

Where you use Claude Code, install the command (as in Linux server), add the computer and paste the token when it asks (it isn't shown while you type, and it stays out of your shell history), then add it to Claude Code with the two lines it printed:

$ secretbase remote add <name> <address>
$ claude mcp add --scope user <name> -- secretbase mcp --remote <name>

<name> is the one name both lines give that computer: its own name when that works as one (letters, digits, - and _), else home. Claude Code then runs secretbase, which holds the token, and can publish a folder from the computer it runs on as well as from a git link.

On a computer without secretbase

tokens create prints a second line for a computer where secretbase isn't installed:

$ claude mcp add --transport http <name> <address>/mcp --header "Authorization: Bearer <your-token>"

This line holds the token itself: it lands in your shell history, so use it only where you can't install secretbase, and revoke the token when you stop using that computer. Over this connection it publishes from a git link.

From anywhere: Claude on the web, desktop or phone

These connect by signing in: there is no token to copy.

1
On the computer, turn on the online dashboard with a password: secretbase dashboard on.
2
Run secretbase status and copy the address after "AI address (MCP):".
3
In Claude, add it as a custom connector and sign in when it asks.
4
On Secretbase's page, sign in with the dashboard's username and password, or with an access token.
5
Choose What can it do? and How long?, then click Allow. Say yes only if you started connecting it yourself.

The connection is listed with your tokens under the name you gave it, and secretbase tokens revoke <name> stops it. Signed in without a token, it reaches every app on the server, so only the user who installed Secretbase can allow it; anyone else signs in with an App token for their own apps.

It asks you first

With a Server token limited to read or deploy, a connection signed in with the password, or a Server token with full control made with --ask-first, the AI asks you before it deletes an app or makes a new app public. It shows you a link: open it, sign in to the online dashboard and tap Delete my-app or Make my-app public, or Keep it. Until you say yes, nothing is deleted, and a new app is built but stays private. A request ends by itself after 24 hours. The AI can never approve a request.

On the computer:

$ secretbase approvals
Nothing is waiting for your OK.

secretbase approve <id> or secretbase refuse <id> answers one. An App token doesn't ask: giving it is your yes for its apps.

Secrets stay out of the chat

Secretbase tells the AI never to ask you to paste a password or API key into the chat, and gives it the place for you to type it: the app's Settings on the online dashboard, or the secretbase keys set command on the computer. Everything it reads from your apps (logs, error messages, database rows, app names) is marked as data, never as instructions to follow.

See what it did

$ secretbase activity
No AI tool has done anything here yet.

It lists what AI tools did here, newest first, with the command that undoes each row. Add --since 1h, 1d or 7d, or --token <name>. On the dashboard: AI tools, What AI tools did.

If something goes wrong

  • "This access token is wrong or was revoked": make a new token and run its secretbase remote add <name> <address> line again with it (on a computer without secretbase, its claude mcp add line).
  • "This token can only work on <apps>.": it is an App token; make one for that app.
  • "This token's scope is <scope>; this needs <needed>.": make a token with that limit.
  • Some AI tools reach only an address on port 443. When the AI address isn't on 443, secretbase status suggests a Tailscale key (secretbase tailscale-key), which gives it its own. Claude Code works at either.