gw-server
Provides tools for interacting with Gmail, including searching, reading, sending, replying, managing drafts, modifying labels, listing labels, and retrieving attachments.
Provides tools for interacting with Google Workspace services through Google APIs, covering Gmail, Drive, Calendar, Docs, Sheets, Slides, Chat, Tasks, and Contacts, plus a generic gapi tool for any Google REST endpoint.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@gw-serverfind my unread emails from this week"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
$ curl -s https://your-domain/mcp \
-H "Authorization: Bearer $GW_TOKEN" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | jq '.result.tools | length'
45Forty-five tools. Gmail, Drive, Calendar, Docs, Sheets, Slides, Chat, Tasks and Contacts — discovered and called directly by your AI client. No SDK, no googleapis, no browser on the server.
What is this
gw-server turns Google Workspace into MCP
tools. It holds the OAuth tokens server-side, refreshes them automatically,
and speaks Streamable HTTP — so any MCP client wires up with one URL and one
bearer token, and immediately gets 45 named tools plus a generic escape hatch
for any Google REST endpoint.
Related MCP server: Google Tools MCP Server
Why gw-server
Headless OAuth. Start a login from the server, open the link on your phone, consent — tokens land on the server. The host never needs a browser.
Everything is a tool. 45 named tools across nine Google services, plus
gapi, a generic escape hatch for any Google REST endpoint.One secret for clients. Clients store a URL and a bearer token — Google credentials never leave the server.
Boring to run. Pure Python (FastAPI + the official MCP SDK), one
uvproject, one systemd unit, Caddy for TLS.
The tools
Group | Tools |
core (3) |
|
gmail (10) |
|
drive (10) |
|
calendar (6) |
|
docs (3) |
|
sheets (4) |
|
slides (1) |
|
chat (3) |
|
tasks (4) |
|
people (1) |
|
Multi-account built in: pass email to pick an account, omit it when only one
is signed in.
Quick start
git clone https://github.com/trtyr/gw-server && cd gw-server
uv sync
export GW_TOKEN=$(openssl rand -hex 32) # client bearer, required
uv run gw-server # listens on 127.0.0.1:8787Wire up any MCP client:
{
"mcpServers": {
"gw": {
"url": "http://127.0.0.1:8787/mcp",
"auth": "bearer",
"bearerToken": "<GW_TOKEN>"
}
}
}Login, from anywhere
curl -H "Authorization: Bearer $GW_TOKEN" \
"http://127.0.0.1:8787/oauth/login?email=you@gmail.com"The response contains a Google consent URL. Open it on any device, approve, and the token lands on the server via the OAuth callback — no browser needed on the host, tokens never pass through your client. Refreshes are automatic.
Production
A hardened deployment is ~30 minutes: Caddy in front for TLS, the server as a
systemd unit behind it, GW_PUBLIC_URL set to your domain, and your MCP
client pointed at https://<your-domain>/mcp.
The full walkthrough — systemd unit, Caddyfile, firewall rules, a 中文版 — is in docs/deployment.zh.md.
License
This server cannot be deployed
Maintenance
Related MCP Connectors
Gmail, Outlook, Drive, OneDrive and calendars for AI agents. Many accounts, one endpoint, audit log.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Permissioned access to Gmail, Drive and Calendar via the user's own Google account
Hosted MCP server with managed OAuth for 15+ toolkits: Google Workspace, Fitbit, Oura, Kalshi, etc.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides comprehensive natural language control over Google Workspace services including Gmail, Drive, Calendar, Docs, Sheets, Slides, Forms, Tasks, and Chat. Features multi-user OAuth 2.1 support, flexible tool tiers, and seamless integration with AI assistants.843MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with Google Workspace services (Gmail, Drive, Docs, Tasks, Calendar) through OAuth 2.0 authentication, providing 25+ operations for business automation and productivity.1-
- AlicenseBqualityDmaintenanceConnects AI assistants to Google Workspace (Gmail, Drive, Docs, Sheets, Slides, Calendar, Tasks, Forms, Chat, Contacts) through your own OAuth app, providing around 120 tools for managing email, files, calendar, and more.100MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server that exposes 17 Google Workspace APIs (e.g., Gmail, Drive, Calendar) as auto-generated tools for AI assistants, enabling natural language control of Google services.-