This document describes the Dynobox MCP server so external agents can connect and automate inbox workflows on top of Dynobox.
- Transport: JSON-RPC 2.0 over HTTP POST
- MCP endpoint:
http://localhost:3001/api/mcp - Metadata endpoint:
http://localhost:3001/api/mcp/metadata - Protocol version:
2024-11-05 - Batch JSON-RPC requests: not supported
The MCP server is available through the existing Dynobox backend process.
Dynobox may require these headers depending on environment:
x-account-id: required when multiple accounts are configured.x-dynobox-key: required only ifDYNOBOX_API_KEYis set on the server.
By default Dynobox only accepts loopback clients unless ALLOW_REMOTE_CLIENT=true.
- Call
initialize - Call
tools/list - Optionally call
tools/callwithdynobox_list_accountsto resolve account IDs - Call
tools/callfor operational tools
Request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {},
"clientInfo": {
"name": "my-agent",
"version": "1.0.0"
}
}
}Request:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/list",
"params": {}
}Request:
{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "dynobox_search_threads",
"arguments": {
"accountId": "you@example.com",
"query": "invoice OR receipt",
"unreadOnly": true,
"label": "INBOX",
"maxResults": 10
}
}
}List configured Dynobox accounts.
Arguments: none
List recent threads for an account.
Arguments:
accountId?: stringquery?: stringlabel?: string(defaultINBOX)labelId?: stringpageToken?: stringmaxResults?: number(1-25)fast?: boolean
Search threads using query and structured filters.
Arguments:
accountId?: stringquery?: stringunreadOnly?: booleanfrom?: stringto?: stringsubject?: stringlabel?: stringmaxResults?: number(1-25)pageToken?: string
Filter threads by label/mailbox and optional unread/sender/recipient fields.
Arguments:
accountId?: stringlabel?: stringlabelId?: stringunreadOnly?: booleanfrom?: stringto?: stringmaxResults?: number(1-25)pageToken?: string
Fetch full thread content/messages.
Arguments:
threadId: string(required)accountId?: string
Send message or reply through the target account provider.
Arguments:
accountId?: stringto: string(required)cc?: stringbcc?: stringsubject?: stringbody: string(required)isHtml?: booleanthreadId?: stringinReplyTo?: stringreferences?: stringattachments?: Array<{ filename?: string; mimeType?: string; data?: string }>
Apply thread actions.
Arguments:
accountId?: stringthreadId: string(required)action: "archive" | "trash" | "untrash" | "markRead" | "markUnread" | "star"
List Gmail labels.
Arguments:
accountId?: stringincludeStats?: boolean
Add/remove labels on a Gmail thread.
Arguments:
accountId?: stringthreadId: string(required)addLabelIds?: string[]removeLabelIds?: string[]
At least one of addLabelIds or removeLabelIds is required.
List Google contacts.
Arguments:
accountId?: string
Get Gmail profile information.
Arguments:
accountId?: string
Successful tool responses are returned in MCP-compatible format with content and structuredContent.
If a tool fails, Dynobox returns result.isError = true and a textual error message in result.content.
Set shell vars first:
export DYNOBOX_MCP_URL="http://localhost:3001/api/mcp"
export DYNOBOX_ACCOUNT_ID="you@example.com"
# Optional only if DYNOBOX_API_KEY is enabled on server:
# export DYNOBOX_API_KEY="your-shared-key"Initialize:
curl -sS "$DYNOBOX_MCP_URL" \
-H "Content-Type: application/json" \
-H "x-account-id: $DYNOBOX_ACCOUNT_ID" \
${DYNOBOX_API_KEY:+-H "x-dynobox-key: $DYNOBOX_API_KEY"} \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"cli-agent","version":"1.0.0"}}}'List tools:
curl -sS "$DYNOBOX_MCP_URL" \
-H "Content-Type: application/json" \
-H "x-account-id: $DYNOBOX_ACCOUNT_ID" \
${DYNOBOX_API_KEY:+-H "x-dynobox-key: $DYNOBOX_API_KEY"} \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'Search unread invoices:
curl -sS "$DYNOBOX_MCP_URL" \
-H "Content-Type: application/json" \
-H "x-account-id: $DYNOBOX_ACCOUNT_ID" \
${DYNOBOX_API_KEY:+-H "x-dynobox-key: $DYNOBOX_API_KEY"} \
-d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"dynobox_search_threads","arguments":{"accountId":"'"$DYNOBOX_ACCOUNT_ID"'","query":"invoice OR receipt","unreadOnly":true,"label":"INBOX","maxResults":10}}}'Send a message:
curl -sS "$DYNOBOX_MCP_URL" \
-H "Content-Type: application/json" \
-H "x-account-id: $DYNOBOX_ACCOUNT_ID" \
${DYNOBOX_API_KEY:+-H "x-dynobox-key: $DYNOBOX_API_KEY"} \
-d '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"dynobox_send_message","arguments":{"accountId":"'"$DYNOBOX_ACCOUNT_ID"'","to":"recipient@example.com","subject":"Hello from Dynobox MCP","body":"Quick test from an agent."}}}'GET /api/mcp/metadata returns server name/version, endpoint URLs, required headers, and tool summaries. Agents can use this to auto-configure.