自动化工具服务器

一个用于集中管理和运行个人自动化工具的MCP服务器,支持通过AI代理调用各种脚本和工具。

  • by nishio
  • JavaScript
  • 本地部署
  • 更新于
在 GitHub 查看 nishio/my-tools-mcp-server-public-preview

使用说明

我的工具MCP服务器

该项目将帮助您AI为了让代理也能使用MCP服务器。

项目简介

使用公共和专用存储库

这个MCP服务器被设计为个人专用工具。私有存储库包含个人设置和脚本,但目前不包含机密信息,因此公共存储库也公开了部分信息。

今后的展望

今后,不是每次制作细小的工具都会制作新的服务器my-tools我们计划将各种工具集中到服务器上,并有效地管理它们。

工作备注

  1. 创建项目目录。

    $ mkdir my-tools
    $ code my-tools
    
  2. MCP创建服务器。

    $ npx @modelcontextprotocol/create-server time-server
    
  3. 在服务器上Python添加调用脚本的工具。index.ts编辑文件并添加以下代码:。

    {
      name: "get_current_time",
      description: "Get the current time",
      inputSchema: {
        type: "object",
        properties: {},
        required: []
      }
    }
    
  4. execSync来修改标记元素的显示属性Python调用脚本。

    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      switch (request.params.name) {
        case "get_current_time": {
          const output = execSync('python3 current_time.py').toString().trim();
          return {
            content: [{
              type: "text",
              text: `Current time is: ${output}`
            }]
          };
        }
        default:
          throw new Error("Unknown tool");
      }
    });