Skip to content

Commit 7265a15

Browse files
committed
Add e2a integration
e2a is an authenticated email gateway for AI agents — SPF/DKIM-verified inbound, optional human-in-the-loop approval before outbound mail ships. Distributed as an MCP stdio server via npx -y @e2a/mcp-server, exposing 11 tools for inbox management, threaded replies, and HITL approval flows. Source: https://github.com/Mnexa-AI/e2a/tree/main/mcp npm: https://www.npmjs.com/package/@e2a/mcp-server
1 parent 8374299 commit 7265a15

2 files changed

Lines changed: 165 additions & 0 deletions

File tree

docs/integrations/assets/e2a.png

11.4 KB
Loading

docs/integrations/e2a.md

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
---
2+
catalog_title: e2a
3+
catalog_description: Authenticated email inboxes for AI agents with SPF/DKIM verification and human-in-the-loop approval
4+
catalog_icon: /integrations/assets/e2a.png
5+
catalog_tags: ["mcp"]
6+
---
7+
8+
# e2a MCP tool for ADK
9+
10+
<div class="language-support-tag">
11+
<span class="lst-supported">Supported in ADK</span><span class="lst-python">Python</span><span class="lst-typescript">TypeScript</span>
12+
</div>
13+
14+
The [e2a MCP Server](https://github.com/Mnexa-AI/e2a/tree/main/mcp) connects
15+
your ADK agent to [e2a](https://e2a.dev), an authenticated email gateway
16+
built for AI agents. Inbound mail is SPF/DKIM-verified before it reaches
17+
your agent. Outbound mail can be held for human approval before it ships.
18+
19+
## Use cases
20+
21+
- **Give agents their own inboxes**: Provision dedicated email addresses
22+
(e.g. `support-bot@your-domain.com`) and let agents send and receive
23+
mail just like a teammate.
24+
25+
- **Authenticated inbound**: Every incoming message arrives with SPF and
26+
DKIM verification results so your agent knows whether the sender is who
27+
they claim to be.
28+
29+
- **Human-in-the-loop approval**: Configure HITL on any agent and
30+
outbound messages are held in a pending queue until a reviewer
31+
approves them — optionally with edits to subject, body, or recipients
32+
before sending.
33+
34+
- **Automate threaded conversations**: Reply to received emails with
35+
proper In-Reply-To and References headers preserved, so threads stay
36+
intact across multiple turns.
37+
38+
## Prerequisites
39+
40+
- A free [e2a account](https://e2a.dev) and an API key from the dashboard.
41+
- Node.js 18+ on the machine running the agent (the MCP server is
42+
distributed via `npx -y @e2a/mcp-server`).
43+
44+
## Use with agent
45+
46+
=== "Python"
47+
48+
=== "Local MCP Server"
49+
50+
```python
51+
from google.adk.agents import Agent
52+
from google.adk.tools.mcp_tool import McpToolset
53+
from google.adk.tools.mcp_tool.mcp_session_manager import StdioConnectionParams
54+
from mcp import StdioServerParameters
55+
56+
E2A_API_KEY = "YOUR_E2A_API_KEY"
57+
E2A_AGENT_EMAIL = "your-bot@your-domain.com" # optional default inbox
58+
59+
root_agent = Agent(
60+
model="gemini-flash-latest",
61+
name="e2a_agent",
62+
instruction=(
63+
"You manage email through the e2a tools. Call whoami once "
64+
"to find your inbox address. Use list_messages and "
65+
"get_message to read; use reply_to_message (not "
66+
"send_email) when replying to an existing thread so "
67+
"threading headers are preserved."
68+
),
69+
tools=[
70+
McpToolset(
71+
connection_params=StdioConnectionParams(
72+
server_params=StdioServerParameters(
73+
command="npx",
74+
args=["-y", "@e2a/mcp-server"],
75+
env={
76+
"E2A_API_KEY": E2A_API_KEY,
77+
"E2A_AGENT_EMAIL": E2A_AGENT_EMAIL,
78+
},
79+
),
80+
timeout=30,
81+
),
82+
)
83+
],
84+
)
85+
```
86+
87+
=== "TypeScript"
88+
89+
=== "Local MCP Server"
90+
91+
```typescript
92+
import { LlmAgent, MCPToolset } from "@google/adk";
93+
94+
const E2A_API_KEY = "YOUR_E2A_API_KEY";
95+
const E2A_AGENT_EMAIL = "your-bot@your-domain.com"; // optional default inbox
96+
97+
const rootAgent = new LlmAgent({
98+
model: "gemini-flash-latest",
99+
name: "e2a_agent",
100+
instruction:
101+
"You manage email through the e2a tools. Call whoami once " +
102+
"to find your inbox address. Use list_messages and " +
103+
"get_message to read; use reply_to_message (not " +
104+
"send_email) when replying to an existing thread so " +
105+
"threading headers are preserved.",
106+
tools: [
107+
new MCPToolset({
108+
type: "StdioConnectionParams",
109+
serverParams: {
110+
command: "npx",
111+
args: ["-y", "@e2a/mcp-server"],
112+
env: {
113+
E2A_API_KEY: E2A_API_KEY,
114+
E2A_AGENT_EMAIL: E2A_AGENT_EMAIL,
115+
},
116+
},
117+
}),
118+
],
119+
});
120+
121+
export { rootAgent };
122+
```
123+
124+
## Available tools
125+
126+
### Identity
127+
128+
Tool | Description
129+
---- | -----------
130+
`whoami` | Return the default agent's full record (requires `E2A_AGENT_EMAIL`)
131+
`list_agents` | List every agent inbox owned by the authenticated user
132+
`create_agent` | Register a new inbox using a slug on the shared domain; defaults to `local` mode so the agent receives mail by polling — no webhook required
133+
134+
### Messages
135+
136+
Tool | Description
137+
---- | -----------
138+
`send_email` | Send a new email; returns `status: pending_approval` instead of `sent` when HITL is enabled
139+
`reply_to_message` | Reply to an inbound message; preserves In-Reply-To and References headers
140+
`list_messages` | List inbound mail with `status` filter (unread / read / all) and pagination
141+
`get_message` | Fetch full body, headers, and attachment metadata for one message
142+
143+
### Human-in-the-loop approval
144+
145+
Tool | Description
146+
---- | -----------
147+
`list_pending_messages` | List outbound mail awaiting human approval, soonest-expiring first
148+
`get_pending_message` | Get the full draft (subject, recipients, body) of a pending message
149+
`approve_pending_message` | Send a held message, optionally with reviewer edits (subject / body / recipients)
150+
`reject_pending_message` | Discard a held message; optional `reason` stored for audit
151+
152+
## Configuration
153+
154+
Variable | Required | Default | Description
155+
-------- | -------- | ------- | -----------
156+
`E2A_API_KEY` | Yes | — | Your e2a API key
157+
`E2A_AGENT_EMAIL` | No | — | Default agent inbox; scopes tools so the LLM doesn't repeat the address on every call
158+
`E2A_BASE_URL` | No | `https://e2a.dev` | Self-hosted deployment URL
159+
160+
## Additional resources
161+
162+
- [e2a MCP Server source](https://github.com/Mnexa-AI/e2a/tree/main/mcp)
163+
- [Runnable ADK example](https://github.com/Mnexa-AI/e2a/tree/main/mcp/examples/adk)
164+
- [e2a documentation](https://e2a.dev)
165+
- [npm package](https://www.npmjs.com/package/@e2a/mcp-server)

0 commit comments

Comments
 (0)