Microsoft 365 MCP サーバー用の CLI
💡説明
現在、これは進行中の作業であり、解決策というよりも POC です。
📦 前提条件
- Node.js 20.x 以上
🚀 ビルドと実行方法
まず最初にnpm install
実行して、すべての依存関係をインストールします。
次に、プロジェクトをビルドするために次のコマンドを実行します。
この MCP サーバーはnpm i -g @pnp/cli-microsoft365
を使用してグローバルにインストールする必要がある、グローバルにインストールされたMicrosoft 365 用の CLIを使用します。
MCPサーバーは認証を行いません。まず、 m365 login
コマンドを使用してMicrosoft 365のCLIで認証する必要があります。認証が完了すると、MCPサーバーはどのツールを実行する際にも同じ認証コンテキストを使用します。
インスペクタを使用してMCPを実行する
Microsoft 365 MCP サーバーの CLI をテストする方法の一つは、 MCP Inspectorを使用することです。まず、次のコマンドを使用して MCP サーバーを起動します。
MCP サーバーのインスペクターを実行するには、リポジトリのルート フォルダーの場所で次のコマンドを実行する必要があります。
その後、インスペクターが起動するのを待ち、ブラウザでインスペクターを開きます。MCPサーバーが稼働していることが確認でき、ツールをクエリしてローカルで実行できるはずです。
VS CodeでMCPを実行する
GitHub Copilot Agent で使用できるように、ローカルビルドから VS Code で MCP サーバーを実行することもできます。まず、以下のコマンドを使用して Microsoft 365 MCP サーバーの CLI を起動します。
VS CodeのGitHub Copilot Agentモードに移動し、ツールアイコンをクリックしてAdd more tools
を選択します。次にAdd MCP server
を選択し、 Command (stdio)
選択して、以下のコマンドを入力します。
Enterキーを押して、好きな名前を付けてください。テストのためにworkspace
スコープに追加することをお勧めします。その後.vscode/mcp.json
ファイルを開き、認証に必要な環境変数を渡すように修正してください。
「開始」をクリックすると、GitHub Copilot Agent に358個の新しいツールが追加されます。ぜひお試しください。最良の結果を得るには、AIモデルとしてClaude 3.5 Sonnet
使用することをお勧めします。
🔗 リソース
local-only server
The server can only run on the client's local machine because it depends on local resources.
GitHub Copilot Agent を介して Microsoft 365 コマンドの CLI を実行できるようにする MCP サーバー。これにより、ユーザーは自然言語を使用して Microsoft 365 サービスを操作できるようになります。
Related MCP Servers
- AsecurityFlicenseAqualityThe Git MCP Server allows AI assistants to perform enhanced Git operations via the Model Context Protocol, supporting core Git functions, branch and tag management, GitHub integration, and more.Last updated -21466TypeScript
- AsecurityFlicenseAqualityAn MCP server that provides seamless interaction with Azure DevOps Git repositories, enabling users to manage repositories, branches, pull requests, and pipelines through natural language.Last updated -823TypeScript
- -securityAlicense-qualityAn MCP server that wraps around the GitHub CLI tool, allowing AI assistants to interact with GitHub repositories through commands for pull requests, issues, and repository operations.Last updated -5TypeScriptMIT License
- AsecurityFlicenseAqualityA powerful MCP server that enables AI assistants to interact with Microsoft Graph API for managing Outlook emails, Calendar events, OneDrive files, and Contacts through natural language commands.Last updated -208Python