Copilot Workspace MCP
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 Workspace MCPcreate hello.py in my workspace that prints Hello, world!"
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 Workspace MCP v1.3
MCP server that lets Microsoft 365 Copilot and Copilot Studio (incl. Teams) list, read and
write files in named code workspaces. Each chat keeps its own workspace, and the choice
survives server restarts (SQLite state via the built-in node:sqlite).
Quick start
npm install
Copy-Item .env.example .env # then set WORKSPACES, ALLOWED_ROOTS
npm run new-key # generates MCP_API_KEY in .env
npm run dev # http://localhost:8790/mcp
npm test # unit + end-to-end testsRequires Node.js >= 22.13. Expose port 8790 with a dev tunnel and register
https://<tunnel-host>/mcp in the client (the /mcp suffix is required).
Related MCP server: VibeBridge
Standalone executable (download, run, done)
A single-file app that sets everything up for you: no clone, no npm install, no build, no manual tunnel.
Download and run
Get the archive for your system from the latest release,
unpack it and run the executable inside. Each archive also contains a short README.txt; SHA256SUMS.txt is on the release page.
System | Archive | Run |
Windows (x64) |
| double-click |
macOS (Apple silicon / Intel) |
|
|
Linux (x64 / arm64) |
|
|
On first run it:
asks for the workspace folder to expose (default: current folder) and generates an API key, saved in
%APPDATA%\copilot-workspace-mcp\config.env(Windows) or~/.config/copilot-workspace-mcp/config.envdownloads the
devtunnelCLI into that folder if it is not on PATH, and signs you in if neededcreates a persistent tunnel (same public URL on every run), starts the server and hosts the tunnel
prints the public
https://.../mcpURL and the API key (key shown on first run or with--show-key)
A local web UI (default http://localhost:8791, loopback only) opens automatically in its own app-style window using the
installed Edge/Chrome, or the default browser if there is none (--no-ui / --no-open). It shows colour-coded live logs with
level/source/text filters, pause, clear and download, tunnel status with a restart button, Settings for every variable in
config.env (saving validates and restarts the server in place), and a Stop button. Ctrl+C, closing the console or Stop shuts
down the tunnel first, then the server, cleanly. The browser tools (browser_*) are on by default; set ENABLE_BROWSER=false to disable them.
The tunnel allows anonymous clients by default (Copilot Studio / M365 Copilot cannot sign in to a dev tunnel; the API key still
protects /mcp). Set TUNNEL_ALLOW_ANONYMOUS=false to restrict it to your own Microsoft account.
The console shows only errors and important lines (add --verbose for all dev tunnel output). Other flags:
--reconfigure, --new-key, --show-key, --no-tunnel, --no-ui, --no-open, --help. Any variable from .env.example can be
set in config.env, in a .env in the folder you start it from, or in the environment (later wins).
Build it yourself
Needs Node.js >= 24 and npm install once. The executable embeds the Node runtime of the machine (or target) it is built for.
Goal | Command | Output in |
This machine's OS/arch |
|
|
Linux x64 + arm64 |
|
|
macOS Intel + Apple silicon |
|
|
Every target |
| all of the above plus |
Any mix |
| |
Download-ready archives |
|
|
Set OUT_DIR=some/folder to write somewhere other than release/.
Building on each OS. Run npm install then npm run build:standalone on that machine. On macOS this also ad-hoc signs the binary
(codesign, built into macOS), so it can run immediately on Apple silicon.
Cross-building from one machine. Targets for another OS/arch download that platform's official Node runtime
(same version as yours, cached in .cache/node/) and inject the app into it, so you can produce Linux and macOS binaries from Windows.
Cross-built Linux and Windows binaries run as they are. Cross-built macOS binaries cannot be code-signed off a Mac, so on the Mac run
once codesign --sign - ./copilot-workspace-mcp (the release archives avoid this because CI builds them on macOS runners).
Releases. Pushing a tag such as v1.3.0 runs .github/workflows/release.yml: it builds on Windows, Linux (x64 and arm64) and macOS
(Intel and Apple silicon) runners, packages the archives with scripts/package-release.mjs, and attaches them and SHA256SUMS.txt to a GitHub release.
The same workflow can be started by hand (Actions > Release executables) to get the archives as a build artifact without a release.
How a chat's workspace is chosen
For every tool call the server resolves the workspace in this order:
workspacetool argument (alias) - used by Microsoft 365 Copilot declarative agentsthe chat's saved binding, keyed by conversation id - Copilot Studio / Teams (
conversation-idheader, orconversationIdargument set toSystem.Conversation.Id)the default workspace (
DEFAULT_WORKSPACE, orswitch_workspacewithmakeDefault)
Every file tool reply starts with [workspace: <alias>].
Client | Setup |
Copilot Studio / Teams | Import |
M365 Copilot declarative agent | Add |
MCP tools
Tool | Purpose |
| Registered workspaces, default and this chat's current one |
| Bind this chat to a workspace ( |
| Which workspace this chat uses and why |
| Register/unregister a folder (only under |
| Glob within the workspace (skips |
| Read a text file (size-capped) |
| Atomic create/overwrite; blocked in |
Optional: headless browser and command runner
Both are off by default (see .env.example).
Tool | Enabled by | Purpose |
|
| Drive a headless Edge/Chrome (one tab per chat). Screenshots are returned as images and saved under |
|
| Run allowlisted commands in a workspace root, optionally in the background (dev servers), with output capture. |
Typical flow: run_command npm run dev (background, readyText) -> browser_open the printed URL -> browser_screenshot -> browser_logs -> process_stop.
Safety: the browser only loads hosts in BROWSER_ALLOWED_HOSTS (default localhost; every sub-request and redirect is checked, file: is refused).
run_command only starts commands that begin with an allowlist entry, rejects quotes, pipes, &, ;, $, % and redirects, runs without MCP_API_KEY in its environment,
and each chat can only see and stop its own processes. Do not allowlist interpreters such as node or powershell. These tools give anyone holding the API key a way to run
your project's scripts, so keep the key private and the allowlist small. Uses playwright-core against an installed browser; no browser download.
HTTP endpoints
All except /health require the API key (api-key header, Authorization: Bearer, or ?api_key=).
Method | Path | Purpose |
GET |
| Liveness (no paths revealed) |
POST |
| MCP Streamable HTTP (stateless) |
GET / POST |
| List / register |
DELETE |
| Unregister |
GET / POST |
| Get / set default |
GET |
| Source file count |
GET |
| Recent tool calls |
API key (MCP_API_KEY)
Every request except GET /health must carry the key; without it the server returns 401.
The server refuses to start when MCP_API_KEY is empty (unless MCP_ALLOW_ANONYMOUS=true).
Generate (writes/rotates the key in
.env, prints it once):npm run new-key- or only print one:npm run new-key -- --printRestart the server (
npm run dev);.envis read at startup.Send it in one of these ways (checked in this order):
Where
Example
api-keyheader (recommended)api-key: <key>Bearer token
Authorization: Bearer <key>Query string (avoid: ends up in logs)
https://<host>/mcp?api_key=<key>Configure the clients
Copilot Studio: MCP wizard > Authentication API key > Type Header > name
api-key(or usedocs/copilot-studio-connector.yaml, which already declares it). Paste the key when creating the connection.M365 Copilot declarative agent: API key auth registered in the Teams developer portal / Agents Toolkit; the key is stored by Microsoft, not in the app package.
curl / scripts:
curl -H "api-key: $env:MCP_API_KEY" http://localhost:8790/workspaces
Rotate: npm run new-key, restart, then update the connection in each client. Never commit .env
(it is git-ignored) and never paste the key into chat prompts.
Dependencies
Versions are pinned exactly in package.json (and .npmrc sets save-exact=true). Update deliberately:
npm install <pkg>@<version>, then npm run typecheck && npm test. Check with npm run audit.
Known advisory: braces <= 3.0.3 (via fast-glob -> micromatch), CVE-2026-93687 / GHSA-vfj7-8cjw-p6xm,
has no patched release. list_files mitigates it by capping glob patterns at 512 characters and
8 nesting levels; remove this note when a fixed braces ships.
Safety
Paths are resolved inside the workspace (also through symlinks/junctions);
..and absolute paths are rejected.Writes into
.git,node_modulesor the state DB are refused; writes are atomic and size-limited.Every tool call is recorded in the audit log (no file contents). Chat bindings expire after
BINDING_TTL_DAYS(30) of inactivity; audit rows after 90 days.
Configuration
See .env.example. State DB default: %LOCALAPPDATA%\copilot-mcp\state.db.
License
MIT, see LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent cloud workspaces for AI agents: run commands, edit files, use git and a browser.
Cross-agent artifact workspace with provenance across Claude Code, Codex, Cursor, LangGraph.
Securely search and manage workspace context files for AI agents and teams.
User-owned files and explicit AI Memories for authorized assistants with scoped access.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceProvides Copilot Studio with six tools for secure workspace file operations and one-time execution of pre-approved Python jobs in isolated, network-less Docker containers, with strict access controls and audit logging.-
- AlicenseNot gradedqualityBmaintenanceEnables Gemini Spark to securely read, edit, and search a selected local workspace, execute shell commands, and integrate development tools via MCP with user approval safeguards.MIT
- AlicenseBqualityAmaintenanceEnables coding agents to build, test, ship, and manage Microsoft Copilot Studio agents from the editor, with YAML-based authoring, sync via Power Platform CLI, and API coverage for evaluations, chat, and flows.14273 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables ChatGPT to submit tasks to a single explicitly bound local Codex workspace and conversation, then retrieve execution results, file contents, and diffs through MCP tools.MIT