Docs
Connect an agent to nwtcode
Any AI tool that can use MCP or call HTTP can hand coding work to your PC. Make a key, paste one prompt, and your agent can start tasks in your projects.
How it works
- Make a key. In nwtcode open Settings, then Agent connections. Type the agent's name (for example Codex) and press Make connection.
- Paste the prompt. nwtcode shows a setup prompt with your address and the new key, once. Press Copy setup prompt and paste it into your agent. Or use the command for your agent below.
- Ask for work. Tell your agent: "Use nwtcode to fix the failing tests in my shop project." It lists your projects, starts a task and waits for the result. You can watch the chat live on your PC or phone.
Needs: nwtcode running and signed in on the PC, and the project switched on for phone access (a connection only reaches those). If the PC is off or asleep, the agent gets "This PC is offline".
The setup prompt
The app fills this in for you. This is the template, in case you want to write it yourself. The addresses are shown in the Agent connections window.
Connect to my nwtcode coding agent, which runs on my own PC and works inside my projects.
Add an MCP server named "nwtcode" (remote, streamable HTTP):
URL: <YOUR_MCP_ADDRESS>
Header: Authorization: Bearer <YOUR_KEY>
Then call the list_projects tool to check that it works. After that, when I ask you to code something on my PC, call start_task with a clear prompt (and the project name), call get_task with wait_seconds 20 until the state is done, failed or cancelled, and tell me the result.
If you cannot add MCP servers, use plain HTTP with the same header instead:
POST <YOUR_HTTP_ADDRESS>/tasks {"project": "<name>", "prompt": "<what to do>"} -> {"runId": ...}
GET <YOUR_HTTP_ADDRESS>/tasks/<runId>?wait=20
GET <YOUR_HTTP_ADDRESS>/projects
Keep the key secret: it lets whoever holds it change files in my projects.Commands for popular agents
Replace the address and the key with the ones from the app. Agents change their commands often: if one fails, the prompt above works with any agent that can edit its own MCP settings, and each agent's own docs are the final word.
Codex
# PowerShell: keep the key in an environment variable, not in a file $env:NWTCODE_KEY = "<YOUR_KEY>" codex mcp add nwtcode --url <YOUR_MCP_ADDRESS> --bearer-token-env-var NWTCODE_KEY
Or in ~/.codex/config.toml, with NWTCODE_KEY set in your environment:
[mcp_servers.nwtcode] url = "<YOUR_MCP_ADDRESS>" bearer_token_env_var = "NWTCODE_KEY"
OpenClaw
openclaw mcp add nwtcode --url <YOUR_MCP_ADDRESS> --transport streamable-http openclaw mcp status --verbose
OpenClaw takes the key as a static header in the server's entry in its config (mcp.servers.nwtcode): add Authorization: Bearer <YOUR_KEY> there, following OpenClaw's configuration reference.
Claude Code
For a Claude Code on another machine (or in automation) that should hand work to this PC:
claude mcp add --transport http nwtcode <YOUR_MCP_ADDRESS> --header "Authorization: Bearer <YOUR_KEY>" claude mcp get nwtcode
Other MCP clients
Most clients that read a JSON config use these fields. The file's name and the exact key names differ by client; the address and the header are what matter.
{
"mcpServers": {
"nwtcode": {
"url": "<YOUR_MCP_ADDRESS>",
"headers": {
"Authorization": "Bearer <YOUR_KEY>"
}
}
}
}Paperclip
Paperclip has a built-in Connect. In nwtcode open Settings, then PCs and Paperclip, enter your Paperclip address and press Connect. Approve in the browser, and this PC gets its own agent: assign an issue to it and the work runs here. No key to copy.
Any service, over plain HTTP
# list the projects this key may work in
curl -H "Authorization: Bearer <YOUR_KEY>" <YOUR_HTTP_ADDRESS>/projects
# start a task; the answer holds a runId
curl -X POST -H "Authorization: Bearer <YOUR_KEY>" -H "Content-Type: application/json" \
-d '{"project":"shop","prompt":"Fix the failing checkout test"}' <YOUR_HTTP_ADDRESS>/tasks
# wait up to 20 s for it to finish, then read the result
curl -H "Authorization: Bearer <YOUR_KEY>" "<YOUR_HTTP_ADDRESS>/tasks/<runId>?wait=20"
# stop it
curl -X POST -H "Authorization: Bearer <YOUR_KEY>" <YOUR_HTTP_ADDRESS>/tasks/<runId>/cancelThe tools your agent gets
| Tool | What it does |
|---|---|
list_projects | The projects this connection may work in, and the default. |
start_task | Starts a task: prompt, optional project, optional thread (tasks with the same thread continue one conversation). Returns a run id at once. |
get_task | State (running, waiting, done, failed, cancelled), the final text, the cost and any error. wait_seconds (at most 20) waits for a change. |
cancel_task | Stops a running task. |
list_tasks | The latest tasks started through connections. |
Safety
- A key lets its holder run tasks in your phone-enabled projects in Auto mode: Claude edits files there without asking each time. Treat it like a password.
- One key per agent. Remove it in Agent connections and it stops working at once.
- A key is shown once and kept only as a hash on your PC. The online service passes requests through and cannot use a key.
- Projects that are not switched on for phone access cannot be reached by any connection.
- Too many wrong keys in a minute are refused for a minute.
If it does not work
| You see | Why, and what to do |
|---|---|
401 "A valid connection key is required" | The key is wrong, was removed, or the header is missing. Make a new connection. |
503 "This PC is offline" | nwtcode is not running, the PC is asleep, or it is signed out. Open nwtcode on the PC. |
| "No project named …" | The project is not switched on for phone access, or the name differs. Call list_projects and use a name from it. |
State waiting | Claude asked for something even Auto mode does not allow. Open the chat on your PC or phone and answer. |
429 | Too many wrong keys in a minute. Wait a minute. |