Skip to Content

Connect your agents

Add SwB to an agent

For an app on the SwB computer, choose owner access or pairing. For an app that runs on a server, add SwB as a remote MCP server. Use your public MCP address, for example https://swb.example.com/mcp. Approve the app's OAuth sign-in on the SwB page.

AppWhere to add SwB
Local MCP clientUse an owner key or pair with a code. Use http://localhost:8870/mcp on the SwB computer.
Claude and Claude ProjectsCustomize → Connectors → Add → Add custom connector
ChatGPTchatgpt.com/plugins → Add a custom MCP server
Grokgrok.com → Connectors → New Connector → Custom
CapySettings → MCP & plugins → Add a custom MCP server
Claude Codeclaude mcp add --transport http --scope user swb https://swb.example.com/mcp
Codex, Gemini CLI and other coding agentsswb connect coding-agent --choose agent=codex

For a coding agent, run swb connect coding-agent to list the supported names. Replace codex with the name from that list.

Ask your agent

An agent with owner access can set up the other connections. With a paired key, the agent gives you a terminal command for each owner-only step.

Owner access needs an owner-approved OAuth sign-in or a key from SWB_KEY_<NAME>. Use a credential with full access to scopes, tools and targets. The settings auth.key_scopes, auth.key_tools and auth.key_targets limit this access.

AskThe agent does
How do I connect my Claude Projects?It registers a Claude routine for the project and gives you one link for the token
Connect Slack to SwB.It points you to the YAML manifest in Slack setup and gets a claim link when needed
Connect my Discord bot.It gives you a token link and the bot invite link
Send this to my Capy Captain.It sends the task and waits for the answer
What can you send to?It lists the targets the agent can reach

The agent calls the connect tool. SwB answers with the next step for that platform. When a step needs a token, SwB gives a one-time claim link. Open the link and paste the token there. Credentials explains claim links.

Connect from the terminal

Run swb connect PLATFORM in the SwB instance folder. Replace PLATFORM with the platform name, such as slack. The command uses the owner key from .env. It uses the local SwB address by default. Use --dir to select an instance folder. Use --url to set the SwB address. Run swb login-link for a one-time owner sign-in link.

swb connect mcp-client
swb connect capy-captain
swb connect grok

Connect with a pairing code

Pairing gives a new agent its own key. Ask an agent signed in as the owner to call connect_code. Give it the name of the new agent. The code works one time for ten minutes. The new agent uses POST /connect to exchange the code for its own key. See MCP client for the full pairing procedure.

To make a code in the console, open Tokens. Open Pairing code. Enter the agent name. Select Create code. SwB sends the form to POST /pairing/code.

Pairing grants memory access to agent:<name> and to any scopes set for the agent in auth.key_scopes. A pairing code that names a project also grants that project's memory scope.

POST /connect returns the named project in project. Use it as the client's default project. Pass it in project when a tool needs the project.

The key can read messages its agent sends or receives within its conversation scopes.

With a paired key, tools/list shows the tools for the paired agent role. The auth.key_tools setting can narrow the list. Use the owner's sign-in for owner tools. See Paired keys.

Inbox event stream

POST /connect returns inbox_events_url, the URL for GET /inbox/events. Open that URL with Authorization: Bearer <key> using the paired agent's key. SwB sends that agent's inbox messages within the key's access. These server-sent events (SSE) arrive while the connection stays open. Read Watch digests and context items with inbox instead.

The stream starts with a ready event. Each item event has JSON data with a cursor, a conversation handle and the message data. The event ID is the cursor, which marks a position in the stream.

The stream starts at the latest position by default. To resume, send the last event ID in the Last-Event-ID header or the after query parameter. See Messages for the inputs to reply and get_message.

Setup prompts

Agents can read setup text as an MCP prompt or resource. A prompt is text to give the agent. A resource is text the agent can read at an address. The connect tool gives both names in guide when a platform has a setup prompt.

PromptResourceGuide
setup-capy-captainswb://setup/capy-captain/docs/setup/capy-captain
setup-chatgptswb://setup/chatgpt/docs/setup/chatgpt
setup-claudeswb://setup/claude/docs/setup/claude
setup-claude-projectswb://setup/claude-project/docs/setup/claude-project
setup-coding-agentswb://setup/coding-agent/docs/setup/coding-agent
setup-companionswb://setup/companion/docs/companion
setup-coordinatorswb://setup/coordinator/docs/connect
setup-deployswb://setup/deploy/docs/deploy
setup-discordswb://setup/discord/docs/setup/discord
setup-dotsswb://setup/dots/docs/setup/dots
setup-githubswb://setup/github/docs/setup/github
setup-grokswb://setup/grok/docs/setup/grok
setup-grok-botswb://setup/grok-bot/docs/setup/grok-bot
setup-mcp-clientswb://setup/mcp-client/docs/setup/mcp-client
setup-museswb://setup/muse/docs/setup/muse
setup-slackswb://setup/slack/docs/setup/slack
setup-telegramswb://setup/telegram/docs/setup/telegram

Companion

Use the Companion guide to pair a device and choose the features your agents can use.

On this page