LW MCP Agents

by Autumn-AIs

Integrations

  • Provides web search capabilities through Brave's search engine, allowing agents to retrieve information from the internet

🚀 LW MCP 代理

LW MCP Agents是一个轻量级的模块化框架,用于使用**模型上下文协议 (MCP)**构建和编排 AI 代理。它使您能够快速设计多代理系统,其中每个代理都可以进行专门化、协作、委托和推理,而无需编写复杂的编排逻辑。

仅使用配置文件构建可扩展、可组合的 AI 系统。


🔍 为什么要使用 LW MCP 代理?

  • 即插即用代理:使用简单的 JSON 配置启动零样板的智能代理。
  • 多代理编排:将代理链接在一起以解决复杂的任务 - 无需额外的代码。
  • 共享和重用:轻松跨环境分发和运行代理配置。
  • MCP-Native :与任何 MCP 兼容平台无缝集成,包括 Claude Desktop。

🧠 您可以构建什么?

  • 总结文档或搜索网络的研究代理
  • 将任务委托给特定领域代理的协调器
  • 递归扩展推理并动态聚合能力的系统

🏗️ 架构概览


📚 目录


🚀 入门

🔧 安装

git clone https://github.com/Autumn-AIs/LW-MCP-agents.git cd LW-MCP-agents python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate pip install -r requirements.txt

▶️ 运行你的第一个代理

python src/agent/agent_runner.py --config examples/base_agent/base_agent_config.json

🤖 尝试多代理设置

终端 1(研究代理服务器):

python src/agent/agent_runner.py --config examples/orchestrator_researcher/research_agent_config.json --server-mode

终端 2(Orchestrator 代理):

python src/agent/agent_runner.py --config examples/orchestrator_researcher/master_orchestrator_config.json

您的协调器现在可以智能地将研究任务委托给研究代理。


🖥️ Claude 桌面集成

配置代理在Claude Desktop内运行:

1. 找到您的 Claude 配置文件:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. 在mcpServers下添加您的代理:

{ "mcpServers": { "research-agent": { "command": "/bin/bash", "args": ["-c", "/path/to/venv/bin/python /path/to/agent_runner.py --config=/path/to/agent_config.json --server-mode"], "env": { "PYTHONPATH": "/path/to/project", "PATH": "/path/to/venv/bin:/usr/local/bin:/usr/bin" } } } }

📦示例代理

  • 基础代理
    通过 MCP 连接到工具的最小代理。
    📁 examples/base_agent/
  • 策划者+研究员
    展示分层委托和能力共享。
    📁 examples/orchestrator_researcher/

💡**贡献你自己的示例!**提交 PR 或联系维护人员。


⚙️ 运行代理

🔹基本命令

python src/agent/agent_runner.py --config <your_config.json>

🔸 高级选项

选项描述
--server-mode将代理公开为 MCP 服务器
--server-name分配自定义 MCP 服务器名称

🛠️ 自定义代理创建

🧱 最小配置

{ "agent_name": "my-agent", "llm_provider": "groq", "llm_api_key": "YOUR_API_KEY", "server_mode": false }

🧠 添加功能

定义代理可以推理的专门函数:

"capabilities": [ { "name": "summarize_document", "description": "Summarize a document in a concise way", "input_schema": { "type": "object", "properties": { "document_text": { "type": "string" }, "max_length": { "type": "integer", "default": 200 } }, "required": ["document_text"] }, "prompt_template": "Summarize the following document in {max_length} words:\n\n{document_text}" } ]

🔄 Orchestrator 代理

{ "agent_name": "master-orchestrator", "servers": { "research-agent": { "command": "python", "args": ["src/agent/agent_runner.py", "--config=research_agent_config.json", "--server-mode"] } } }

🧬 工作原理

🧩 能力作为推理单元

每个功能:

  1. 使用提供的参数填写提示
  2. 使用 LLM 执行内部推理
  3. 使用工具或外部代理
  4. 返回结果

📖 研究示例

[INFO] agent:master-orchestrator - Executing tool: research_topic [INFO] agent:research-agent - Using tool: brave_web_search [INFO] agent:research-agent - Finished capability: research_topic

🧱 技术架构

🧠 关键组件

成分角色
AgentServer启动、配置并运行代理
MCPServerWrapper包裹代理以将其暴露在 MCP 上
CapabilityRegistry从配置中加载推理任务
ToolRegistry发现其他代理的工具

🌐 架构亮点

  • 分层设计:用递归推理组成代理系统
  • 委派功能:代理智能地委派给同行
  • 工具共享:一个代理中可用的工具可供其他代理使用
  • 无代码组合:通过配置创建整个系统

🙌 致谢

该项目从 LastMile AI 在mcp-agents上的出色工作中汲取了灵感。

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

通过模型上下文协议构建和协调 AI 代理的轻量级框架,使用户能够仅使用配置文件创建可扩展的多代理系统。

  1. 🔍 为什么要使用 LW MCP 代理?
    1. 🧠 您可以构建什么?
      1. 🏗️ 架构概览
        1. 📚 目录
          1. 🚀 入门
            1. 🔧 安装
            2. ▶️ 运行你的第一个代理
            3. 🤖 尝试多代理设置
            4. 🖥️ Claude 桌面集成
          2. 📦示例代理
            1. ⚙️ 运行代理
              1. 🔹基本命令
              2. 🔸 高级选项
            2. 🛠️ 自定义代理创建
              1. 🧱 最小配置
              2. 🧠 添加功能
              3. 🔄 Orchestrator 代理
            3. 🧬 工作原理
              1. 🧩 能力作为推理单元
              2. 📖 研究示例
            4. 🧱 技术架构
              1. 🧠 关键组件
              2. 🌐 架构亮点
            5. 🙌 致谢

              Related MCP Servers

              • -
                security
                F
                license
                -
                quality
                A comprehensive suite of Model Context Protocol servers designed to extend AI agent Claude's capabilities with integrations for knowledge management, reasoning, advanced search, news access, and workspace tools.
                Last updated -
                5
                TypeScript
                • Apple
              • -
                security
                F
                license
                -
                quality
                A Model Context Protocol server that enables role-based context management for AI agents, allowing users to establish specific instructions, maintain partitioned memory, and adapt tone for different agent roles in their system.
                Last updated -
                TypeScript
              • -
                security
                A
                license
                -
                quality
                A Model Context Protocol server that allows AI assistants to interact with the Neuro-Symbolic Autonomy Framework, enabling capabilities like running NSAF evolution with customizable parameters and comparing different agent architectures.
                Last updated -
                Python
                MIT License
                • Apple
              • -
                security
                A
                license
                -
                quality
                A Model Context Protocol server that provides AI agents with secure access to local filesystem operations, enabling reading, writing, and managing files through a standardized interface.
                Last updated -
                14
                1
                TypeScript
                Apache 2.0

              View all related MCP servers

              ID: bepukxvwgc