# Use Claude Code on your servers

Set up Claude Code with Valakes in one command. It runs commands on the servers you allow, changes wait for your approval, and it never sees a password.

Source: https://valakes.com/agents/claude-code/

Last updated: 2026-11-24

Connect Claude Code to Valakes, and it can open sessions and run commands on the servers you choose. It never sees a password, and a change you have not allowed waits for you.

## What Claude Code gets

Connecting Claude Code gives it the Valakes tools as an MCP server named `valakes`. From a conversation it can list the hosts you opened to it, open SSH sessions, run commands and read their output. Each session it opens appears in Valakes as a tab marked with the agent's name, so you watch the work as it happens.

Claude Code also receives a guide from Valakes by itself: how to use the tools, how to write the credential placeholder, and what each error code means. There are no instructions to paste into a prompt.

## Set it up

Setup is one command in a terminal. The command registers the bridge program, `valakes-mcp`, with Claude Code and passes it the agent's handle, a short name that is not a secret. It never contains the token: the bridge reads the token from its own file, which only your user account can read.

1. Open Settings, Agent API, and turn on "Let agents use Valakes through a local server on this computer". Valakes asks you to confirm.

2. In the Agents panel press Connect an agent, choose Claude Code, and give the agent a name you will recognise, such as "Claude Code on laptop".

3. Run the command the wizard shows. It has this shape, with your own agent handle in place of `k3m9q2xa`:

   ```
   # Windows (PowerShell)
   claude mcp add valakes --scope user --env VALAKES_AGENT=k3m9q2xa -- "C:\Program Files\Valakes\resources\bin\valakes-mcp.exe"
   
   # macOS
   claude mcp add valakes --scope user --env VALAKES_AGENT=k3m9q2xa -- "/Applications/Valakes.app/Contents/Resources/bin/valakes-mcp"
   ```

4. Press Test connection in the wizard, then start Claude Code. The wizard shows when Valakes saw its first call and which tool it called.

The connection wizard in Valakes shows this setup, with your own paths and handle.

The same entry can go into `.mcp.json` instead: under `mcpServers`, a server named `valakes` whose `command` is the path of the bridge and whose `env` holds `VALAKES_AGENT` with your handle. The bridge is one program and needs no Node.js on your machine.

## Check that it works

Run `claude mcp list` in a terminal; it should list `valakes` as connected. Then ask Claude Code to call `list_hosts`. You should see the hosts you opened to agents, and only those: a host still set to Off is missing on purpose. The wizard's Test connection shows the same first call from Valakes' side.

```sh
claude mcp list
```

If the bridge prints one line and exits, that line says why. "Valakes is not running" means you start the app and turn the API on, or press Unlock and start in the Agents panel. "The server could not prove itself" means the program on the port did not know your token: restart Valakes, and rotate the agent's token if it persists.

## What it can and cannot do

Claude Code acts only through the Valakes tools, so what it can do is what those tools allow on each host. No tool hands out a secret or changes a rule. The two lists hold on every host; what runs without asking depends on the agent access level you gave that host.

### It can

- List the hosts you opened to agents
- Open SSH sessions, each shown as a tab with its name
- Run commands and read their output
- Read the screen of a full-screen program and send keys
- Use a saved password by writing `{{cred:name}}`
- Move files inside its workspace folder, with your approval

### It cannot

- Read a password, a key or a token
- Approve its own request or change a policy
- Read the audit log
- Accept a host key it has not seen before
- See a host whose agent access is Off

## Host policy and approvals

Every host starts at Off, so Claude Code sees nothing until you open a host to it in the host editor. On Approve writes its read commands run at once, while every other command waits on a card with the exact command, the host and the directory. You approve it, deny it, or take it over and run it yourself.

## Documentation

[Read the docs: Claude Code](https://docs.valakes.com/agents/claude-code/)

## Read next

- [AI agents work under your rules](https://valakes.com/features/ai-agents/): Valakes has a local API that lets an AI agent such as Claude Code or Codex open sessions and run commands on the hosts you allow. The agent never sees a password, and changes wait for your approval.
- [Dangerous commands wait for you](https://valakes.com/features/command-check/): The command check reads each command you type before it runs. A dangerous one stops on a card that says why, and it runs only when you choose.
