loading…
Search for a command to run...
loading…
Gives a Microsoft Copilot Studio agent Claude-Code-style tools to read, edit, search, and run shell commands against your local filesystem.
Gives a Microsoft Copilot Studio agent Claude-Code-style tools to read, edit, search, and run shell commands against your local filesystem.
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.
| 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. |
| 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:
SAFETY env var (strict / moderate / open)--safety <mode> CLI flagmoderate)All write_file, edit_file, and run_shell calls are appended to <root>/.copilotstudio-mcp/audit.log.
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
Copilot Studio is cloud-hosted, so it cannot reach localhost. Use Microsoft Dev Tunnels to expose the server over HTTPS.
winget install Microsoft.devtunnel
devtunnel user login
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.
Two ways: import the prebuilt solution (fastest), or configure an agent manually.
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.
solution/CopilotStudioCode_1_0_0_0.zip. Take the defaults through the wizard.YOUR-TUNNEL-ID-PORT.YOUR-REGION.devtunnels.ms with your real dev tunnel host (e.g. abc123-8787.usw2.devtunnels.ms). Save → Update connector.The solution does not include the MCP server itself — that runs locally from this repo. The connector just points at it.
https://<your-tunnel-id>-8787.usw2.devtunnels.ms/mcp/mcp and shows the seven tools. Ensure each is enabled on the agent.Open the test canvas and try prompts like:
lint that runs tsc --noEmit."git status and 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.
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)
Add this to claude_desktop_config.json and restart Claude Desktop.
{
"mcpServers": {
"copilot-studio-code": {
"command": "npx",
"args": []
}
}
}