Add example showing how to setup an MCP server for a workspace - #28
Open
scuffi wants to merge 1 commit into
Open
Add example showing how to setup an MCP server for a workspace#28scuffi wants to merge 1 commit into
scuffi wants to merge 1 commit into
Conversation
commit: |
aron-cf
changed the base branch from
workspace-runtime-execution
to
workspace-javascript-backend
July 31, 2026 12:11
scuffi
force-pushed
the
workspace-codemode-adapter
branch
3 times, most recently
from
July 31, 2026 12:35
6b8cd20 to
be031a6
Compare
Base automatically changed from
workspace-javascript-backend
to
workspace-runtime-execution
July 31, 2026 14:14
scuffi
force-pushed
the
workspace-codemode-adapter
branch
from
July 31, 2026 14:38
be031a6 to
c6048e3
Compare
aron-cf
force-pushed
the
workspace-codemode-adapter
branch
from
July 31, 2026 14:38
c6048e3 to
f1cf132
Compare
scuffi
force-pushed
the
workspace-codemode-adapter
branch
from
July 31, 2026 15:10
c6048e3 to
509bf0d
Compare
Contributor
|
Trying to figure out if we need this on top of the existing backend. I'm not sure what it would be used for. What are your thoughts? |
scuffi
force-pushed
the
workspace-codemode-adapter
branch
from
August 3, 2026 10:35
509bf0d to
b2e6e91
Compare
scuffi
force-pushed
the
workspace-codemode-adapter
branch
from
August 3, 2026 15:20
b2e6e91 to
5cb656e
Compare
scuffi
force-pushed
the
workspace-codemode-adapter
branch
from
August 3, 2026 15:53
5cb656e to
652d3bd
Compare
scuffi
marked this pull request as ready for review
August 3, 2026 16:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Codemode already runs model-written JavaScript in an isolated Dynamic Worker, and Computer already provides bounded tools for working with a durable workspace. This example shows how to compose those pieces without adding another Computer backend or executor. All implementation code stays in
examples/codemode.The example creates an internal MCP server from Computer's
read,ls,write,edit, andexectools. Codemode'scodeMcpServer()discovers those tools, generates their JavaScript types, and exposes them to MCP clients as onecodetool.The main composition is intentionally small:
Code running in the Codemode sandbox can then use the native Computer tools together:
To try it locally, run:
Then connect a Streamable HTTP MCP client to
http://127.0.0.1:8787/mcp. The local harness is stateless and acceptsPOSTonly; it does not open a session-bound event stream.The integration test connects with a real MCP client, checks that only
codeis public, exercises all five Computer tools through Codemode's Dynamic Worker, and confirms that files persist across calls. The example README documents the architecture, local setup, and trust boundary. A public deployment would still need tenant-derived Workspace identity, authentication, authorization, limits, and storage quotas.