copilot-studio-code
copilot-studio-code
ローカルのMCPサーバーであり、Microsoft Copilot Studioエージェントにローカルファイルシステムおよびシェルに対するClaude-Codeスタイルのツール(読み取り、編集、検索、コマンド実行)をCopilot Studioのテストキャンバスから提供します。インポート可能なCopilot Studioソリューションが付属しているため、数分で動作するエージェントを構築できます。
公開されるツール
ツール | 目的 |
| UTF-8テキストファイルを読み取ります。 |
| ファイルを作成または上書きします。 |
| 文字列の完全一致置換を行います(一意の一致が必要、または |
| ディレクトリ内のエントリを一覧表示します。 |
| グロブパターンに一致するファイルを検索します。 |
| ファイル全体で正規表現検索を行います( |
| シェルコマンドを実行します(WindowsではPowerShell、それ以外ではbash)。 |
Related MCP server: Local Dev Bridge 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)This server cannot be deployed
Maintenance
Related MCP Connectors
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Manage files and folders directly from your workspace. Read and write files, list directories, cre…
Safe folder access for ChatGPT and Claude: read, write and search files, risky tools opt-in.
Persistent cloud workspaces for AI agents: run commands, edit files, use git and a browser.
Related MCP Servers
- AlicenseAqualityDmaintenanceAllows Claude to execute terminal commands on your computer and perform file system operations including surgical code editing with diff-based replacements.19348,832 npm7MIT
- AlicenseAqualityDmaintenanceProvides 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
- FlicenseAqualityDmaintenanceBridges Claude Desktop to local Windows 10 development environments to enable repository reading, documentation searching, and isolated code execution. It provides a secure interface for running allowlisted terminal commands and scripts directly through natural language.4-
- FlicenseNot gradedqualityDmaintenanceProvides filesystem access to Claude via the MCP protocol, enabling local file operations through natural language.-