NO

nicolepcx/o_reilly_demo_day_mcp

开发工具

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

16 stars 9 forks 质量 41 趋势 21

此寄存器包含会话的代码和多克设置 :

概览

此寄存器包含会话的代码和多克设置 : - 生成 Python 解决方案, - 测试和标定它们在一个,基于结构化反馈的精炼, 并共同向更高的质量发展代码。 MCP充当推理代理, 这是走向... 传统的地方行刑(如Python REPL)带有风险和局限性: -:执行主机上任意生成的代码可能导致数据泄露或系统损坏. -:错误(如无限回路,回路错误)可以挂起过程. - 跨节点的多个代理上运行代码需要管弦和沙箱. - 运行Python在, 沙盒从主机OS。 - 必要时自动进入沙盒。 - 捕捉干净。 - 工作(如有胶片的克伯内特斯)。 - 提供一个,不只是工具呼叫。 这使得MCP非常适合推理代理安全合作的地方. - 安装(第24版+建议).

概述(AI 翻译)

此寄存器包含 **O’Reilly Demo Day ** 会话的代码和多克设置 :

奥赖利·德莫日* ** 用MCP建立强有力的AI应用程序和代理人**

– – . . .

□ 德莫概览

这个代码显示了自主代理如何可以使用MCP不仅连接工具,而且还可以相互沟通.

我们运行一个多代理编码系统,其中代理商通过:

  • 生成Python解决方案,
  • 在沙盒内测试和确定基准,
  • 根据结构化反馈加以改进,
  • 并一起发展代码 提高质量。

MCP作为推理代理人之间的共同协议,能够结构化的协调、思考和持续创新。 这是走向自我改进人工智能系统的一个步骤。

□为什么是MCP?

传统的地方行刑(如Python REPL)带有风险和局限性:

  • ** 安全风险**: 执行主机上任意生成的代码可能导致数据泄露或系统损坏.
  • ** 孤零零零**:错误(如无限回路,回路错误)可以挂起过程.
  • ** 难以缩放**: 跨节点运行多个代理的代码需要管弦和沙箱.

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

README

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

MCP + MCTS Coding Agents

This repository contains the code and Docker setup for the O’Reilly Demo Day session:

O’Reilly Demo Day
Building Robust AI Apps and Agents with MCP


Demo Overview

This code shows how autonomous agents can use MCP not just to connect with tools but to communicate with each other.

We run a multi-agent coding system where agents collaborate by:

  • generating Python solutions,
  • testing and benchmarking them inside a sandbox,
  • refining based on structured feedback,
  • and evolving code together toward higher quality.

MCP acts as the shared protocol between reasoning agents, enabling structured coordination, reflection, and continuous innovation.
This is a step toward self-improving AI systems.

Why MCP?

Traditional local execution (like a Python REPL) comes with risks and limitations:

  • Security risks: Executing arbitrary generated code on the host machine can lead to data leaks or system damage.
  • Lack of isolation: Mistakes (e.g. infinite loops, recursion errors) can hang the process.
  • Difficult scaling: Running code on multiple agents across nodes requires orchestration and sandboxing.

MCP (Model Context Protocol) solves these problems:

  • Runs Python in Pyodide + Deno, sandboxed from the host OS.
  • Automatically installs packages into the sandbox when needed.
  • Captures stdout, stderr, and return values cleanly.
  • Works across nodes and clusters (e.g. Kubernetes with gVisor).
  • Provides a shared protocol for inter-agent communication, not just tool calls.

This makes MCP an excellent fit for multi-agent systems where reasoning agents collaborate safely.


Prerequisites

  • Docker installed (version 24+ recommended).
  • An OpenAI API key stored in a .env file.

Your .env file should look like this:

OPENAI_API_KEY=sk-...
OPENAI_MODEL=gpt-4o

Step 1: Build Docker image

The provided Dockerfile builds a container with:

  • Python 3.11 slim
  • Deno (for MCP Pyodide backend)
  • mcp-run-python, treequest, langgraph, langchain-openai, and other dependencies

Build the image:

docker build -t mcp-run-python:latest .

Step 2: Start the MCP server (stdio mode)

This runs the Python MCP server inside the container:

docker run --rm -it mcp-run-python:latest /usr/local/bin/entrypoint.sh stdio

Step 3: Run the Tree Search + MCP Demo

From the project root, run:

docker run --rm -it \
  --env-file .env \
  -v "$PWD":/app -w /app \
  mcp-run-python:latest \
  python treesearch_fib.py

This executes the LangGraph + TreeQuest + MCP sandboxed agents pipeline. The system will:

  • Iteratively generate Fibonacci implementations,
  • Run unit tests and benchmarks in the sandbox,
  • Refine the code based on structured feedback,
  • Track performance improvements step by step,
在 GitHub 查看完整 README

安装

docker run --rm -it mcp-run-python:latest /usr/local/bin/entrypoint.sh stdio
新手?先看 mcpskill.org 教程 →