oshaani MCP Marketplace
Continue with oshaani.com

← Documentation

Gmail MCP Email

List, search and read Gmail, draft replies and (optionally) send email through your Google account connected on gsuite.oshaani.com.

1 credits / tool call

Quick start

  1. Prepare access in Gmail by following the setup guide.
  2. Add a Gmail connection with the settings below, then click Test configuration.
  3. Create an API key for your agent.
  4. Paste the key below, click Test endpoint, and copy the configuration for your platform.
Endpointhttps://market.oshaani.com/gmail (your default connection) or https://market.oshaani.com/gmail/<connection-id>
TransportStreamable HTTP (stateless, JSON responses). MCP protocol versions 2024-11-05 to 2025-11-25 and 2026-07-28.
AuthenticationAuthorization: Bearer <API key>, using a key from the API keys page.

Case study: Running user research with Oshaani →

Setup guide: connect your Gmail account

Gmail on the marketplace uses your Google account through Smart Inbox (gsuite.oshaani.com). You connect Google once there, create an API key, and paste that key into this connection. The marketplace never stores Google passwords or OAuth tokens.

Smart Inboxhttps://gsuite.oshaani.com/app
API key prefixge_

1. Sign in and connect Google

  1. Open https://gsuite.oshaani.com/app.
  2. Sign in with your Oshaani account.
  3. Click Connect Google and grant Gmail access for the mailbox agents should use.

2. Create a Smart Inbox API key

  1. On the Smart Inbox dashboard, generate an API key (or call POST /api-key while signed in).
  2. Copy the key. It starts with ge_ and is shown only once.

3. Create the marketplace connection

  1. Paste the key into Smart Inbox API key below. Leave the Smart Inbox URL as https://gsuite.oshaani.com unless you self-host it.
  2. Leave drafting and sending off until you have tested with Test configuration.
  3. When agents should draft or send, enable the matching toggles. Optionally restrict recipients to certain domains.

Agents talk to Gmail only through Smart Inbox. Revoking the API key or disconnecting Google on gsuite.oshaani.com immediately stops this connection.

Agent configuration

The default URL uses your organisation's default Gmail connection; a URL with an ID pins one connection.
Get a key
The key is filled into the snippets below. It stays in this page and is only sent with the test request.
Runs initialize and tools/list against the endpoint, exactly like an agent. No credits are charged.

Any MCP client that supports remote (Streamable HTTP) servers with custom headers.

{
  "name": "gmail",
  "transport": "streamable-http",
  "url": "https://market.oshaani.com/gmail",
  "headers": {
    "Authorization": "Bearer YOUR_API_KEY"
  }
}

Connection settings

Entered once per connection on market.oshaani.com. Secrets are encrypted and never shown again or sent to agents.

SettingTypeDescription
Smart Inbox API key
api_key required secret
string Starts with ge_. Create one at https://gsuite.oshaani.com/app after connecting Google.
Smart Inbox URL
base_url
string (uri)
default "https://gsuite.oshaani.com"
Leave as https://gsuite.oshaani.com unless you self-host Smart Inbox.
min length 1, max length 2083
Allow drafting and marking emails as read
allow_write_actions
boolean
default false
Off by default: agents can only list and read until this is enabled.
Allow sending emails and replies
allow_sending
boolean
default false
Off by default. Prefer create_draft so a person can review before anything is sent.
Allowed recipient domains
allowed_recipient_domains
string Comma-separated, e.g. acme.com,partner.com. Sending to any other domain is refused. Leave empty to allow any.

Tools (7)

list_messages read-only

List recent Gmail messages, optionally filtered with a Gmail search query

ArgumentTypeDescription
query string Optional Gmail search query
max length 500
top integer
default 25
Number of messages (max 100)
min 1, max 100

search_messages read-only

Search Gmail with a query, e.g. 'invoice from:billing@acme.com newer_than:30d'

ArgumentTypeDescription
query required string Gmail search query, e.g. is:unread from:billing@acme.com newer_than:7d
min length 1, max length 500
top integer
default 25
Number of messages (max 100)
min 1, max 100

get_message read-only

Read an email: sender, recipients, body and labels

ArgumentTypeDescription
message_id required string Gmail message id from list_messages or search_messages
pattern ^[A-Za-z0-9_\-]{6,128}$
max_body_chars integer
default 20000

min 200, max 100000

create_draft

Save a draft email in Gmail Drafts for a person to review and send

ArgumentTypeDescription
to required string
pattern ^[^@\s/\\]+@[^@\s/\\]+\.[^@\s/\\]+$
subject required string
min length 1, max length 998
body required string
min length 1, max length 200000
thread_id string
pattern ^[A-Za-z0-9_\-]{6,128}$

send_email destructive

Send an email from the connected Gmail account

ArgumentTypeDescription
to required string
pattern ^[^@\s/\\]+@[^@\s/\\]+\.[^@\s/\\]+$
subject required string
min length 1, max length 998
body required string
min length 1, max length 200000

reply_to_message destructive

Reply to an email (or reply all), threaded under the original

ArgumentTypeDescription
message_id required string Gmail message id from list_messages or search_messages
pattern ^[A-Za-z0-9_\-]{6,128}$
body required string Reply text
min length 1, max length 200000
reply_all boolean
default false

mark_as_read

Mark an email as read

ArgumentTypeDescription
message_id required string Gmail message id from list_messages or search_messages
pattern ^[A-Za-z0-9_\-]{6,128}$

Billing & errors

Each successful tool call costs 1 oshaani.com credit. initialize, tools/list, failed calls and timeouts are free.

JSON-RPC codeMeaning
-32054 (HTTP 401)Missing, unknown or revoked API key
-32053 (HTTP 404)No Gmail connection configured for your organisation, or the connection ID is wrong
-32055 (HTTP 403)Connection disabled or origin not allowed
-32052 (HTTP 429)Rate limit reached; retry after a minute
-32050Not enough oshaani.com credits for the call
-32051Billing temporarily unavailable; the call was not run

Errors from Gmail itself (bad IDs, permissions) come back as tool results with isError: true so the agent can read and correct them. See the Gmail API documentation.