@ashokpokharel977/mcp-server-gsuite
v0.0.4
Published
MCP server for interacting with Google Drive, Sheets, and Docs
Maintainers
Readme
mcp-server-gsuite
MCP server for interacting with Google Drive, Sheets, and Docs. This package provides a TypeScript/JavaScript interface for Google Workspace services with rich formatting support.
Features
Google Drive Operations
- Search and list files
- Create and update files
- Create and manage folders
- Read file metadata and content
- Support for file permissions
Google Docs Operations
- Create documents with rich formatting
- Update document content
- Support for cover pages, headers, footers
- Text styling and formatting
Google Sheets Operations
- Create spreadsheets
- Read and write cell values
- Format cells (colors, fonts, borders)
- Row and column operations (insert, delete, resize)
- Cell merging
Installation
npm install @ashokpokharel977/mcp-server-gsuiteSetup
- Create a new Google Cloud project
- Enable the Google Drive API
- Configure an OAuth consent screen
- Add required OAuth scopes:
https://www.googleapis.com/auth/drive.file- Create, update and read files created by the apphttps://www.googleapis.com/auth/drive.metadata.readonly- View file metadatahttps://www.googleapis.com/auth/documents- Create and edit Google Docshttps://www.googleapis.com/auth/spreadsheets- Create and edit Google Sheets
- Create an OAuth Client ID for application type "Desktop App"
- Download the OAuth keys JSON file
Usage
Docker Usage
Authentication:
docker run -i --rm \
--mount type=bind,source=/path/to/oauth-keys.json,target=/app/oauth-keys.json \
-v mcp-gsuite:/app/credentials \
-e GOOGLE_OAUTH_PATH=/app/oauth-keys.json \
-e GOOGLE_CREDENTIALS_PATH=/app/credentials/credentials.json \
-p 3000:3000 \
@ashokpokharel977/mcp-server-gsuite authServer configuration:
{
"mcpServers": {
"gsuite": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v", "mcp-gsuite:/app/credentials",
"-e", "GOOGLE_CREDENTIALS_PATH=/app/credentials/credentials.json",
"@ashokpokharel977/mcp-server-gsuite"
]
}
}
}NPX Usage
{
"mcpServers": {
"gsuite": {
"command": "npx",
"args": [
"-y",
"@ashokpokharel977/mcp-server-gsuite"
],
"env": {
"GOOGLE_CREDENTIALS_PATH": "/path/to/credentials.json",
"GOOGLE_OAUTH_PATH": "/path/to/oauth-keys.json"
}
}
}
}MCP Inspector usage
- Running Local
npx @modelcontextprotocol/inspector node dist/index.js -e GOOGLE_CREDENTIALS_PATH="$HOME/.google/server-creds.json" -e GOOGLE_OAUTH_PATH="$HOME/.google/oauth.keys.json"- Running Remote
npx @modelcontextprotocol/inspector npx @ashokpokharel977/mcp-server-gsuite -e GOOGLE_CREDENTIALS_PATH="$HOME/.google/server-creds.json" -e GOOGLE_OAUTH_PATH="$HOME/.google/oauth.keys.json"Development
Prerequisites
- Node.js >= 18
- npm
Setup
- Clone the repository:
git clone https://github.com/ashokpokharel977/mcp-gsuite.git
cd mcp-gsuite- Install dependencies:
npm install- Build the project:
npm run buildAvailable Scripts
npm run clean- Clean build artifactsnpm run build- Build the projectnpm run dev- Run in development mode with hot reloadnpm start- Start the servernpm run auth- Run authentication flow
Continuous Integration
The project uses GitHub Actions for CI/CD:
CI Workflow: Runs on every push and pull request to the main branch
- Builds the project
- Runs type checks
- Tests against Node.js 18.x and 20.x
Publish Workflow: Automatically publishes to NPM when a new release is created
- Requires
NPM_TOKENsecret to be set in repository settings
- Requires
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Publishing
To publish a new version:
- Update version in
package.json - Create and push a new tag:
git tag v0.0.1
git push origin v0.0.1- Create a new release on GitHub
- The publish workflow will automatically publish to NPM
License
This project is licensed under the MIT License - see the LICENSE file for details.
