展示HN:PolyMCP – 一个用于构建和协调MCP代理的框架

2作者: justvugg大约 1 个月前原帖
大家好, 我一直在开发 PolyMCP,这是一个开源框架,用于使用模型上下文协议(MCP)构建和编排代理。 目前围绕 MCP 的工具大多集中在工具的暴露上。而这次,PolyMCP 的重点是代理:如何构建它们,将它们连接到多个 MCP 服务器,并确保它们在实际工作流程中可靠。 PolyMCP 提供了: - 一种在 Python 或 TypeScript 中定义兼容 MCP 的工具服务器的简洁方式 - 一种代理抽象,可以连接到多个 MCP 端点(标准输入输出、HTTP 等) - 内置的编排原语,用于多步骤任务 - 一个命令行工具,用于快速搭建项目并运行检查器用户界面,以调试工具和代理交互 - 模块化结构,使得在项目之间组合技能和重用组件变得更加容易 主要目标是使代理系统不再是临时拼凑的。PolyMCP 提供了一种结构化的方法,避免了为每个模型 + 工具组合编写粘合代码: - 注册工具作为 MCP 服务器 - 将它们连接到一个或多个代理 - 控制执行流程和状态 - 检查和调试交互 该项目采用 MIT 许可证,旨在为开发者构建现实世界的自动化、内部助手或多工具助手提供支持。 我非常希望能收到以下方面的反馈: - 代理抽象:是否过于主观,或者不够主观? - 多代理设置的编排模式 - 开发者体验(命令行工具、检查器、项目布局) 欢迎随时提问。
查看原文
Hi everyone,<p>I’ve been working on PolyMCP, an open-source framework for building and orchestrating agents using the Model Context Protocol (MCP).<p>Most of the tooling around MCP focuses on exposing tools. With PolyMCP, the focus this time is on agents: how to structure them, connect them to multiple MCP servers, and make them reliable in real workflows.<p>PolyMCP provides: • A clean way to define MCP-compatible tool servers in Python or TypeScript • An agent abstraction that can connect to multiple MCP endpoints (stdio, HTTP, etc.) • Built-in orchestration primitives for multi-step tasks • A CLI to scaffold projects and run an inspector UI to debug tools and agent interactions • A modular structure that makes it easier to compose skills and reuse components across projects<p>The main goal is to make agent systems less ad-hoc. Instead of writing glue code around each model + tool combination, PolyMCP gives you a structured way to: • Register tools as MCP servers • Connect them to one or more agents • Control execution flow and state • Inspect and debug interactions<p>It’s MIT licensed and intended for developers building real-world automation, internal copilots, or multi-tool assistants.<p>I’d love feedback on: • The agent abstraction: is it too opinionated or not opinionated enough? • Orchestration patterns for multi-agent setups • Developer experience (CLI, inspector, project layout)<p>Happy to answer questions.