- Home
- MCP servers
- Google Docs
Google Docs
- typescript
2
GitHub Stars
typescript
Language
5 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"jasonwong-servicedirect-google-docs-mcp-shared": {
"command": "node",
"args": [
"./dist/server.js"
],
"env": {
"token.json": "token.json",
"credentials.json": "credentials.json"
}
}
}
}This MCP server connects Claude Desktop and other MCP clients to Google Docs and Google Drive, enabling you to read, create, edit, format, and manage documents and folders through AI-assisted commands. It provides secure authentication, supports shared drives, and is designed to work seamlessly with MCP clients for automated document workflows.
How to use
You interact with the server through an MCP client by naming the server (for example, googledocs_mcp) and calling its available endpoints to read, write, format, and organize Google Docs and Drive items. Use the server to read documents, append or insert text, apply formatting, create tables, manage folders, and perform file operations like move, copy, rename, or delete. When you want to work with a Google Drive folder or a shared drive, specify the drive or folder identifiers to target the correct location. For shared drives, ensure you have access and use the driveId where required to operate within that shared space.
How to install
Prerequisites you need before installing: Node.js (version 18 or higher) and npm, Git, a Google account, and basic command line familiarity. You'll also optionally install Claude Desktop if you want to connect this server to Claude.
Step by step setup flow you should follow exactly:
- Set up Google Cloud project and credentials to authorize API access. 2. Clone the server repository to your development machine. 3. Place the downloaded credentials.json file in the project folder. 4. Install dependencies with npm install. 5. Build the TypeScript source with npm run build. 6. Run the compiled server once to authorize with Google and generate token.json. 7. Verify token.json exists and protect it.
Additional sections
Configuration and security details are provided here for your convenience. You will enable Google Docs and Drive APIs, configure OAuth consent, and create OAuth client credentials for a desktop application. After configuring credentials, you will obtain a credentials.json file (renamed to credentials.json) and place it in the project root so the server can authenticate against Google APIs.
The first time you run the server, you will authenticate via a browser prompt. You copy the authorization code from the browser redirect URL and paste it back into the terminal to complete the authorization. A token.json file will be created, which stores the authorization grant for subsequent runs.
Claude Desktop can be configured to start the server automatically. You add an MCP configuration entry that points to the compiled server script, ensuring you provide the absolute path to dist/server.js and use an explicit command to launch the process.
Security notes: keep credentials.json and token.json secure and never commit them to version control. The project includes a .gitignore file that helps prevent accidental exposure.
If you run into issues, verify absolute paths, ensure build completes successfully, and review logs for errors. The troubleshooting steps emphasize checking the path, build output, and the runtime command used to start the server.
Security & token storage
The server stores the Google authorization token (token.json) in the project folder for simplicity during setup. Treat credentials.json and token.json like sensitive secrets and avoid committing them to public repositories. The included .gitignore file helps prevent accidental exposure.
Troubleshooting
If the MCP client reports failures to attach or connect, double-check the absolute path used in your configuration, confirm that the build produced the dist/server.js file, and try running the server command manually to observe any errors. Review logs from the MCP client for additional clues.
Available tools
readGoogleDoc
Read document contents as plain text, JSON structure, or markdown.
appendToGoogleDoc
Append text to the end of a Google Document.
insertText
Insert text at a specific position within a document.
deleteRange
Delete content from a document within a specified range.
applyTextStyle
Apply rich text styling (bold, italic, color, etc.).
applyParagraphStyle
Adjust paragraph formatting such as alignment and spacing.
formatMatchingText
Format text that matches a given content string (legacy support).
insertTable
Create and insert a table into a document.
insertPageBreak
Insert a page break at a specified location.
fixListFormatting
Automatically detect and fix list formatting.
listGoogleDocs
List documents in Google Drive or specified corpora.
searchGoogleDocs
Search documents across Drive or all accessible drives.
getDocumentInfo
Retrieve detailed metadata about a document.
createFolder
Create a new folder in Google Drive.
listFolderContents
List the contents of a folder in Drive.
getFolderInfo
Get metadata for a Drive folder.
moveFile
Move a file to a new location in Drive.
copyFile
Copy a file within Drive.
renameFile
Rename a Drive file.
deleteFile
Delete a Drive file.
createDocument
Create a new Google Doc.
createFromTemplate
Create a document from a template.