Skip to content

MCP Server ​

ws-cli serve mcp serves the workspace's own tools to an AI agent: editor diagnostics, settings, logs, features and templates.

It is a Model Context Protocol (MCP) server over stdio: the agent starts it and talks to it over stdin and stdout. No port is opened, so the server is not reachable over the network.

Register the Server ​

Registration is manual. Run the command for your agent once, in a workspace terminal:

sh
claude mcp add ws -- ws-cli serve mcp
sh
codex mcp add ws -- ws-cli serve mcp

Any other MCP client that can start a stdio command can use the same command, ws-cli serve mcp.

💡 TIP

Register ws-cli, not the ws shortcut. ws exists only in interactive terminals, so an agent cannot start it.

Tools ​

Each tool runs one ws-cli command and returns its output. A tool is named after its command path, joined with _: ws-cli show env is the tool show_env.

By default the server lists only tools that read:

GroupToolDescription
editoreditor_diagnosticsPull language-server diagnostics (errors, warnings) from the editor, across the whole workspace or a single file with --uri
editoreditor_listList the editor's open tabs, with each tab's path, language, and active or dirty state
editoreditor_selectionReport the active editor's current selection: file, range, and selected text
featurefeature_infoShow a feature's description and the variables it accepts when it is installed
featurefeature_listList the features you can install, marking where each comes from: the shipped set, a workspace override, or your own ~/.ws/features.d
featurefeature_storeList the artifacts published to the feature store (WS_FEATURES_STORE_URL), the offline mirror that features install from when the network is locked down (only with WS_FEATURES_STORE_URL set)
infoinfo_extensionsList the installed VS Code extensions with their versions
infoinfo_metricsShow live resource usage: CPU, memory, disk, and file descriptors, plus GPU with --gpu
infoinfo_uptimeShow when the workspace session started and how long it has been running
infoinfo_versionPrint the workspace version
logslogsRead a workspace daemon's log: the main log by default, or --target metrics|docker|cloudflared
portport_listList the TCP ports listening in the workspace, whether each one is public or private, its public URLs, and its state in the editor's Ports tab
seedseed_lsList what apply would write, without touching the filesystem: each destination with its operation and whether it carries a secret or a template
showshow_envResolve a setting by its dotted key (server.port) and print it with its source and description
showshow_ip_internalPrint the workspace container's internal IP address
showshow_ip_nodePrint the IP address of the node hosting the workspace
showshow_path_homePrint the workspace home (server root) path
showshow_path_vscode_settingsPrint the path to the VS Code settings file: the user file by default, or the folder's with --workspace
templatetemplate_listList the templates you can apply, with their source paths and whether one is already applied here
templatetemplate_showDisplay the contents of a configuration template

show_env never returns the value of a secret setting: it shows <redacted> in its place.

Allow Tools That Act on the Workspace ​

These tools change the workspace instead of reading it:

ToolDescription
editor_openOpen a file in the running editor window: a tab in the current window by default, a preview tab with --preview, jumping to a range with --selection
editor_revealShow and select a workspace file or folder in the editor's Explorer sidebar without opening it, like the Reveal in Explorer View action
template_applyCopy a template, a shared config like ruff or markdownlint, into the project at --path (the current directory by default)

The server lists them only when this variable is true:

  • WS_AI_MCP_ALLOW_WRITE: Enables the MCP tools that act on the workspace.
sh
docker run \
  -e WS_AI_MCP_ALLOW_WRITE=true \
  ghcr.io/kloudkit/workspace:v0.6.0

Narrow the Tool List ​

To serve fewer tools, name the ones to keep in this variable:

  • WS_AI_MCP_TOOLS: Comma-separated list of MCP tools to serve.

Each entry is a group or a tool name from the tables above. The default, *, serves every tool.

To serve the info and editor groups and the single tool show_env:

sh
docker run \
  -e WS_AI_MCP_TOOLS="info,show_env,editor" \
  ghcr.io/kloudkit/workspace:v0.6.0

An entry that names no group or tool is ignored with a warning. Naming a tool that acts on the workspace does not allow it: editor_open is still listed only with WS_AI_MCP_ALLOW_WRITE.

Not a Security Boundary

These two variables shape the list of tools an agent sees. They do not restrict the agent: one with a terminal can already run ws-cli itself.

Server Output ​

The server writes a start banner and one line per tool call to stderr. The banner reports how many tools are served and any filter in effect, and each line names the tool, its outcome and how long it took.

Released under the MIT License