mcp

v0.1.4
@husk-ai/mcp Checked 1 day ago Published 2 months ago

Give any MCP client a Linux computer.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

shell

Run a shell command on your Linux computer and return its output. This is the primary tool -- prefer it for anything a command line can do. The filesystem persists across calls within a session. Commands run from /work by default.

ParameterTypeDescription
command *stringThe shell command, run with sh -c.
cwdstringWorking directory. Defaults to /work.
stdinstringText piped to the command on stdin.
timeoutSecnumberKill the command after this long. Defaults to 120.

read_file

Read a text file from the computer. Use offset/limit for large files rather than reading the whole thing -- output is capped and the middle will be elided.

ParameterTypeDescription
path *stringAbsolute path, e.g. /work/main.py
limitnumberHow many lines to return.
offsetnumberFirst line to return (1-based).

write_file

Create or overwrite a file. Creates parent directories. To change part of an existing file, use edit_file instead so you do not lose content you did not read.

ParameterTypeDescription
content *string
path *string
appendbooleanAppend instead of overwriting.

edit_file

Replace an exact string in a file. Fails if old_string is absent or appears more than once, so include enough surrounding context to be unambiguous. Safer than write_file for edits.

ParameterTypeDescription
new_string *stringReplacement text.
old_string *stringExact text to replace, including indentation.
path *string

list_dir

List a directory. Directories are listed first.

ParameterTypeDescription
pathstringAbsolute path. Defaults to /work.

expose_port

Publish a port the computer is listening on and get a URL reachable from the host. Start your server first, then call this.

ParameterTypeDescription
port *numberThe port inside the computer.

browse

Load a web page from inside this computer and get its text and links. Prefer this over your own web tools when what matters is what THIS machine can reach: it shares the computer network, DNS and egress policy, so the result matches what a command running here would see.

ParameterTypeDescription
url *stringAbsolute http(s) URL.
maxBytesnumberCap the extracted text. Defaults to 200 KB.
timeoutSecnumberGive up after this long. Defaults to 30.

computer_info

Describe the machine: OS, kernel, CPU, memory, disk, network reachability, and which language runtimes are installed. Call this once before assuming a tool exists, instead of probing with several shell commands.

browser_goto

Open a URL in a real Chromium inside your computer and return the rendered text. Use this instead of `browse` when the page needs JavaScript to render, or when you need to stay logged in across several pages. First use on a machine downloads Chromium (~111 MB) and takes a minute; after that it is fast, and `browse` is still the cheaper choice for a plain article.

ParameterTypeDescription
url *stringAbsolute http or https URL.
timeoutSecnumberGive up waiting for load. Defaults to 30.

browser_snapshot

List everything on the current page you can read or act on, each with a `ref`. Pass a ref to browser_click or browser_type. Take a fresh snapshot after anything that changes the page -- refs do not survive a navigation.

ParameterTypeDescription
limitnumberCap the number of elements. Defaults to 400.

browser_click

Click the element with this ref, then return a fresh snapshot of whatever the page became. Refs come from browser_snapshot; there is deliberately no way to click a coordinate.

ParameterTypeDescription
ref *stringA `ref` from browser_snapshot, e.g. e42.

browser_type

Type into the field with this ref, replacing what is already there. Set submit to press Enter afterwards. Returns a fresh snapshot.

ParameterTypeDescription
ref *stringA `ref` from browser_snapshot.
text *stringThe text to type.
submitbooleanPress Enter after typing. Defaults to false.

browser_screenshot

Take a PNG of the current page. Saved into the computer, and returned inline when it is small enough to be worth the tokens. Good for checking a layout or showing a human what you see -- for deciding what to click, browser_snapshot is smaller and more exact.

ParameterTypeDescription
fullPagebooleanCapture the whole document, not just the viewport.
pathstringWhere to write it. Defaults to /work/screenshot.png.

browser_wait_for

Wait until some text or a CSS selector appears on the page (or disappears, with gone). Use this after anything that loads content without navigating -- which on a modern site is most things. Waiting for a page load instead will return immediately and you will snapshot an empty page.

ParameterTypeDescription
gonebooleanWait for it to go away instead. Good for spinners.
selectorstringCSS selector to wait for, if you prefer.
textstringVisible text to wait for.
timeoutSecnumberGive up after this long. Defaults to 15.

browser_scroll

Scroll the page, or bring one element into view. The snapshot lists the whole document, so an element can be listed and still be off screen; scroll to it before clicking if a click does not take. Also how you load more of an infinite-scroll page.

ParameterTypeDescription
bynumberPixels to scroll down; negative for up. Defaults to 600.
refstringBring this ref into view.
tostringJump to the top or bottom.

browser_select

Choose an option in a dropdown (a native <select>). Clicking one does nothing useful -- the menu is drawn by the operating system, not the page -- so use this instead. Matches the option by value or by its visible label.

ParameterTypeDescription
ref *stringA `ref` from browser_snapshot, on the <select>.
value *stringThe option value, or the label you can see.

browser_upload

Attach files to a file input. The paths are paths inside your computer, so write or download the file there first -- the browser is in the same machine as your filesystem.

ParameterTypeDescription
files *arrayAbsolute paths in the computer.
ref *stringA `ref` from browser_snapshot, on the file input.

browser_hover

Move the pointer over an element, for menus that only appear on hover.

ParameterTypeDescription
ref *stringA `ref` from browser_snapshot.

browser_navigate

Go back, go forward, or reload the current page.

ParameterTypeDescription
how *string

browser_tabs

List the open tabs, or switch to one. A link that opens in a new tab lands somewhere you are not looking, and every other browser tool keeps acting on the old page -- if a click seemed to do nothing, check here before concluding it failed.

ParameterTypeDescription
openstringOpen a new tab at this URL and switch to it.
switchTostringA targetId from a previous call, to switch to.

browser_status

Whether this computer already has a browser, without installing one, and whether this provider can get one at all. Call it before browser_goto if you want to know whether the first call pays the ~111 MB download -- on a metered connection, or on a container provider that cannot perform the download, that is worth knowing first.