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:
- Spider can spin up a container (i.e. an MCP tool
init-build-container), - Spider can talk into a container, (i.e. a modified
ws-mcpserver inside of the container and a WS connection to it from Spider), - 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
- Spider receives request to build hyperapp,
- Spider spins up a container (
init-build-container), - Spider connects to the modified
ws-mcpserver inside of the container and sendsmethod = spider-authwith the API key given byinit-build-container, - Spider codes and compiles the app using
wcgw(or similar bash-controller),cargo,kit, etc., - Spider deploys the code if appropriate (
start-package), - Spider persists the source (
persist), - Spider notifies that it is done with build container (
done-build-container).
Multi-turn, hosted
- Spider receives request to build hyperapp,
- Spider spins up a container (
init-build-container), - Spider connects to the modified
ws-mcpserver inside of the container and sendsmethod = spider-authwith the API key given byinit-build-container, - Spider codes and compiles the app using
wcgw(or similar bash-controller),cargo,kit, etc., - Spider deploys the code if appropriate (
start-package), - Repeat 4 & 5 some number of times,
- Spider persists the source (
persist), - Spider notifies that it is done with build container (
done-build-container).
Oopsie: no disconnect, hosted
- Spider receives request to build hyperapp,
- Spider spins up a container (
init-build-container), - Spider connects to the modified
ws-mcpserver inside of the container and sendsmethod = spider-authwith the API key given byinit-build-container, - Spider codes and compiles the app using
wcgw(or similar bash-controller),cargo,kit, etc., - Spider deploys the code if appropriate (
start-package), - Spider persists the source (
persist), - Node with Spider on it dies: no
done-build-containersent.
One-off, self-hosted
- Spider receives request to build hyperapp,
- Spider connects to the modified
ws-mcpserver inside of the container and sendsmethod = spider-authwith the API key input by the user into the Spider GUI, - Spider codes and compiles the app using
wcgw(or similar bash-controller),cargo,kit, etc., - Spider deploys the code if appropriate (
start-package), - Spider persists the source (
persist).
Multi-turn, self-hosted
- Spider receives request to build hyperapp,
- Spider connects to the modified
ws-mcpserver inside of the container and sendsmethod = spider-authwith the API key input by the user into the Spider GUI, - Spider codes and compiles the app using
wcgw(or similar bash-controller),cargo,kit, etc., - Spider deploys the code if appropriate (
start-package), - Repeat 4 & 5 some number of times,
- Spider persists the source (
persist).
Oopsie: no disconnect, self-hosted
- Spider receives request to build hyperapp,
- Spider connects to the modified
ws-mcpserver inside of the container and sendsmethod = spider-authwith the API key input by the user into the Spider GUI, - Spider codes and compiles the app using
wcgw(or similar bash-controller),cargo,kit, etc., - Spider deploys the code if appropriate (
start-package), - Spider persists the source (
persist), - Node with Spider on it dies.
Components
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, andpersist. 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:
- Make use of Spider's "in-house" intelligence,
- Make use of an MCP client that supplies its own intelligence to take advantage of its prompting (e.g. Claude Code).
The "constructor", a server that manages the build servers. The constructor serves helpers for
init-build-containeranddone-build-containerendpoints, 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 callinit-build-containerordone-build-container.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 likecargo;kit; and all the various compilers etc to support the above. It also runs a modifiedws-mcpserver. 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(hosted only)load-projectstart-packagepersistdone-build-container(hosted only)
init-build-container
Send a POST to an endpoint ("constructor") specified in Spider.
POST consists of:
- metadata that may be of use to the server (type of project? estimated duration of project? ...)
Response consists of:
- WS URI to connect to
- Session/API key to use for auth when connecting to WS URI
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:
- optional uuid of the project
- optional name of project
- optional zipped directory to be extracted in the
$HOME/<uuid>dir of the build container (e.g. afoo/.git, or a set of repos that will all be worked on, or a template, or ...)
Response consists of:
- uuid of the project (echoed or created if none supplied)
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:
- metadata that may be of use to the server (estimate of "doneness" of project? ...)
Response consists of:
- whether container has been torn down? Container TTL? Not sure