Prefect with VS Code / Copilot
Connect GitHub Copilot in VS Code to Prefect’s local MCP server. This guide covers the editor, not Copilot CLI or GitHub’s cloud agent.

Before you start
Enable Copilot agent mode and MCP access in VS Code. Install uv and configure your Prefect Cloud workspace or self-hosted server on the machine where the MCP process will run. This uses standard MCP, not a dedicated Prefect plugin.
Setup
Configure your Prefect connection
Follow Prefect’s MCP guide to set your local profile or environment variables. For remote workspaces and dev containers, uv and Prefect credentials must be available in that environment.
Prefect connection setupAdd the workspace configuration
Merge this entry into .vscode/mcp.json without replacing existing servers. VS Code uses a servers key, not mcpServers. Keep credentials out of the file.
.vscode/mcp.json{ "servers": { "prefect": { "type": "stdio", "command": "uvx", "args": ["--from", "prefect-mcp", "prefect-mcp-server"] } } }Start the server and check its tools
Run MCP: List Servers from the Command Palette, select prefect, and start it. Review the trust prompt, then enable the Prefect tools in Copilot’s agent mode. Ask which Prefect target is configured and request its five most recent flow runs without changing anything.
Ask Copilot to configure the connection
Paste this into your coding agent to walk through the setup.
Help me connect GitHub Copilot in VS Code to Prefect. Read https://docs.prefect.io/v3/how-to-guides/ai/use-prefect-mcp-server and https://code.visualstudio.com/docs/agent-customization/mcp-servers first. This is the VS Code editor setup, not Copilot CLI or the cloud agent. Check for uvx and an existing .vscode/mcp.json, including whether this workspace runs remotely or in a container. Ask which Prefect Cloud workspace or self-hosted server I want. Explain the changes and ask before merging a prefect entry under servers with type stdio, command uvx, and args ["--from", "prefect-mcp", "prefect-mcp-server"]. Preserve other servers and keep credentials out of chat and version control. Help me start and approve the server, confirm the configured target, and read five recent flow runs without modifying anything.
If the connection fails
Check the server output in MCP: List Servers if tools do not appear. Verify that uvx and the intended Prefect profile are available where the server runs. Organization policy can disable MCP; a remote workspace does not automatically have your local credentials.