copilot-studio-code
Gives a Microsoft Copilot Studio agent Claude-Code-style tools to read, edit, search, and run shell commands against your local filesystem.
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)--safety <mode>CLI flag- Interactive prompt at startup (10s timeout →
moderate)
All write_file, edit_file, and run_shell calls are appended to <root>/.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://<id>-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
The solution/ folder ships an unmanaged Copilot Studio solution containing a pre-configured agent (generative orchestration on, content moderation low), a custom connector for the MCP server, and a WorkspaceMCP topic that surfaces the tools to the planner.
- Open https://make.powerapps.com → your environment → Solutions → Import solution.
- Upload
solution/CopilotStudioCode_1_0_0_0.zip. Take the defaults through the wizard. - Once imported, open the Workspace MCP custom connector → Edit → on the General tab, replace the placeholder host
YOUR-TUNNEL-ID-PORT.YOUR-REGION.devtunnels.mswith your real dev tunnel host (e.g.abc123-8787.usw2.devtunnels.ms). Save → Update connector. - Open the imported agent and skip to step 4 (test canvas).
The solution does not include the MCP server itself — that runs locally from this repo. The connector just points at it.
Path B — Configure an agent manually
- Open Copilot Studio → your agent → Tools → + Add a tool → Model Context Protocol.
- Server URL:
https://<your-tunnel-id>-8787.usw2.devtunnels.ms/mcp - Authentication: None (for the anonymous tunnel) or Microsoft Entra (for an authenticated one).
- Save. Copilot Studio fetches the tool list from
/mcpand shows the seven tools. Ensure each is enabled on the agent. - Settings → Generative AI → Orchestration: Generative; content moderation: Low. Without generative orchestration the planner won't dispatch MCP tools.
4. Test it from the test canvas
Open the test canvas and try prompts like:
- "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."
The agent picks tools by name from the descriptions in src/tools.ts — tighten those descriptions if the agent picks the wrong tool.
Project layout
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)
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。