Live data from Hacker News

Open Source and Local Code Mode MCP in Deno Sandboxes

portofcontext.com

11–20 of 29 posts

Re: Open Source and Local Code Mode MCP in Deno Sandboxes

#12
post #9

This is very interesting. So it's an MCP server that connects to what is effectively a sandboxed MCP "hub". This is a clever middle ground between using dozens of context-munching MCP servers and just giving the agent access to your command line. One question: why is Deno used? I thought that it was a JavaScript runtime. Can pctx only run sandboxed JavaScript code? If so, what do you do if you need the agent to run a…

hey! the way it works is that the llm is first given snippets in typescript that tell it how to use the various MCP tools. it then can code, in typescript, and execute all of the tool calls in the deno sandbox. so yes, it can only execute javascript, but this isn't meant to be a full arbitrary code execution env like E2B.dev is, this sandbox is only meant to be a place for MCP calls to happen.

we chose typescript because it's the most token efficient way to pass types and signatures to an LLM, with Python and Pydantic there are extra characters passed around

Re: Open Source and Local Code Mode MCP in Deno Sandboxes

#13
Thank you! Looks interesting and I was thinking of something similar recently. I'm sure there are zillions of use cases for this, it'd be helpful to have a few of them explained on the front page

> pctx optimizes this communication by presenting MCP servers as code APIs

Would be nice to have examples of how this is reduced, if some information was lost in the process and what the tradeoff is

Re: Open Source and Local Code Mode MCP in Deno Sandboxes

#14

Very interesting! Does this support dynamic bindings like Cloudflare Workers or what would be the mechanism to inject dependencies?

no dependency injection at the moment... this is something we are exploring. adding dependencies would require rebuilding the execution runtime, which is something we want to open up in the framework soon

Re: Open Source and Local Code Mode MCP in Deno Sandboxes

#15

Very interesting! Does this support dynamic bindings like Cloudflare Workers or what would be the mechanism to inject dependencies?

no dependency injection at the moment... this is something we are exploring. adding dependencies would require rebuilding the execution runtime, which is something we want to open up in the framework soon

I'm asking because of multi-user scenarios where each MCP tool call requires authentication to 3rd-party APIs. Having a quick way to spin up the MCP "Server" with the correct credentials is not something I've seen a good solution to.

Re: Open Source and Local Code Mode MCP in Deno Sandboxes

#16
post #13

Thank you! Looks interesting and I was thinking of something similar recently. I'm sure there are zillions of use cases for this, it'd be helpful to have a few of them explained on the front page > pctx optimizes this communication by presenting MCP servers as code APIs Would be nice to have examples of how this is reduced, if some information was lost in the process and what the tradeoff is

thank you, will get a more detailed benchmark out soon!

Re: Open Source and Local Code Mode MCP in Deno Sandboxes

#20

Earlier quoted context omitted.

no dependency injection at the moment... this is something we are exploring. adding dependencies would require rebuilding the execution runtime, which is something we want to open up in the framework soon

I'm asking because of multi-user scenarios where each MCP tool call requires authentication to 3rd-party APIs. Having a quick way to spin up the MCP "Server" with the correct credentials is not something I've seen a good solution to.

got it, yes so currently this is built just for one user - one set of credentials, but passing user credentials through is something we want to add.

thinking a native connection to cloud auth managers is the best way to do this (clerk, auth0, etc.)

Post reply on HN