Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
ContainerAgent is a stateless Streamable HTTP MCP server. It proxies container
operations to an upstream agent service and Base64-encodes request and response
payloads.
The project provides two entry points:
server.js: a standalone Node.js HTTP server.deno-server.js: a web-standard Deno handler exported as a default function.
- Node.js 20 or newer for
server.js. - A Deno-compatible serverless runtime for
deno-server.js. - An upstream agent endpoint supplied through the
API_URLenvironment variable. No upstream endpoint is embedded in the source code.
Install the Node.js dependencies:
npm install
Set API_URL in the deployment environment, then start the server:
npm start
The MCP endpoint is exposed at /mcp.
| Variable | Required | Default | Description |
|---|---|---|---|
API_URL | Yes | None | Upstream agent action endpoint. |
HOST | No | 0.0.0.0 | HTTP bind address. |
PORT | No | 8080 | HTTP listening port. |
deno-server.js exports the request handler directly:
export default async function handler(request) {
// Returns a web-standard Response.
}
Configure API_URL as a deployment environment variable. The host platform
must route MCP requests to /mcp.
execute_command(command): executes a shell command in the container and returns its output.read_file(path, start_line = 1, end_line?): reads an inclusive, one-based line range from a UTF-8 text file.write_file(path, content, mode = "insert" | "replace", start_line?, end_line?): inserts content or replaces an inclusive line range.
Start the Node.js server and run the MCP protocol client:
npm test
Use MCP_URL to point the test client at a different MCP deployment. The test
initializes the server, lists its tools, executes a command, and reads a file.
- Keep
API_URLin the deployment environment rather than source control. - The tools provide command execution and file access. Deploy the server only in an isolated container and restrict access to the MCP endpoint.
- Use authentication and authorization at the gateway before exposing the server publicly.