Building and customizing solutions using Microsoft 365 Copilot APIs and tools
Yes—deploy the MCP server as a remote Cloudflare Worker/Agent using Streamable HTTP, then connect VS Code to its public HTTPS endpoint through .vscode/mcp.json. Cloudflare documents remote MCP hosting on Workers, while VS Code supports remote MCP servers over Streamable HTTP; SSE remains available only for legacy compatibility.^1^^2^
Deploy and connect
- Create the server
- Follow Cloudflare’s remote MCP server guide.
- Implement the tools, prompts, or resources that VS Code Copilot should access.
- Use Streamable HTTP, not local
stdio, because the server will run remotely. - Deploy it as a Cloudflare Worker and record the resulting MCP endpoint.
- Configure VS Code In your repository, create
.vscode/mcp.json:
VS Code uses{ "servers": { "cloudflare-mcp": { "type": "http", "url": "${input:mcp-url}" } }, "inputs": [ { "type": "promptString", "id": "mcp-url", "description": "Cloudflare MCP endpoint" } ] }type: "http"for Streamable HTTP remote servers.^2^ You can alternatively press Ctrl+Shift+P → MCP: Add Server → HTTP or Server Sent Events, paste the deployed endpoint, name it, and choose workspace or global configuration.^3^ - Verify the connection
- Open GitHub Copilot Chat and select Agent mode.
- Run MCP: List Servers from the Command Palette.
- Select
cloudflare-mcpand start it if necessary. - Open the tools picker and enable the tools exposed by your server.^4^
Authentication
For a private server, do not embed permanent secrets directly in a repository’s mcp.json.
VS Code supports MCP authentication with OAuth and has built-in support for GitHub and Microsoft Entra ID. For other identity providers, VS Code supports OAuth 2.1/2.0 and begins with Dynamic Client Registration, falling back to client credentials when necessary.^2^
If using static API-token headers instead, collect the token as a password input and pass it in the header expected by your Worker:
{
"servers": {
"cloudflare-mcp": {
"type": "http",
"url": "${input:mcp-url}",
"headers": {
"Authorization": "Bearer ${input:mcp-token}"
}
}
}
}
Define mcp-token as a promptString input with "password": true. The exact authorization header and validation logic must match the authentication implemented by your Cloudflare Worker.
Important distinction
The MCP server extends GitHub Copilot in VS Code with tools and context. It is separate from deploying your application code to Cloudflare: the same repository may contain both, but the application deployment and MCP server deployment are independent services.
References