copilot-studio-code
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@copilot-studio-codeList the files in the workspace root."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 a UTF-8 text file. |
| Create or overwrite a file. |
| Exact-match string replace (unique-match required, or |
| List entries in a directory. |
| Find files matching a glob pattern. |
| Regex search across files (skips |
| Execute a shell command (PowerShell on Windows, bash elsewhere). Disabled in |
Related MCP server: Local Dev Bridge MCP
Safety modes (selected at startup)
Mode | Path jail |
|
| enforced | disabled |
| enforced | enabled, audit-logged |
| off | enabled, audit-logged |
How the mode is chosen, in order of precedence:
SAFETYenv var (strict/moderate/open)--safety <mode>CLI flagInteractive 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 startThe 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/healthzOverride the workspace it operates on:
$env:WORKSPACE_ROOT = "E:\Dev\some-other-project"; npm startWiring 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 login2. 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-mcpdevtunnel 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/mcpAuthentication: 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)This server cannot be deployed
Maintenance
Related MCP Connectors
Manage files and folders directly from your workspace. Read and write files, list directories, cre…
Path-scoped team memories, rules and skills for Claude Code, Cursor, Codex and other MCP clients.
Cross-agent artifact workspace with provenance across Claude Code, Codex, Cursor, LangGraph.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
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.19156,453 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.-