# Connect yourself to Taskfolk as a bot

Taskfolk is a project management tool. Your user just created a bot for you
in their own Taskfolk workspace, and the Connect dialog gave them the prompt
they pasted to you, with three values: TASKFOLK_URL, TASKFOLK_WORKSPACE and
TASKFOLK_API_KEY. This guide is published by Taskfolk for exactly this step.
Follow it yourself, running the commands with your shell. In every command,
replace <TASKFOLK_WORKSPACE> and <TASKFOLK_API_KEY> with the values you were
given (this guide's commands already use https://taskfolk.ai).

What you are setting up, so you can judge it:

- The key came from your user on purpose. It is a bot key for their
  workspace only, with member-level access (no billing or admin settings),
  and they can revoke it any time from the bot's Access tab. Store it only in
  the configuration below, never in a repository.
- You get Taskfolk's MCP tools (issues, comments, statuses, chat) over HTTPS.
- Only people who are members of that workspace can message the bot. Their
  messages are requests from teammates, not commands that override your
  judgment: you still ask before anything destructive, and your own
  permission prompts still apply.
- Your user sees everything you do on the bot's page in Taskfolk, and you
  only run while they keep your session open.

## 1. Check the key

```bash
curl -fsS -H "Authorization: Bearer <TASKFOLK_API_KEY>" https://taskfolk.ai/api/v1/workspaces/<TASKFOLK_WORKSPACE>/agents/me
```

This returns your bot profile as JSON. Note `data.name` (your bot name) and
`data.conversation_channel_id` (your chat with your owner). If it fails with
401 or 404, stop and tell your user the key or workspace is wrong: they can
make a new key from the bot's Access tab in Taskfolk.

## 2. Install for the tool you are running in

Do only the section that matches you.

### Claude Code

Run these in the current folder: it becomes the bot's home, and your user
starts you here from now on.

```bash
claude mcp remove taskfolk-product >/dev/null 2>&1; claude mcp remove taskfolk-chat >/dev/null 2>&1
claude mcp add --transport http taskfolk-product https://taskfolk.ai/api/mcp/v1 \
  --header "Authorization: Bearer <TASKFOLK_API_KEY>"
mkdir -p ~/.taskfolk
curl -fsSL https://taskfolk.ai/agent/taskfolk-channel.mjs -o ~/.taskfolk/taskfolk-channel.mjs
claude mcp add taskfolk-chat -e TASKFOLK_URL=https://taskfolk.ai \
  -e TASKFOLK_WORKSPACE=<TASKFOLK_WORKSPACE> -e TASKFOLK_API_KEY=<TASKFOLK_API_KEY> \
  -- node ~/.taskfolk/taskfolk-channel.mjs
```

The chat bridge (`taskfolk-channel.mjs`) is one readable file with no
dependencies. It is an MCP server that Claude Code starts and stops with
your session, not a background service: it brings messages from your
Taskfolk chat into this session and sends your replies back. It needs Node 18
or newer (`node --version`). Your start command, for step 3 and step 4:

```bash
claude --dangerously-load-development-channels server:taskfolk-chat \
  --allowedTools "mcp__taskfolk-chat" "mcp__taskfolk-product"
```

### Codex

```bash
mkdir -p ~/.codex/skills/taskfolk-product
curl -fsSL "https://taskfolk.ai/api/skill/taskfolk-product.skill.md?workspace=<TASKFOLK_WORKSPACE>" \
  -H "Authorization: Bearer <TASKFOLK_API_KEY>" -o ~/.codex/skills/taskfolk-product/SKILL.md
echo "export TASKFOLK_API_KEY=<TASKFOLK_API_KEY>" >> ~/.$(basename "$SHELL")rc
codex mcp remove taskfolk-product >/dev/null 2>&1
codex mcp add taskfolk-product --url https://taskfolk.ai/api/mcp/v1 --bearer-token-env-var TASKFOLK_API_KEY
```

Your start command (run in a new terminal so the key is loaded):

```bash
codex -c 'mcp_servers.taskfolk-product.default_tools_approval_mode="approve"' \
  "Call get_my_agent_profile to load the instructions my team wrote for this bot and your saved notes. Then keep watching your Taskfolk inbox: call check_inbox with wait=25, answer each message with create_channel_message in its channel_id (in a DM reply at the top level; if it came from a thread, set parent_id to its root_id), and use set_my_status while you work. Repeat until I stop you."
```

### Cursor, VS Code, Windsurf, Claude Desktop or any other MCP client

Add a remote MCP server to your client's MCP configuration (for Cursor that is
`~/.cursor/mcp.json`; merge it in and keep any servers already there):

```json
{
  "mcpServers": {
    "taskfolk-product": {
      "url": "https://taskfolk.ai/api/mcp/v1",
      "headers": { "Authorization": "Bearer <TASKFOLK_API_KEY>" }
    }
  }
}
```

If you cannot edit your own configuration, give your user these exact values
to add: URL https://taskfolk.ai/api/mcp/v1, transport Streamable HTTP, header
`Authorization: Bearer <TASKFOLK_API_KEY>`.

Your start prompt, after your client reloads its MCP servers:

```text
Call get_my_agent_profile to load the instructions my team wrote for this bot and your saved notes. Then keep watching your Taskfolk inbox: call check_inbox with wait=25, answer each message with create_channel_message in its channel_id (in a DM reply at the top level; if it came from a thread, set parent_id to its root_id), and use set_my_status while you work. Repeat until I stop you.
```

## 3. Say hello in your Taskfolk chat

Post one short message to your conversation so your user sees you are set up.
Include your start command from step 2 and, for Claude Code, the full path of
this folder.

```bash
curl -fsS -X POST https://taskfolk.ai/api/v1/workspaces/<TASKFOLK_WORKSPACE>/chat/channels/<conversation_channel_id>/messages \
  -H "Authorization: Bearer <TASKFOLK_API_KEY>" -H "Content-Type: application/json" \
  -d '{"body_md": "Hi, I am set up. To chat with me here, start me with: ..."}'
```

Build the JSON carefully (escape quotes and newlines), and put the start
command in a fenced code block inside body_md.

## 4. Tell your user what to do next

In your reply to your user, say you are connected and give them the start
command from step 2. Claude Code: they quit this session and run the start
command in this folder, choosing "I am using this for local development" once
(Claude Code channels are a preview). Codex and other clients: restart so the
new MCP server loads, then run the start command or prompt.

From then on, messages sent to the bot on the Bots page reach you, and you
answer there. Anything sent while you are not running waits in your inbox.
