SendGrid MCP serverand Python AI tasks
qbash hosts a SendGrid MCP server you can use in Claude, ChatGPT, Codex, Cursor, Grok Bot and Muse. Developers use qbash Tasks to write cloud-hosted Python functions that pair SendGrid with models such as Claude and GPT.
Add the qbash MCP
Use SendGrid from Claude Code, Codex, Cursor and other MCP clients. Connect SendGrid in qbash, and your agent can work with its data and build Tasks that call it.
claude mcp add --transport http qbash https://mcp.qbash.com/mcp
Then run /mcp in Claude Code and sign in with qbash.
- Send an email with plain text, HTML or a dynamic template
- Read delivery, open, click and bounce stats by day, week or month
- Search recent messages and their delivery events with the Email Activity API
- List dynamic templates and their versions
- List bounced addresses with the reason for each bounce
- List addresses that marked your email as spam
Write a SendGrid task in Python
A qbash Task is a Python function hosted in the cloud. Python is the runtime and defines the process, and built-in inline prompts run on leading models such as Claude, GPT, Gemini and Grok.
Run a Task on a schedule, from an HTTP request or when a connected app sends an event. Your agents and chat tools call it over MCP.
Each run is logged with its inputs and results, and you can turn data logging off for any Task. Every Task has version control, and each run is locked to the version it ran.
Send a personal welcome email to each new signup
Your signup form posts the new user to the Task's webhook. An inline prompt writes a short welcome email from their name, company and role, and SendGrid sends it.
signup = qbash.inputs.get("signup")
if signup:
body = qbash.ai.run_prompt(
slug="sendgrid-welcome-email",
variables={"signup": json.dumps(signup)},
)
sent = qbash.integrations.sendgrid.send_email(
to=signup["email"],
from_name="The founders",
subject=f"Welcome, {signup['first_name']}",
text=body,
categories=["welcome"],
)
qbash.output(sent)
else:
qbash.output("No signup in this request.")
Sample send_email response
{
"status": "success",
"message_id": "W8kZ3XoNQ0uYxq1aB2c3dA",
"accepted": true
}
Custom MCP server
Build a custom MCP server with SendGrid
Create a hosted MCP server that combines SendGrid tools with your other connectors, Tasks and memory folders. You choose each tool it exposes, so a server can share SendGrid reads with write tools left off.
Share the server with your team, and each person adds it to the client they already use.
SendGrid MCP questions
Does SendGrid have an official MCP server?
Twilio runs an official MCP server at mcp.twilio.com/docs that searches Twilio and SendGrid documentation. It does not send email or read your SendGrid account. Community SendGrid servers that send mail are self-hosted with your API key.
Can the SendGrid MCP server send email?
send_email sends plain text, HTML or a dynamic template with its data. Leave it off the server if chat users should only read stats and bounces.
What does the SendGrid connector need to connect?
A SendGrid API key. Give it Mail Send access to send email, and read access to Stats, Suppressions and Marketing for the other methods.
Related marketing connectors
Build a SendGrid task
Write it in Python with AI steps, or describe it to your coding agent through the qbash MCP.