Add policy enforcement to GitHub Copilot in VS Code in one line.
Config file: .vscode/mcp.json (workspace) or user profile mcp.json
VS Code uses servers instead of mcpServers. The type field is required.
A standard MCP server in your VS Code config -- no controls.
{
"servers": {
"github": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_..."
}
}
}
} Wrap the server command with Intercept. Same config structure, policy enforced.
{
"servers": {
"github": {
"type": "stdio",
"command": "npx",
"args": [
"-y", "@policylayer/intercept",
"-c", "policy.yaml",
"--",
"npx", "-y", "@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_..."
}
}
}
} version: "1"
default: deny
tools:
list_customers:
rules:
- action: allow
rate_limit: 30/minute
create_refund:
rules:
- name: "daily cap"
rate_limit: 10/day
delete_repository:
rules:
- action: deny