远程工具集成框架

WUZHI MCP是一个允许AI代理无缝集成远程服务器工具与本地工具的开发框架,适用于需要混合调用远程和本地服务的自动化场景。

  • by Wuzhi-Ai
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 Wuzhi-Ai/wuzhi-mcp

使用说明

吴志刚

此存储库演示了WUZHI代理如何无缝地使用远程MCP服务器工具和本地工具。

该代理是使用以下方式构建的 @wuzhi-ai/wuzhi.

入门指南

  1. 克隆存储库:

    git clone https://github.com/wuzhi-ai/wuzhi-mcp.git
    cd wuzhi-mcp
    
  2. 安装依赖项:

    npm install
    
  3. 配置环境变量:

    • 复制 .env.example 到 .env:

      cp .env.example .env
      
    • 在中填写API密钥 .env:

      • ANTHROPIC_API_KEY:人工智能代理的Anthropic API密钥。
  4. 运行代码:

    npm start
    

概述

此存储库包含以下文件:

  • src/agent.ts:定义代理及其功能。
  • src/app.ts:将快速“远程”服务设置为MCP服务器的网关
  • src/index.ts:运行示例的编排功能
  • src/server.ts:创建MCP服务器
  • tests/index.test.ts:包含应用程序的测试用例。

这种结构确保了模块化和清晰性,使其易于扩展和维护。

示例输出

Server is running on http://localhost:3000
Available tools: getLocation, getWeather
AI: I'll help you find out the weather in your current location. First, I'll retrieve your location and then check the weather for you.
AI: Now, I'll fetch the current weather for New York:
AI: Based on the results, the current weather in your location (New York) is sunny. It looks like a nice day outside!