copilot-studio-code
copilot-studio-code
ローカルのMCPサーバーであり、Microsoft Copilot Studioエージェントにローカルファイルシステムおよびシェルに対するClaude-Codeスタイルのツール(読み取り、編集、検索、コマンド実行)をCopilot Studioのテストキャンバスから提供します。インポート可能なCopilot Studioソリューションが付属しているため、数分で動作するエージェントを構築できます。
公開されるツール
ツール | 目的 |
| UTF-8テキストファイルを読み取ります。 |
| ファイルを作成または上書きします。 |
| 文字列の完全一致置換を行います(一意の一致が必要、または |
| ディレクトリ内のエントリを一覧表示します。 |
| グロブパターンに一致するファイルを検索します。 |
| ファイル全体で正規表現検索を行います( |
| シェルコマンドを実行します(WindowsではPowerShell、それ以外ではbash)。 |
Related MCP server: ai-distiller-mcp
セキュリティモード(起動時に選択)
モード | パス制限 |
|
| 強制 | 無効 |
| 強制 | 有効、監査ログ記録 |
| オフ | 有効、監査ログ記録 |
モードの選択順序(優先度順):
SAFETY環境変数 (strict/moderate/open)--safety <mode>CLIフラグ起動時の対話型プロンプト(10秒タイムアウト →
moderate)
すべての write_file、edit_file、および run_shell の呼び出しは <root>/.copilotstudio-mcp/audit.log に追記されます。
実行方法
npm install
npm startサーバーは以下のような出力を表示します:
copilot-studio-code MCP server
workspace root : E:\Dev\projects\my-project
safety mode : moderate
listening on : http://localhost:8787/mcp
health check : http://localhost:8787/healthz操作対象のワークスペースを上書きする場合:
$env:WORKSPACE_ROOT = "E:\Dev\some-other-project"; npm startCopilot Studioへの組み込み
Copilot Studioはクラウドホスト型であるため、localhost には到達できません。Microsoft Dev Tunnels を使用して、HTTPS経由でサーバーを公開してください。
1. dev tunnelsのインストールとログイン
winget install Microsoft.devtunnel
devtunnel user login2. ポート8787用の永続的なトンネルを作成
devtunnel create copilotstudio-mcp --allow-anonymous
devtunnel port create copilotstudio-mcp -p 8787 --protocol http
devtunnel host copilotstudio-mcpdevtunnel host は https://<id>-8787.usw2.devtunnels.ms のようなパブリックURLを表示します。そのまま実行し続けてください。
--allow-anonymousを外すと、トンネルはCopilot Studio側でMSアカウントを要求するようになります。動作確認が完了したら推奨されます。
3. MCPサーバーをCopilot Studioエージェントに接続する
2つの方法があります:プリビルドソリューションをインポートする(最速)、または手動でエージェントを設定する。
パスA — プリビルドソリューションをインポートする
solution/ フォルダには、事前設定されたエージェント(生成オーケストレーション有効、コンテンツモデレーション低)、MCPサーバー用のカスタムコネクタ、およびプランナーにツールを提示する WorkspaceMCP トピックを含む、管理されていないCopilot Studioソリューションが同梱されています。
https://make.powerapps.com を開き、環境を選択 → ソリューション → ソリューションのインポート。
solution/CopilotStudioCode_1_0_0_0.zipをアップロードします。ウィザードのデフォルト設定に従ってください。インポート後、Workspace MCP カスタムコネクタを開く → 編集 → 全般 タブで、プレースホルダーホスト
YOUR-TUNNEL-ID-PORT.YOUR-REGION.devtunnels.msを実際のdev tunnelホスト(例:abc123-8787.usw2.devtunnels.ms)に置き換えます。保存 → コネクタの更新。インポートしたエージェントを開き、ステップ4(テストキャンバス)に進みます。
ソリューションにはMCPサーバー自体は含まれていません。サーバーはこのリポジトリからローカルで実行されます。コネクタは単にそれを指し示すだけです。
パスB — 手動でエージェントを設定する
Copilot Studioを開く → エージェントを選択 → ツール → + ツールを追加 → Model Context Protocol。
サーバーURL:
https://<your-tunnel-id>-8787.usw2.devtunnels.ms/mcp認証: なし(匿名トンネルの場合)または Microsoft Entra(認証が必要な場合)。
保存。Copilot Studioが
/mcpからツールリストを取得し、7つのツールを表示します。それぞれがエージェントで有効になっていることを確認してください。設定 → 生成AI → オーケストレーション: 生成; コンテンツモデレーション: 低。生成オーケストレーションがないと、プランナーはMCPツールをディスパッチしません。
4. テストキャンバスからテストする
テストキャンバスを開き、以下のようなプロンプトを試してください:
"List the files in the workspace root."
"Read package.json and tell me what scripts are defined."
"Add a new script called
lintthat runstsc --noEmit.""Run
git statusand summarize the result."
エージェントは src/tools.ts 内の記述から名前でツールを選択します。エージェントが誤ったツールを選択する場合は、それらの記述を調整してください。
プロジェクト構成
src/ the MCP server (TypeScript)
index.ts entry: safety prompt + boot
server.ts express + Streamable HTTP MCP transport
tools.ts the seven tool registrations
safety.ts mode definitions
paths.ts workspace-root path jail
audit.ts JSONL audit log
solution/ importable Copilot Studio solution
CopilotStudioCode_1_0_0_0.zip agent + connector + topics (unmanaged)Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Connect ChatGPT, Claude, Cursor or VS Code to your Windows PC: files, terminal, browser, apps.
Use your own Windows, Mac or Linux computer from ChatGPT, Claude, Cursor or Gemini CLI: run commands, read, write and search files, run long processes. Your computer only makes an outgoing connection (no open ports or VPN). Read-only mode, allowed folders, blocked commands and an action log keep you in control. Free plan available.
Your own computer's files from ChatGPT or Claude: folder rules, confirmations and undo.
Related MCP Servers
- AlicenseAqualityBmaintenanceProvides Claude Desktop with direct access to your local file system for development tasks, enabling file operations (read, write, edit), directory browsing, command execution, and codebase search within a configured projects directory.6MIT
- FlicenseNot gradedqualityDmaintenanceProvides filesystem access to Claude via the MCP protocol, enabling local file operations through natural language.-
- FlicenseBqualityDmaintenanceEnables local file reading and writing for your project via Claude Desktop, with tools to read, write, and list files in a specified root path.71-
- FlicenseNot gradedqualityBmaintenanceEnables Claude Desktop or other MCP clients to execute shell commands, read/write files, and list directories on the local machine. Includes basic safety guardrails to block obviously destructive operations.-