My Tools MCP Server logo

My Tools MCP Server

by nishio

This project is an MCP server designed to make personal automation tools accessible to AI agents. It aims to centralize and efficiently manage various tools within a single server.

View on GitHub

Last updated: N/A

My Tools MCP Server

このプロジェクトは、個人の自動化ツールを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");
      }
    });