Connect Claude to a workspace
This guide connects Claude Code on the web to a project that has a SWARQ workspace. When it is set up, Claude can read the board and find the next ready task. Under the shipped policy it can also update a task or assign one to an agent slot. The connection is a local stdio MCP server, swarq mcp, which the swarq-pm plugin starts for the session.
Status: this guide is written from the source in packages/mcp/src. The real Claude Code on the web session test (connector task 5) has not been run, so the plugin install steps are not yet confirmed in a web session. The claude.ai connector is in progress and does not work yet. The Claude Code plugin is the working path today. See Hosted connector (claude.ai) and Not available yet.
1. Prerequisites
| Need | Why |
|---|---|
A project repository with .swarq/, made by swarq init-workspace. Steps 1 and 2 of Set up a new workspace create it. |
The server serves one workspace. It finds the workspace by looking for .swarq/board.json. |
.swarq/ committed and pushed to that repository |
Claude Code on the web works in a clone of the repository, so the server reads the workspace from the clone. |
Node.js 22 or later, with npx |
The plugin starts the server with npx -y @h4shed/swarq mcp. |
Access to registry.npmjs.org |
npx downloads @h4shed/swarq from npm. This repository’s .claude/network-allowlist.txt lists the same host. |
The tools need
@h4shed/swarq0.3.0 or later. 0.3.0 is published (2026-10-19) and is the first version with theswarq_tools. 0.2.0 and earlier serve no tools.npxwithout a version gets the latest published version, so the plugin picks up 0.3.0 or later. See Troubleshooting if the tools are missing.
2. Install the swarq-pm plugin
In Claude Code, run:
/plugin marketplace add Fused-Gaming/swarq/plugin install swarq-pm@fused-gaming-swarqThese are the same commands as step 8 of Set up a new workspace. The plugin’s .mcp.json starts the swarq server, so you do not run swarq mcp yourself. The .mcp.json also sets SWARQ_MCP_POLICY to the shipped policy described in Write policy.
The plugin install has not been tested in Claude Code on the web yet.
3. Check the connection
In a Claude Code on the web session on the repository, ask Claude to call swarq_workspace_status. A bound workspace reports "initialized": true and "healthy": true, with the board name, the agent slots and the task counts.
If the answer lists only swarq_workspace_status, no workspace was found. See Troubleshooting.
4. How the server finds the workspace
The server is swarq mcp from the @h4shed/swarq package. It runs over stdio as a child process of Claude Code and serves one workspace. It takes the workspace from the first source below that applies:
| Order | Source | Behavior |
|---|---|---|
| 1 | SWARQ_WORKSPACE environment variable |
Used when it is set and not empty. If that path has no .swarq/board.json, the server does not look further. |
| 2 | --dir <path> on swarq mcp |
Used when SWARQ_WORKSPACE is not set. The path is not searched upward. |
| 3 | Nearest ancestor of the starting directory that has .swarq/board.json |
The server walks up from the directory it starts in. |
The plugin’s config passes neither SWARQ_WORKSPACE nor --dir, so the plugin uses source 3. Which directory Claude Code starts the server in is not verified for Claude Code on the web.
The workspace is found once, when the server starts. The read tools load the board files on every call, so a change in .swarq/ shows up without a restart. If you create .swarq/ after the server starts, restart the server.
The server refuses symbolic links in .swarq/: the folder itself, board.json, the tasks/ folder, and each task file. It does not read or write through them.
5. Tools
When no workspace is found, the server lists only swarq_workspace_status, and that tool gives the swarq init-workspace command. When a workspace is found, the server lists all seven tools below. Write tools are listed even when the policy denies them.
Read tools
Read tools do not go through the permission gate, and they are not audited.
| Tool | Input | Returns |
|---|---|---|
swarq_workspace_status |
none | Whether the workspace is bound and readable, the board name, the schema version, the agent slots, and task counts by status. |
swarq_board_show |
none | The board as Markdown, grouped by status. |
swarq_board_next |
limit, 1 to 50, default 5 |
Ready tasks in the order to start: id, title, priority, epic, tags and dependencies. |
swarq_task_get |
id |
The full task. |
swarq_board_next does not run the sync check that swarq board next runs. On a board that syncs to GitHub, it can list a task that the CLI would hold back until main is synced.
Write tools
Every write goes through the permission gate. Each attempt is audited.
| Tool | Input | What it does |
|---|---|---|
swarq_task_update |
id; status (todo, done or blocked); optional owner; optional note |
Sets the status. Releasing a task clears its owner. If owner is given, it must match the agent that holds the task. |
swarq_board_assign |
id; optional agent (a slot id); optional checkInMinutes (1 to 1440) |
Gives a ready task to a free agent slot. A ready task is todo, unassigned, and has every dependency done. Without agent, the board picks the slot. |
swarq_board_plan |
tasks; optional milestones |
Adds or updates tasks from a plan, in the same shape as swarq board plan --file. The shipped policy denies it. |
6. Write policy
A write call gets one of three decisions: allow, ask or deny. The server reads the policy from SWARQ_MCP_POLICY once, when it starts.
- A tool’s own entry in
toolsdecides first. If there is none,defaultdecides. - Over stdio there is no approver, so
askis blocked. With no policy at all, every write is blocked withAPPROVAL_REQUIRED. - When the server starts, only the decision values are checked. A misspelled tool name is not an error. It falls through to
default.
The shipped policy is the value the plugin sets. It is JSON.stringify(SHIPPED_WORKSPACE_POLICY) from packages/mcp/src/permissions.ts:
{"default":"deny","tools":{"swarq_task_update":"allow","swarq_board_assign":"allow","swarq_board_plan":"deny"}}It allows task updates and assignment, denies swarq_board_plan, and denies any other write tool.
To make the policy stricter, set SWARQ_MCP_POLICY to a read-only policy, which denies every write:
{"default":"deny"}The variable must reach the server process, so set it in the server’s env. A policy change takes effect when the server restarts. How to override the plugin’s env in Claude Code on the web is not verified yet.
7. What is refused, and why
A refused call returns a tool error whose text starts with a code:
| Code | Meaning |
|---|---|
PERMISSION_DENIED |
The policy denies the tool. |
APPROVAL_REQUIRED |
The policy says ask, and there is no approver. |
INPUT_REFUSED |
The tool’s own input check refused the call. Nothing ran. |
AUDIT_FAILED |
The audit line could not be written, so the write did not run. |
HANDLER_ERROR |
The tool ran and failed. The message says why, for example a board rule. |
The input checks refuse these:
| Refused | Why |
|---|---|
A task id or path that names a credential file: .pat, .token, .netrc, .env*, .pem, .key, .p12, .pfx, .ppk, id_rsa, id_dsa, id_ecdsa, id_ed25519, or anything under a .secrets folder. |
The board does not hold credentials, and a task id becomes a file name. |
A task id that is not 1 to 64 letters, digits, dots, dashes or underscores, starting with a letter or digit. A path with .., an absolute path, or a backslash. A path through a symbolic link. |
Writes stay inside .swarq/. |
Credential-shaped text in the input of a write, in a key or a value: a GitHub token (ghp_, gho_, ghu_, ghs_ or ghr_ followed by 36 or more letters and digits), a github_pat_ token, or a private key header. |
Task text is saved to the board and committed. The error names the pattern only and never echoes the text. The check covers the input of a write, not the files already there. These are the same patterns swarq check-secrets uses. |
swarq_board_assign on a board whose board.json has a github section. |
The board syncs to GitHub, so the sync must run first. Use swarq board assign, which checks it. Only swarq_board_assign makes this check. |
swarq_board_plan, under the shipped policy. |
A plan adds many tasks at once, and over stdio there is no approver to ask first. The maintainer decided on 2026-10-19 that it stays denied. |
Any write when .swarq/ is missing. |
The tools never create a workspace. swarq init-workspace is a CLI step. |
8. Audit log
Each write attempt writes one line to stderr, beginning with audit . Reads are not audited over stdio. This is the shape of a line. The values here are an example, not captured output:
audit {"tool":"swarq_task_update","inputSummary":"object(keys: id, status)","timestamp":"2026-10-19T09:00:00.000Z","decision":"allow","outcome":"executed"}outcomeisexecutedbefore the tool runs. If the tool then returns an error, afailedline follows.blockedmeans the policy, the input check, or the missing approval stopped the call.inputSummarynames the keys the tool declares, and never their values. Undeclared keys are counted, not printed.- Whether Claude Code on the web shows this stderr, and where, is not verified.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Only swarq_workspace_status is listed |
No .swarq/board.json in the starting directory or its ancestors, or SWARQ_WORKSPACE points at a folder without one |
Run swarq init-workspace in the repository root, commit .swarq/, and restart the server. The status message names the path it searched. |
The server does not start: SWARQ_MCP_POLICY is not valid JSON. |
The value is not JSON, often because the quotes in .mcp.json are not escaped |
Use the exact string from Write policy. In .mcp.json, escape the inner quotes. |
The server does not start: SWARQ_MCP_POLICY is invalid: ... must be allow, ask or deny. |
A decision has another value, such as Deny or read-only |
Use allow, ask or deny, in lower case. |
Every write returns APPROVAL_REQUIRED: “no approver is configured” |
SWARQ_MCP_POLICY is not set |
Set it to the shipped policy from Write policy. |
A write returns PERMISSION_DENIED |
The policy denies that tool, for example swarq_board_plan, or the policy is read-only |
This is expected. To add tasks, use swarq board plan --file in a checkout, and review the result. |
INPUT_REFUSED: “matches the … credential pattern” |
The input contains a credential-shaped string | Remove the value. If it was a real credential, rotate it. The text is not shown. |
INPUT_REFUSED: “has a credential name” or “id must be 1 to 64 …” |
The task id is not a safe file name | Use a plain id such as gh-12. |
swarq_workspace_status shows "healthy": false with “symbolic link” |
A file or folder under .swarq/ is a symbolic link |
Replace the link with a real file or folder. |
A write returns HANDLER_ERROR with a board rule, such as “is held by” or “is not ready” |
The board rules refused the change | Read the task with swarq_task_get, then pick the owner or the next ready task that the message names. |
npx cannot download the package |
registry.npmjs.org is not reachable from the session |
Allow the host in the environment’s network settings. |
Hosted connector (claude.ai)
The hosted connector for claude.ai is in progress. It is not available yet, so there is no connector URL to add in claude.ai settings for a SWARQ workspace today. The sign-in endpoints and the repository-choice step are live. No board tools are registered yet, so the connector lists no tools.
Once the connector is ready, you will:
- Add the connector in claude.ai settings, using the connector URL
https://swarq.vln.gg/mcp. - Sign in with GitHub when claude.ai opens the sign-in page.
- Pick the one repository that holds your workspace. The server refuses any other repository.
- Use the SWARQ tools from claude.ai against that repository: the workspace status, the read tools, and task updates. A write that the policy denies changes nothing.
The Claude Code plugin is the working path today. Follow section 2 of this guide. If you added the connector in claude.ai before this, remove that entry, because it cannot connect.
Not available yet
None of the following is working. There is no URL to add in Claude settings.
- A claude.ai connector. The hosted server has Streamable HTTP and the OAuth sign-in endpoints in code, but the consent step and the board tools are not merged. The workspace-as-repository store and hosting are still open. See Hosted connector (claude.ai). The plan is in the hosted connector plan.
- Writes or reads from the hosted connector. The same is true. It also does not audit read calls yet.
- Creating a workspace from Claude. Not planned.
swarq init-workspacestays a CLI step. - Claude Desktop. Not a target, by the maintainer’s decision on 2026-10-18.