VS Code
VS Code runs MCP tools in Copilot Chat’s agent mode. Add MailCraft once and the agent can send and manage email while you code.
Prerequisites
- VS Code with GitHub Copilot enabled
- A MailCraft API key with the scopes you want the agent to have — create one under Settings → API keys.
Setup
- 1
Create .vscode/mcp.json
In your project root. This version prompts for the key the first time and stores it securely, so the file is safe to commit:
.vscode/mcp.json{ "inputs": [ { "type": "promptString", "id": "mailcraft-api-key", "description": "MailCraft API key", "password": true } ], "servers": { "mailcraft": { "type": "http", "url": "https://mcp.mailcraft.host", "headers": { "Authorization": "Bearer ${input:mailcraft-api-key}" } } } }VS Code uses "servers" as the top-level key, not "mcpServers". For every project, run "MCP: Open User Configuration" from the command palette and add the same server there.
- 2
Start the server
Click Start above the server in mcp.json (or run "MCP: List Servers") and paste your key when asked.
- 3
Verify the connection
Open Copilot Chat, switch to Agent mode, and ask:
copilot chatList all my MailCraft domains
Prefer signing in? Remove "headers" and "inputs" — VS Code will open a MailCraft sign-in the first time the server starts.
Example prompts
Once connected, try asking VS Code:
- Wire up a welcome email in this signup controller using MailCraft
- What bounced in the last 24 hours?
- Create a segment of contacts whose plan is pro
See every tool the agent can use in the MCP server reference.