cpuosBeta

Integration · Protocol

MCP (Model Context Protocol) with cpuOS jobs

A stdio MCP server for cpuOS jobs, cpuos-mcp, is built but not yet on npm. Until it is, wrap the REST jobs API in your own MCP server.

Use REST calls from your application. No cpuOS SDK package, framework adapter or hosted MCP server is published. Confirm the capabilities described below before selecting a workflow.

Interface
REST /v1/jobs
Model endpoint
https://gpuos.si/v1 or any OpenAI-compatible
Status
BYO CPU pilot

Availability

The cpuos-mcp package is not published on npm yet, so it cannot be installed today. This page will give the install command and client configuration when it is.

Until then, an MCP server you build and operate can call the REST contract below. No cpuOS MCP server is hosted.

The cpuos-mcp server

cpuos-mcp is a Model Context Protocol server over stdio. It wraps the cpuOS jobs API in four tools, so an agent can run a short script on a worker you connected and read its result:

  • run_job submits a Python or Node.js script with an idempotency key and waits for its result, up to 50 seconds. A job still running after that comes back with its id.
  • get_job reads one job: status, exit code, stdout, stderr, duration, error and the submitted code.
  • list_jobs lists jobs newest first, as summaries unless their content is asked for.
  • cancel_job cancels a queued job, or marks a running one cancelled for its worker to stop.

A failed or cancelled job is returned as a tool error with its stderr and error message. A submission that gets no answer is retried once with the same idempotency key, which cannot run the script twice. The server sends your API key only to the cpuOS API and never writes it into tool results.

The supported HTTP contract

The JavaScript API client supplies the HTTP lifecycle for your own tool server. A fixed JSON validation task gives that wrapper a result contract you can verify before exposing it to a model.

Submit from your server using fetch
const response = await fetch("https://cpuos.si/v1/jobs", {  method: "POST",  headers: {    Authorization: "Bearer " + process.env.CPUOS_API_KEY,    "Content-Type": "application/json",  },  body: JSON.stringify({    template: "python", code: "print(sum([12, 18, 25]))",    vcpu: 1, memoryMb: 512, timeoutSeconds: 30,  }),})if (!response.ok) throw new Error(await response.text())const job = await response.json()// GET /v1/jobs/:id until status is completed, failed or cancelled.// Use the result only after checking status and exitCode.

Poll GET /v1/jobs/:id with the same bearer key. Queued and running are intermediate states. Inspect completed, failed or cancelled, exitCode, stdout, stderr, error and outputTruncated before returning a tool result. Logs arrive at completion, not as a live stream.

Set limits and retain ownership

  • Keep the API key in your application, never in model context or job code.
  • Fix resource ceilings and deadline in your tool handler; do not accept arbitrary workspace or worker selection from the model.
  • Store the job id before polling, bound retries and avoid resubmitting after an ambiguous network failure.
  • Running cancellation is requested through DELETE and applied when the worker observes it; continue inspecting the job and node state.

Validate before connecting an agent

Use trusted team code and a worker machine allocated to this pilot. Docker containers share the host kernel. Test a known successful script, a failing script, a timeout and worker disconnection. Keep external side effects in separate authorized application operations.

The model can be served by gpuOS or another provider. Model inference and CPU jobs are separate calls, with a separate key for each product (one account and workspace can hold both) and no automatic cross-product integration.

Official documentation: modelcontextprotocol.io

Questions

Can I install the cpuOS MCP server now?
Not yet. The `cpuos-mcp` package is not on npm. Until it is, call the REST jobs API from an MCP server you operate.
Is the cpuOS MCP server hosted?
No. `cpuos-mcp` runs on your own computer, started by your MCP client over stdio, and calls the cpuOS API with your key. cpuOS has no remote MCP endpoint.
Where does the code run?
On a Docker worker you connected to your workspace, in a restricted container with no network and the standard library only. Containers share the worker's kernel, so use a machine set aside for this and review what the agent is allowed to run.

Related

Start with a supported CPU task

Connect a Docker worker and validate a bounded Python or Node job before wiring an agent tool.

gpuOS · where models think

Need the model too? Run it on gpuOS

gpuOS serves open models on your own GPUs behind one OpenAI-compatible API. Your application can submit authorized actions to cpuOS jobs.