Spider phase 2 refers to remote compilation (i.e. containerized bash) and MCP bindings so that Spider can control such. It involves a unified effort from hosting/infra team and the Hyperware team. Specifically, will require infra to spin up and archive temporary bash containers where source code editing and building can occur. Further, will need interfaces between those "build containers" and Hyperware/Spider:

  1. Spider can spin up a container (i.e. an MCP tool init-build-container),
  2. Spider can talk into a container, (i.e. a modified ws-mcp server inside of the container and a WS connection to it from Spider),
  3. Spider can upload/download zipped dirs from container to checkpoint work.

Note there are key differences between a hosted user's flow and a self-hosted user's flow. A self-hosted user will self-host only a long-lived build container. The self-hosted user's Spider will connect directly to that container, without negotiating a connection with a constructor.

Example flows:

The first five steps of the "hosted" examples are the same. In the "self-hosted" examples, the second "hosted" step is elided, as is the last: the numbering intentionally reflects this. "Self-hosted" further differ in step 3, which gets the API key from a user input in the Spider GUI.

One-off, hosted

  1. Spider receives request to build hyperapp,
  2. Spider spins up a container (init-build-container),
  3. Spider connects to the modified ws-mcp server inside of the container and sends method = spider-auth with the API key given by init-build-container,
  4. Spider codes and compiles the app using wcgw (or similar bash-controller), cargo, kit, etc.,
  5. Spider deploys the code if appropriate (start-package),
  6. Spider persists the source (persist),
  7. Spider notifies that it is done with build container (done-build-container).

Multi-turn, hosted

  1. Spider receives request to build hyperapp,
  2. Spider spins up a container (init-build-container),
  3. Spider connects to the modified ws-mcp server inside of the container and sends method = spider-auth with the API key given by init-build-container,
  4. Spider codes and compiles the app using wcgw (or similar bash-controller), cargo, kit, etc.,
  5. Spider deploys the code if appropriate (start-package),
  6. Repeat 4 & 5 some number of times,
  7. Spider persists the source (persist),
  8. Spider notifies that it is done with build container (done-build-container).

Oopsie: no disconnect, hosted

  1. Spider receives request to build hyperapp,
  2. Spider spins up a container (init-build-container),
  3. Spider connects to the modified ws-mcp server inside of the container and sends method = spider-auth with the API key given by init-build-container,
  4. Spider codes and compiles the app using wcgw (or similar bash-controller), cargo, kit, etc.,
  5. Spider deploys the code if appropriate (start-package),
  6. Spider persists the source (persist),
  7. Node with Spider on it dies: no done-build-container sent.

One-off, self-hosted

  1. Spider receives request to build hyperapp,
  1. Spider connects to the modified ws-mcp server inside of the container and sends method = spider-auth with the API key input by the user into the Spider GUI,
  2. Spider codes and compiles the app using wcgw (or similar bash-controller), cargo, kit, etc.,
  3. Spider deploys the code if appropriate (start-package),
  4. Spider persists the source (persist).

Multi-turn, self-hosted

  1. Spider receives request to build hyperapp,
  1. Spider connects to the modified ws-mcp server inside of the container and sends method = spider-auth with the API key input by the user into the Spider GUI,
  2. Spider codes and compiles the app using wcgw (or similar bash-controller), cargo, kit, etc.,
  3. Spider deploys the code if appropriate (start-package),
  4. Repeat 4 & 5 some number of times,
  5. Spider persists the source (persist).

Oopsie: no disconnect, self-hosted

  1. Spider receives request to build hyperapp,
  1. Spider connects to the modified ws-mcp server inside of the container and sends method = spider-auth with the API key input by the user into the Spider GUI,
  2. Spider codes and compiles the app using wcgw (or similar bash-controller), cargo, kit, etc.,
  3. Spider deploys the code if appropriate (start-package),
  4. Spider persists the source (persist),
  5. Node with Spider on it dies.

Components

  1. Spider, running on Hyperware. Spider is both an MCP client AND an MCP server. This means that the MCP client is always connected to some tools. Specifically it will serve init-build-container, done-build-container, start-package, and persist. The first two are reliant on the "constructor". The last two are reliant on a helper run by the "build container"s modified WS-MCP server.

    The reason for this architectural choice is that this allows us to expose Spider's functionality to outside agents, e.g. Claude Code. This means that users can choose to either:

    1. Make use of Spider's "in-house" intelligence,
    2. Make use of an MCP client that supplies its own intelligence to take advantage of its prompting (e.g. Claude Code).
  2. The "constructor", a server that manages the build servers. The constructor serves helpers for init-build-container and done-build-container endpoints, described in the interface section. Note that the constructor is a purely on-hosted server. Users that self-host will not run a constructor and their Spider will not call init-build-container or done-build-container.

  3. The "build container": a relatively short-lived server that Spider will control through MCP tools. The build container, possibly a Docker container, runs bash and has all that is necessary to compile Hyperware processes (at a minimum this includes js/ts tools like nvm, npm; rust tools like cargo; kit; and all the various compilers etc to support the above. It also runs a modified ws-mcp server. The build container is spun up on-demand for hosted users via the constructor. The build container is long-lived for self-hosted users.

Interface

The interface for Spider consists of a few MCP tools that will point to a few different endpoints:

init-build-container

Send a POST to an endpoint ("constructor") specified in Spider.

POST consists of:

Response consists of:

load-project

Send a request over the WS connection to the build container's modified WS-MCP server. We will bundle a helper into the modified WS-MCP server run by the build container that will handle this tool call: the tool itself will be served by Spider's built-in MCP server.

Request consists of:

Response consists of:

The build container will have a new directory created: $HOME/<uuid> into which the contents of the zipped directory will be placed.

start-package

Send a request over the WS connection to the build container's modified WS-MCP server. We will bundle a helper into the modified WS-MCP server run by the build container that will handle this tool call: the tool itself will be served by Spider's built-in MCP server. It will behave like kit start-package -- but pass files, etc. over the WS connection, obviating the need to, e.g., kit connect from the build container to the vps running the node.

persist

Send a request over the WS connection to the build container's modified WS-MCP server. We will bundle a helper into the modified WS-MCP server run by the build container that will handle this tool call: the tool itself will be served by Spider's built-in MCP server. It will zip the requested directories and pass them over the WS connection; Spider will be responsible for saving them in the appropriate place. This could be used to persist a .git directory, or just backup the repo state of a container for later use.

done-build-container

Send a POST to an endpoint ("constructor") specified in Spider.

POST consists of:

Response consists of:

Original gist on GitHub