Send from a client · Updated 2026-09-22
Send email from VS Code and GitHub Copilot
To send email from VS Code and GitHub Copilot, add the AgentiSend MCP server with the config below, give it an API key that carries a budget, and ask Copilot to send.
To send email from VS Code and GitHub Copilot, add the AgentiSend MCP server with the config below, give it an API key that carries a budget, and ask Copilot to send. Copilot's agent mode and VS Code read the same workspace file. They then call the same API your own code calls. The ceiling is checked before the message is accepted, and a refusal comes back with a fix that names the next call.
Add the server
Paste this into the workspace. It is the same object the console install dialog copies, so the file and the dialog cannot drift apart. There is no separate Copilot connector: Copilot uses this VS Code config.
{
"servers": {
"agentisend": {
"url": "https://api.agentisend.com/mcp",
"headers": {
"Authorization": "Bearer as_YOUR_API_KEY_HERE"
}
}
}
}Paste into .vscode/mcp.json in your workspace (VS Code 1.99+; also reachable via MCP: Add Server).
Replace the placeholder with a key you created for this agent. A command that writes the same server is on the MCP guide. This block is the file VS Code reads.
Give the key a budget it cannot raise
Create the key with permission sending_access. It can send, and it can read the messages that key sent. It cannot create another key, edit a limit, or approve a send it was told to hold.
Set the ceiling with PATCH /limits/keys/{id}: budget_per_period, period (hourly, daily or monthly) and rate_ceiling_per_minute. Read it back with GET /limits/keys/{id}. The agent holds the sending key. Only a person, in the console, can raise the ceiling. A spent budget refuses the send. Nothing is queued and nothing is charged.
What the agent can and cannot do
It can call POST /emails and GET /emails/{id}. It cannot raise budget_per_period. There is no request an agent can make that lifts its own ceiling. A looping send is held for a person rather than dropped. GET /agent-actions lists it, and a person uses POST /agent-actions/{id}/approve or POST /agent-actions/{id}/reject. The key that asked cannot approve itself.
Stop one key with POST /limits/keys/{id}/kill, or every key with POST /limits/kill-all. Nothing resumes until a person does it. Longer versions: Budgets and the kill switch and Approvals.
What a refusal looks like
A send past the budget answers with code, message, fix and docs_url. The fix names the call.
{
"error": {
"code": "agent_budget_exceeded",
"message": "Key budget for the current period is exhausted.",
"fix": "Wait for the period to reset. get_agent_budget and GET /limits/keys/:id both say when. Raising a budget is a person's decision, made in the console; a key cannot raise its own.",
"docs_url": "https://agentisend.com/docs/errors",
"retryable": false
}
}retryable is false, so a client that reads the field stops instead of spinning. If the key has been paused, the code is kill_switch_active and the fix names GET /trust/standing. Report that to a person. Do not route around it.
Next
- Email for AI agents names every control and the request that calls it.
- Email guardrails maps the usual checklist onto these same fields.
- The MCP guide has the install line for every client, including VS Code.