ryanzq26/gchat-mcp
If you are the rightful owner of gchat-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
MCP server for Google Chat integration with Claude Code, enabling interaction with Google Chat through natural language.
Google Chat MCP Server
MCP server for Google Chat integration with Claude Code. Read and write messages, manage spaces, and interact with your Google Chat conversations through natural language.
Features
Spaces: List, create, update, delete, setup with members Messages: List, send, reply, update, delete Members: List, add, update roles, remove Reactions: Add, list, remove emoji reactions Events & Attachments: View space events and attachment details
Quick Start
Prerequisites
- Node.js 18+
- Google Cloud Project with Chat API enabled
- OAuth 2.0 credentials
Installation
-
Get Google OAuth Credentials
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Google Chat API:
- Navigate to "APIs & Services" > "Library"
- Search for "Google Chat API"
- Click "Enable"
- Configure OAuth consent screen (if not already done):
- Go to "APIs & Services" > "OAuth consent screen"
- Choose "External" user type and click "Create"
- Fill in required fields (App name, User support email, Developer email)
- Click "Save and Continue" through the scopes and test users sections
- Create OAuth credentials:
- Go to "APIs & Services" > "Credentials"
- Click "Create Credentials" > "OAuth client ID"
- Choose "Desktop app" as the application type
- Click "Create" and download the JSON file
- Save it as
credentials.jsonin this project's root directory
-
Install and Build
npm install npm run build -
Authenticate
node scripts/authenticate.jsThis opens your browser for Google sign-in and saves the token.
-
Add to Claude Code
claude mcp add-json gchat-mcp '{"command": "node", "args": ["/absolute/path/to/gchat-mcp/build/index.js"], "env": {}}'Replace
/absolute/path/to/gchat-mcpwith the actual path to this project.
Usage
Chat naturally with Claude:
- "Show me all my Google Chat spaces"
- "Send a message to spaces/AAAAAAAAAAA saying 'Hello team!'"
- "List the latest messages in my Project Team space"
- "Add a 👍 reaction to the last message"
- "Who are the members of this space?"
API Reference
Spaces (8 tools)
list_spaces
List all accessible spaces.
pageSize(optional): Max results (default: 100)filter(optional): e.g.,'spaceType = "SPACE"'
get_space
Get space details.
spaceName(required): e.g.,'spaces/AAAAAAAAAAA'
create_space
Create a new space.
displayName(required)spaceType(optional):'SPACE','GROUP_CHAT', or'DM'externalUserAllowed(optional): booleanspaceThreadingState(optional):'THREADED_MESSAGES','GROUPED_MESSAGES', or'UNTHREADED_MESSAGES'
update_space
Update space settings.
spaceName(required)displayName(optional)spaceDetails(optional): Description text
delete_space
Delete a space.
spaceName(required)
setup_space
Create space and add members in one operation.
displayName(required)memberEmails(required): Array of email addresses
find_direct_message
Find existing DM with a user.
userName(required): e.g.,'users/USER_ID'
complete_import_space
Finalize space import.
spaceName(required)
Messages (6 tools)
list_messages
List messages in a space.
spaceName(required)pageSize(optional): Max results (default: 50)
get_message
Get a specific message.
messageName(required): e.g.,'spaces/SPACE_ID/messages/MESSAGE_ID'
send_message
Send a message.
spaceName(required)text(required)threadKey(optional): Thread identifier
reply_to_message
Reply to a message.
spaceName(required)messageId(required)text(required)
update_message
Edit a message.
messageName(required)text(required)
delete_message
Delete a message.
messageName(required)
Members (5 tools)
list_members
List space members.
spaceName(required)pageSize(optional): Max results (default: 100)
get_member
Get member details.
memberName(required): e.g.,'spaces/SPACE_ID/members/MEMBER_ID'
create_member
Add a member.
spaceName(required)memberName(required): e.g.,'users/USER_ID'role(optional):'ROLE_MEMBER'or'ROLE_MANAGER'(default:'ROLE_MEMBER')
update_member
Change member role.
memberName(required)role(required):'ROLE_MEMBER'or'ROLE_MANAGER'
delete_member
Remove a member.
memberName(required)
Reactions (3 tools)
create_reaction
Add emoji reaction.
messageName(required)emoji(required): e.g.,'👍'or':thumbsup:'
list_reactions
List all reactions on a message.
messageName(required)pageSize(optional): Max results (default: 100)
delete_reaction
Remove a reaction.
reactionName(required): e.g.,'spaces/SPACE_ID/messages/MESSAGE_ID/reactions/REACTION_ID'
Attachments & Events (3 tools)
get_attachment
Get attachment details.
attachmentName(required): e.g.,'spaces/SPACE_ID/messages/MESSAGE_ID/attachments/ATTACHMENT_ID'
get_space_event
Get event details.
eventName(required): e.g.,'spaces/SPACE_ID/spaceEvents/EVENT_ID'
list_space_events
List space events.
spaceName(required)pageSize(optional): Max results (default: 100)filter(optional): Filter expression
Troubleshooting
Token file not found
Run: node scripts/authenticate.js
Invalid credentials
Ensure credentials.json is from a Google Cloud Project with Chat API enabled
Authentication errors after scope changes
Delete token.json and re-run authentication
API errors Verify Google Chat API is enabled in your Google Cloud Project
Security
- Never commit
credentials.jsonortoken.jsonto version control - Both files are in
.gitignoreby default - Treat tokens like passwords - they grant full access to your Google Chat data
License
MIT