
本地MCP服务器以及可导入的Copilot Studio解决方案,提供Microsoft Copilot Studio代理、类似Claude代码的文件和shell工具。
概览
本地MCP服务器为Microsoft Copilot Studio代理提供类似Claude代码的工具,针对本地文件系统和shell——读取、编辑、搜索并运行Copilot Studio测试画布中的命令。自带可导入的Copilot Studio解决方案,让您几分钟内就能搭建一个可用的代理。 模式的选择方式,按优先顺序排列: 1. SAFETY 环境变量(严格/中等/开放)2.--安全CLI标志 3.启动时的交互提示(中等超时10秒→) 所有write_file、edit_file和run_shell呼号都附在 /.copilotstudio-mcp/audit.log。 Copilot Studio 是云托管的,所以无法访问本地主机。用来通过 HTTPS 暴露服务器。 devtunnel host 会打印一个公共 URL,比如 https:// -8787.usw2.devtunnels.ms。保持运行状态。 如果丢弃 ---allow-anonymous,隧道会需要 Copilot Studio 端的 MS 账户。建议在你让它正常工作后再用。 有两种方式:导入预构建的解决方案(最快),或者手动配置代理。
概述(AI 翻译)
本地MCP服务器为Microsoft Copilot Studio代理提供类似Claude代码的工具,针对本地文件系统和shell——读取、编辑、搜索并运行Copilot Studio测试画布中的命令。自带可导入的Copilot Studio解决方案,让您几分钟内就能搭建一个可用的代理。
工具暴露
| 工具 | 目的 |
|---|---|
read_file |
读取一个UTF-8文本文件。 |
write_file |
创建或覆盖文件。 |
edit_file |
精确匹配字符串替换(需要唯一匹配,或称replace_all=true)。 |
list_dir |
目录中的条目列表。 |
glob |
找到匹配球状图案的文件。 |
grep |
跨文件正则表达式搜索(跳过 node_modules、.git、dist)。 |
run_shell |
执行一个shell命令(Windows用PowerShell,别处用bash)。在strict模式下禁用。 |
安全模式(启动时选择)
| 模式 | 路径监狱 | run_shell |
|---|---|---|
strict |
强制执行 | ** 残疾** |
moderate(默认) |
强制执行 | 启用,审计记录 |
open |
关闭 | 启用,审计记录 |
模式的选择方式,按优先顺序排列:
SAFETYenv var (strict/moderate/open)
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
copilot-studio-code
A local MCP server that gives a Microsoft Copilot Studio agent Claude-Code-style tools against your local filesystem and shell — read, edit, search, and run commands from the Copilot Studio test canvas. Ships with an importable Copilot Studio solution so you can stand up a working agent in minutes.
Tools exposed
| Tool | Purpose |
|---|---|
read_file |
Read a UTF-8 text file. |
write_file |
Create or overwrite a file. |
edit_file |
Exact-match string replace (unique-match required, or replace_all=true). |
list_dir |
List entries in a directory. |
glob |
Find files matching a glob pattern. |
grep |
Regex search across files (skips node_modules, .git, dist). |
run_shell |
Execute a shell command (PowerShell on Windows, bash elsewhere). Disabled in strict mode. |
Safety modes (selected at startup)
| Mode | Path jail | run_shell |
|---|---|---|
strict |
enforced | disabled |
moderate (default) |
enforced | enabled, audit-logged |
open |
off | enabled, audit-logged |
How the mode is chosen, in order of precedence:
SAFETYenv var (strict/moderate/open)--safetyCLI flag- Interactive prompt at startup (10s timeout →
moderate)
All write_file, edit_file, and run_shell calls are appended to /.copilotstudio-mcp/audit.log.
Run it
npm install
npm start
The server prints something like:
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
Override the workspace it operates on:
$env:WORKSPACE_ROOT = "E:\Dev\some-other-project"; npm start
Wiring it into Copilot Studio
Copilot Studio is cloud-hosted, so it cannot reach localhost. Use Microsoft Dev Tunnels to expose the server over HTTPS.
1. Install and log in to dev tunnels
winget install Microsoft.devtunnel
devtunnel user login
2. Create a persistent tunnel for port 8787
devtunnel create copilotstudio-mcp --allow-anonymous
devtunnel port create copilotstudio-mcp -p 8787 --protocol http
devtunnel host copilotstudio-mcp
devtunnel host prints a public URL like https://-8787.usw2.devtunnels.ms. Leave it running.
Drop
--allow-anonymousand the tunnel will require an MS account on the Copilot Studio side. Recommended once you have it working.
3. Wire the MCP server into a Copilot Studio agent
Two ways: import the prebuilt solution (fastest), or configure an agent manually.
Path A — Import the prebuilt solution
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →