TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

MCP Run Python

173 点作者 xrd26 天前

14 条评论

behnamoh24 天前
So their method of sandboxing Python code is to spin up a JS runtime (deno), run Pyodide on it, and then run the Python code in Pyodide.<p>Seems a lot of work to me. Is this really the best way to create and run Python sandboxes?
评论 #43719672 未加载
评论 #43722369 未加载
评论 #43718841 未加载
评论 #43719300 未加载
评论 #43721408 未加载
评论 #43719881 未加载
评论 #43726452 未加载
评论 #43718770 未加载
评论 #43723869 未加载
评论 #43719370 未加载
评论 #43718335 未加载
simonw24 天前
I hacked around with this a bit and figured out a way to get it to spit out logging of the prompts and responses to the server: <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;simonw&#x2F;54fc42ef9a7fb8f777162bbbfbba4f23" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;simonw&#x2F;54fc42ef9a7fb8f777162bbbfbba4...</a><p>Short-ish version:<p><pre><code> ANTHROPIC_API_KEY=&quot;$(llm keys get anthropic)&quot; \ uv run --with devtools --with pydantic-ai python -c &#x27; import asyncio from devtools import pprint from pydantic_ai import Agent, capture_run_messages from pydantic_ai.mcp import MCPServerStdio server = MCPServerStdio( &quot;deno&quot;, args=[ &quot;run&quot;, &quot;-N&quot;, &quot;-R=node_modules&quot;, &quot;-W=node_modules&quot;, &quot;--node-modules-dir=auto&quot;, &quot;jsr:@pydantic&#x2F;mcp-run-python&quot;, &quot;stdio&quot;, ], ) agent = Agent(&quot;claude-3-5-haiku-latest&quot;, mcp_servers=[server]) async def main(): with capture_run_messages() as messages: async with agent.run_mcp_servers(): result = await agent.run(&quot;How many days between 2000-01-01 and 2025-03-18?&quot;) pprint(messages) print(result.output) asyncio.run(main())&#x27; </code></pre> Output here: <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;simonw&#x2F;54fc42ef9a7fb8f777162bbbfbba4f23#output" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;simonw&#x2F;54fc42ef9a7fb8f777162bbbfbba4...</a><p>I got it running against Mistral Small 3.1 running locally too - notes on that here: <a href="https:&#x2F;&#x2F;simonwillison.net&#x2F;2025&#x2F;Apr&#x2F;18&#x2F;mcp-run-python&#x2F;" rel="nofollow">https:&#x2F;&#x2F;simonwillison.net&#x2F;2025&#x2F;Apr&#x2F;18&#x2F;mcp-run-python&#x2F;</a>
evacchi24 天前
cool!! you might also want to check out <a href="https:&#x2F;&#x2F;www.mcp.run&#x2F;dylibso&#x2F;eval-py" rel="nofollow">https:&#x2F;&#x2F;www.mcp.run&#x2F;dylibso&#x2F;eval-py</a><p>It&#x27;s open source too :) <a href="https:&#x2F;&#x2F;github.com&#x2F;dylibso&#x2F;mcp.run-servlets&#x2F;tree&#x2F;main&#x2F;servlets&#x2F;eval-py">https:&#x2F;&#x2F;github.com&#x2F;dylibso&#x2F;mcp.run-servlets&#x2F;tree&#x2F;main&#x2F;servle...</a><p>We also use Wasm to sandbox all our servlets <a href="https:&#x2F;&#x2F;docs.mcp.run&#x2F;blog&#x2F;2025&#x2F;04&#x2F;07&#x2F;mcp-run-security" rel="nofollow">https:&#x2F;&#x2F;docs.mcp.run&#x2F;blog&#x2F;2025&#x2F;04&#x2F;07&#x2F;mcp-run-security</a><p>(I work at Dylibso)
_pdp_24 天前
Bookmarked it. We took another approach which provides more flexibility but at the cost of slower spin up. Basically we use firecracker vm. We mount the attachments and everything else into the vm so that the agent can run tools on them (anything on the os) and we destroy the machine at the very end. It works! It is also as secure as firecracker goes.<p>But I like using WASM especially in a hosted environment like Deno. It feels like a more scaleable solution and probably less maintenance too with the downside that that we wont be able to run just any cmd.<p>I am happy to provide more details and point to the tool is anyone is interested. It is not open-source but you can play with it for free.
评论 #43721342 未加载
yahoozoo24 天前
All of these Agent frameworks are already overwhelming. Insert joke about parallels to the JavaScript ecosystem.<p>What agent framework is truly the top dog? Is it just working with the big model providers native frameworks, such as OpenAI’s Agents SDK?
m304724 天前
Having watched the repeated immolation of blissful innocence since smart email clients would run whatever smart (OLE? Smart? I&#x27;m kidding.) document was delivered, this is going to be so much fun in a trainwreck kind of way.
bigbuppo24 天前
I keep seeing this MCP thing and I&#x27;m really happy that people are getting into Burroughs mainframes rather than that stupid AI crap.
评论 #43721406 未加载
someguy10101024 天前
Nice! I&#x27;m working on a way to do this for javascript using v8 <a href="https:&#x2F;&#x2F;github.com&#x2F;r33drichards&#x2F;mcp-js">https:&#x2F;&#x2F;github.com&#x2F;r33drichards&#x2F;mcp-js</a>. Right now this works but there is some significant jank.
Cluelessidoit24 天前
Hi, I don’t really know anything honestly, but I do remember an ai I running on my laptop using xpip or xpython as a contained environment I think it’s a single instance, would that work or is that close???
jamesralph855524 天前
How secure is this? I tried building something similar, but it was taking too long to setup a fully virtualized solution like kata container or firecracker.
singularity200124 天前
Why not Pyodide directly in python?
评论 #43722399 未加载
turnsout24 天前
Woof, use with care
neuroelectron23 天前
Crap but it&#x27;s mcp so being good isn&#x27;t the point anyway
mountainriver24 天前
Cool!