EM

elusznik/mcp-server-code-execution-mode

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

340 stars 33 forks 质量 78 趋势 19GPL-3.0

elusznik/mcp-server-code-execution-mode 是从 https://github.com/elusznik/mcp-server-code-execution-mode. 导入的 MCP 服务器候选

概览

elusznik/mcp-server-code-execution-mode 是从 https://github.com/elusznik/mcp-server-code-execution-mode. 导入的 MCP 服务器候选

概述(AI 翻译)

停止为每个查询支付3万个令牌。 该桥实现了Anthropic的无根安全发现模式——将MCP上下文从3万个令牌减少到200个,同时代理任何stdio服务器。

概述

该桥接实现了**“带MCP的代码执行”**模式,汇聚了行业领导者的理念:

  • 苹果的CodeAct:“你的LLM代理在生成代码时表现更好。”
  • Anthropic 的代码执行与 MCP:“构建更高效的代理。”
  • Cloudflare 的代码模式:“LLM 更擅长编写调用 MCP 的代码,而非直接调用 MCP。”
  • Docker 的动态 MCP:“停止硬编码你的代理世界。”
  • Terminal Bench’s Terminus:“用于评估LLM代理的真实终端环境。”

它没有向LLM暴露数百个独立工具(这会消耗大量上下文并使模型混乱),而是暴露一个工具:run_python。LLM编写Python代码来发现、调用和组合其他工具。

为什么vs. JS“代码模式”?

虽然有基于JavaScript的替代方案(如universal-tool-calling-protocol/code-mode),但本项目专为数据科学和安全而构建:

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

MCP Code Execution Server: Zero-Context Discovery for 100+ MCP Tools

Stop paying 30,000 tokens per query. This bridge implements Anthropic’s discovery pattern with rootless security—reducing MCP context from 30K to 200 tokens while proxying any stdio server.

Overview

This bridge implements the “Code Execution with MCP” pattern, a convergence of ideas from industry leaders:

  • Apple’s CodeAct: “Your LLM Agent Acts Better when Generating Code.”
  • Anthropic’s Code execution with MCP: “Building more efficient agents.”
  • Cloudflare’s Code Mode: “LLMs are better at writing code to call MCP, than at calling MCP directly.”
  • Docker’s Dynamic MCPs: “Stop Hardcoding Your Agents’ World.”
  • Terminal Bench’s Terminus: “A realistic terminal environment for evaluating LLM agents.”

Instead of exposing hundreds of individual tools to the LLM (which consumes massive context and confuses the model), this bridge exposes one tool: run_python. The LLM writes Python code to discover, call, and compose other tools.

Why This vs. JS “Code Mode”?

While there are JavaScript-based alternatives (like universal-tool-calling-protocol/code-mode), this project is built for Data Science and Security:

Feature This Project (Python) JS Code Mode (Node.js)
Native Language Python (The language of AI/ML) TypeScript/JavaScript
Data Science Native (pandas, numpy, scikit-learn) Impossible / Hacky
Isolation Hard (Podman/Docker Containers) Soft (Node.js VM)
在 GitHub 查看完整 README

安装

uvx --from git+https://github.com/elusznik/mcp-server-code-execution-mode mcp-server-code-execution-mode run
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "mcp-server-code-execution-mode": { "command": "uvx", "args": [ "--from", "git+https://github.com/elusznik/mcp-server-code-execution-mode", "mcp-server-code-execution-mode", "run" ], "env": { "MCP_BRIDGE_RUNTIME": "podman" } } } }