使用说明
我的工具MCP服务器
该项目将帮助您AI为了让代理也能使用MCP服务器。
项目简介
- 专用存储库: 我的工具
- 公共存储库: 我的工具mcp服务器公共预览
使用公共和专用存储库
这个MCP服务器被设计为个人专用工具。私有存储库包含个人设置和脚本,但目前不包含机密信息,因此公共存储库也公开了部分信息。
今后的展望
今后,不是每次制作细小的工具都会制作新的服务器my-tools我们计划将各种工具集中到服务器上,并有效地管理它们。
工作备注
-
创建项目目录。
$ mkdir my-tools $ code my-tools -
MCP创建服务器。
$ npx @modelcontextprotocol/create-server time-server -
在服务器上Python添加调用脚本的工具。
index.ts编辑文件并添加以下代码:。{ name: "get_current_time", description: "Get the current time", inputSchema: { type: "object", properties: {}, required: [] } } -
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"); } });
