Poke Google Docs MCP
A remote MCP server that lets your Poke agent create and edit Google Docs.
README
Poke ↔ Google Docs MCP
A remote MCP server that lets your Poke agent create and edit Google Docs. Built with Python + FastMCP, deployable to Render in a few minutes, and structured so you can extend it to Sheets, Drive, and other Google APIs.
Auth model: single-tenant per deployment. You (or anyone who forks this) bring your own Google OAuth client and mint your own refresh token. There's no shared multi-user server to run — clone it, plug in your credentials, deploy.
Tools
| Tool | What it does |
|---|---|
create_document(title, content="") |
Create a new Doc, optionally with starting text. Returns its ID + edit URL. |
read_document(document_id) |
Return the document's title and plain-text body. |
append_text(document_id, text) |
Add text to the end of a Doc. |
insert_text(document_id, text, index=1) |
Insert text at a character index (1 = start). |
replace_text(document_id, find, replace, match_case=False) |
Find & replace all occurrences. |
A document ID is the long string in a Doc's URL:
https://docs.google.com/document/d/THIS_PART/edit.
Setup
1. Google Cloud: create OAuth credentials
- Go to the Google Cloud Console and create (or pick) a project.
- APIs & Services → Library → enable the Google Docs API. (Enable Google Sheets API / Google Drive API here too if you extend later.)
- APIs & Services → OAuth consent screen:
- User type: External.
- Fill in app name + your email.
- Under Test users, add your own Google address. (In "Testing" mode the refresh token works indefinitely for test users.)
- APIs & Services → Credentials → Create Credentials → OAuth client ID:
- Application type: Desktop app.
- Download the JSON, rename it to
client_secret.json, and put it in this project's root folder.
2. Mint your refresh token (one time, local)
pip install -r requirements.txt
python setup_auth.py
A browser opens — sign in and approve. The script prints:
GOOGLE_CLIENT_ID=...
GOOGLE_CLIENT_SECRET=...
GOOGLE_REFRESH_TOKEN=...
Keep these secret.
3. Generate an API key for Poke
This protects your public server URL so only Poke can use it:
python -c "import secrets; print(secrets.token_urlsafe(32))"
Save the output as MCP_API_KEY.
4. Deploy to Render
Fork this repo first (so the env vars are yours), then click the button on your fork's README — or do it manually:
- Push this repo to your own GitHub.
- In Render: New → Blueprint (it auto-detects
render.yaml) or New → Web Service, and connect your repo. - Add these environment variables (Environment tab):
GOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRETGOOGLE_REFRESH_TOKENMCP_API_KEY
- Deploy. Your server is at
https://<your-service>.onrender.com/mcp.
Render's free tier sleeps when idle, so the first request after a pause has a cold-start delay of ~30s. Upgrade the plan if that bothers you.
5. Connect it to Poke
In Poke → Settings → Integrations → Connect MCP (or poke.com/settings/connections):
- URL:
https://<your-service>.onrender.com/mcp— ⚠️ the/mcpsuffix is required. The bare domain (https://<your-service>.onrender.com) has nothing listening on it and Poke will reject it with "Invalid MCP server URL." - API Key: the
MCP_API_KEYfrom step 3.
Then ask Poke something like: "Create a Google Doc called 'Weekly Plan' and add a heading and three bullet points."
Troubleshooting
Poke says "Invalid MCP server URL. Please check your URL and try again."
You almost certainly left off the /mcp path. Use
https://<your-service>.onrender.com/mcp, not the bare domain.
Verify the server yourself (replace the URL and key). A GET returns
405 Method Not Allowed — that's correct, MCP only accepts POST:
# Should print: HTTP 405, allow: POST, DELETE
curl -i https://<your-service>.onrender.com/mcp
# Full handshake — should return HTTP 200 and serverInfo "Google Docs MCP":
curl -i -X POST https://<your-service>.onrender.com/mcp \
-H "Authorization: Bearer <MCP_API_KEY>" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"curl","version":"1.0"}}}'
404on the root (/) is normal — only/mcpis mounted.401/auth errors → theAuthorization: Bearerkey doesn't match theMCP_API_KEYset in Render's Environment tab.- First request after the server's been idle takes ~30s (free-tier cold start); retry if Poke times out.
- If the handshake fails entirely, check the Render dashboard: the latest deploy should be Live and all 4 env vars must be set.
Run locally
cp .env.example .env # fill in the values from setup_auth.py
# load .env into your shell, then:
python src/server.py # serves http://localhost:8000/mcp
To expose a local server to Poke for testing, tunnel it with e.g.
ngrok http 8000 and give Poke the https://…/mcp URL.
Extending to Sheets, Drive, etc.
The codebase is built for this:
- Add the scope in
src/config.py(e.g. uncomment the Sheets scope) and re-runpython setup_auth.pyto get a token with the new permission. - Enable the API in Google Cloud (e.g. Google Sheets API).
- Add a client helper in
src/google_client.py:def sheets_service(): return get_service("sheets", "v4") - Copy
src/tools/docs.py→src/tools/sheets.py, write aregister_sheets_tools(mcp)with your new@mcp.tool()functions. - Register it in
src/server.py:from tools.sheets import register_sheets_tools register_sheets_tools(mcp)
Every tool just needs the @require_auth decorator (under @mcp.tool()) to stay
protected by your API key.
How it works / security notes
- Transport: streamable HTTP at
/mcp, stateless — the format Poke expects. - MCP auth: every tool checks
Authorization: Bearer <MCP_API_KEY>via the@require_authdecorator. IfMCP_API_KEYis unset, auth is disabled — only do that locally. - Google auth: a long-lived refresh token (yours) is exchanged for short-lived
access tokens automatically by
google-auth. - Secrets live in env vars only.
.gitignoreexcludes.env,client_secret.json, andtoken.jsonso they never reach git.
Project layout
setup_auth.py # one-time: mint your refresh token
render.yaml # Render deploy config
requirements.txt
.env.example
src/
server.py # FastMCP app + HTTP transport; registers tool modules
config.py # OAuth scopes (single source of truth)
auth.py # Bearer-token check for the MCP server (@require_auth)
google_client.py # builds cached, auto-refreshing Google API clients
tools/
docs.py # Google Docs tools (template for new services)
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.