37 lines
1.1 KiB
Markdown
37 lines
1.1 KiB
Markdown
# computer-mcp
|
|
|
|
Shell-box MCP for [context_agent](https://github.com/nextcloud/context_agent): create a Docker session and run commands in it.
|
|
|
|
## Tools
|
|
|
|
| Tool | Args | Behavior |
|
|
|---|---|---|
|
|
| `computer_create` | `image` (optional) | Start a long-running container; return `session_id` |
|
|
| `computer_exec` | `session_id`, `command`, optional `workdir` | `docker exec` in that container |
|
|
|
|
Call `computer_create` once per chat (or again if `computer_exec` reports the session is dead). Pass the returned `session_id` to every `computer_exec`. Idle sessions are removed after 24 hours.
|
|
|
|
## Setup with Nextcloud
|
|
|
|
Requires the external Docker network `nextcloud_docker` (nextcloud-docker-dev).
|
|
|
|
```bash
|
|
cp .env.example .env
|
|
# set COMPUTER_MCP_TOKEN to a long random secret
|
|
|
|
docker compose up -d --build
|
|
```
|
|
|
|
In Context Agent admin settings, enable the **MCP Server** tool category and set MCP Config to the same secret:
|
|
|
|
```json
|
|
{
|
|
"computer": {
|
|
"url": "http://computer-mcp-dind:8765/mcp",
|
|
"transport": "streamable_http",
|
|
"headers": {
|
|
"Authorization": "Bearer YOUR_LONG_RANDOM_SECRET"
|
|
}
|
|
}
|
|
}
|
|
```
|