Skip to content

Commit f02f06a

Browse files
committed
ai: document lsp toolset and auto-installation
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
1 parent 3b0f129 commit f02f06a

1 file changed

Lines changed: 125 additions & 0 deletions

File tree

content/manuals/ai/docker-agent/reference/toolsets.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,52 @@ Useful for tools that return large JSON responses (API results, file listings,
161161
search results). The compression is transparent to the agent but can
162162
significantly reduce context consumption for verbose tool outputs.
163163

164+
### Auto-installation of tool binaries
165+
166+
MCP and LSP toolsets that require a binary command can be auto-installed if the
167+
command isn't on your system. Docker Agent uses the
168+
[aqua registry](https://github.com/aquaproj/aqua-registry), a curated index of
169+
CLI tool packages, to resolve and download binaries.
170+
171+
When a toolset with a `command` property is loaded, Docker Agent:
172+
173+
1. Checks if the command exists in your `PATH`.
174+
2. Checks the Docker Agent tools directory (`~/.cagent/tools/bin/`).
175+
3. If still not found, looks up the command in the aqua registry and installs it.
176+
177+
Installed binaries are stored under `~/.cagent/tools/`. You can override this
178+
location with the `DOCKER_AGENT_TOOLS_DIR` environment variable.
179+
180+
Use the `version` property to pin a specific package and version:
181+
182+
```yaml
183+
toolsets:
184+
- type: lsp
185+
command: gopls
186+
version: "golang/tools@v0.21.0"
187+
file_types: [".go"]
188+
189+
- type: mcp
190+
command: some-mcp-server
191+
version: "owner/repo@v1.2.3"
192+
```
193+
194+
The format is `owner/repo` or `owner/repo@version`. Without a version tag,
195+
Docker Agent uses the latest release. Without the `version` property entirely,
196+
Docker Agent tries to auto-detect the package from the command name.
197+
198+
To disable auto-installation for a single toolset, set `version` to `"false"`:
199+
200+
```yaml
201+
toolsets:
202+
- type: mcp
203+
command: my-custom-server
204+
version: "false"
205+
```
206+
207+
To disable auto-installation globally, set the `DOCKER_AGENT_AUTO_INSTALL`
208+
environment variable to `false`.
209+
164210
### Per-agent tool configuration
165211

166212
Different agents can have different toolsets:
@@ -216,6 +262,85 @@ toolsets:
216262
tools: [read_file, write_file, edit_file]
217263
```
218264

265+
### LSP
266+
267+
The `lsp` toolset connects your agent to
268+
[Language Server Protocol](https://microsoft.github.io/language-server-protocol/)
269+
servers, providing code intelligence like go-to-definition, find references,
270+
diagnostics, rename, formatting, and more.
271+
272+
You can configure multiple LSP servers for different programming languages,
273+
giving your agent code intelligence across your project.
274+
275+
#### Configuration
276+
277+
```yaml
278+
toolsets:
279+
- type: lsp
280+
command: gopls
281+
file_types: [".go"]
282+
283+
- type: lsp
284+
command: typescript-language-server
285+
args: ["--stdio"]
286+
file_types: [".ts", ".tsx", ".js", ".jsx"]
287+
288+
- type: lsp
289+
command: pylsp
290+
file_types: [".py"]
291+
```
292+
293+
If an LSP server binary isn't in your PATH, Docker Agent can
294+
[auto-install it](#auto-installation-of-tool-binaries) using the `version`
295+
property.
296+
297+
#### Properties
298+
299+
| Property | Type | Required | Description |
300+
| ------------ | ---------------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
301+
| `command` | string | Yes | LSP server executable command |
302+
| `args` | array of strings | No | Command-line arguments for the LSP server |
303+
| `env` | object | No | Environment variables for the LSP server process |
304+
| `file_types` | array of strings | No | File extensions this server handles (e.g., `[".go", ".mod"]`) |
305+
| `version` | string | No | Package reference for auto-installing the server binary (e.g., `"golang/tools@v0.21.0"`). Set `"false"` to disable. |
306+
307+
#### Available tools
308+
309+
| Tool | Description | Read-only |
310+
| ----------------------- | --------------------------------------------- | --------- |
311+
| `lsp_workspace` | Get workspace info and available capabilities | Yes |
312+
| `lsp_hover` | Get type info and documentation for a symbol | Yes |
313+
| `lsp_definition` | Find where a symbol is defined | Yes |
314+
| `lsp_references` | Find all references to a symbol | Yes |
315+
| `lsp_document_symbols` | List all symbols in a file | Yes |
316+
| `lsp_workspace_symbols` | Search symbols across the workspace | Yes |
317+
| `lsp_diagnostics` | Get errors and warnings for a file | Yes |
318+
| `lsp_code_actions` | Get available quick fixes and refactorings | Yes |
319+
| `lsp_rename` | Rename a symbol across the workspace | No |
320+
| `lsp_format` | Format a file | No |
321+
| `lsp_call_hierarchy` | Find incoming and outgoing calls | Yes |
322+
| `lsp_type_hierarchy` | Find supertypes and subtypes | Yes |
323+
| `lsp_implementations` | Find interface implementations | Yes |
324+
| `lsp_signature_help` | Get function signature at call site | Yes |
325+
| `lsp_inlay_hints` | Get type annotations and parameter names | Yes |
326+
327+
Not all LSP servers support all features. The agent uses `lsp_workspace` to
328+
discover the capabilities of each configured server.
329+
330+
#### Language server examples
331+
332+
The following examples show configurations for common languages:
333+
334+
| Language | Command | `file_types` |
335+
| --------------------- | ---------------------------- | -------------------------------- |
336+
| Go | `gopls` | `[".go"]` |
337+
| TypeScript/JavaScript | `typescript-language-server` | `[".ts", ".tsx", ".js", ".jsx"]` |
338+
| Python | `pylsp` | `[".py"]` |
339+
| Rust | `rust-analyzer` | `[".rs"]` |
340+
| C/C++ | `clangd` | `[".c", ".cpp", ".h", ".hpp"]` |
341+
342+
For TypeScript/JavaScript, pass `args: ["--stdio"]` to the language server.
343+
219344
### Shell
220345

221346
The `shell` toolset lets your agent execute commands in your system's shell

0 commit comments

Comments
 (0)