Sponsored by Deepsite.site

Google Workspace MCP Server

Created By
KaranThink419 months ago
This is G_chat Mcp server written in Ts contain various tools fetch to post.
Content

Google Workspace MCP Server

smithery badge

A Model Context Protocol (MCP) server that provides tools for interacting with Gmail and Calendar APIs. This server enables you to manage your emails and calendar events programmatically through the MCP interface.

Features

Gmail Tools

  • list_emails: List recent emails from your inbox with optional filtering
  • search_emails: Advanced email search with Gmail query syntax
  • send_email: Send new emails with support for CC and BCC
  • modify_email: Modify email labels (archive, trash, mark read/unread)

Calendar Tools

  • list_events: List upcoming calendar events with date range filtering
  • create_event: Create new calendar events with attendees
  • update_event: Update existing calendar events
  • delete_event: Delete calendar events

Prerequisites

  1. Node.js: Install Node.js version 14 or higher
  2. Google Cloud Console Setup:
    • Go to Google Cloud Console
    • Create a new project or select an existing one
    • Enable the Gmail API and Google Calendar API:
      1. Go to "APIs & Services" > "Library"
      2. Search for and enable "Gmail API"
      3. Search for and enable "Google Calendar API"
    • Set up OAuth 2.0 credentials:
      1. Go to "APIs & Services" > "Credentials"
      2. Click "Create Credentials" > "OAuth client ID"
      3. Choose "Web application"
      4. Set "Authorized redirect URIs" to include: http://localhost:3000/auth/callback
      5. Note down the Client ID and Client Secret

Installing via Smithery

Install the server using Smithery's CLI:

npx spinai-mcp install @KaranThink41/gsuite-mcp-server --provider smithery --config '{"googleClientId":"your_google_client_id","googleClientSecret":"your_google_client_secret","googleRefreshToken":"your_google_refresh_token"}'

Alternatively, you can use the following configuration:

// smithery.config.js
export default {
  KaranThink41_google_chat_mcp_server: {
    command: 'npx',
    args: [
      '-y',
      '@smithery/cli@latest',
      'run',
      '@KaranThink41/google_chat_mcp_server'
    ]
  },
};

Local Development (Optional)

If you prefer to run the server locally:

  1. Clone the repository:
git clone https://github.com/KaranThink41/Google_workspace_mcp_server.git
cd Google_workspace_mcp_server
  1. Install dependencies:
npm install
  1. Build the project:
npm run build
  1. Run the server:
node build/index.js

Usage Examples

Gmail Operations

  1. List Recent Emails:

    {
      "maxResults": 5,
      "query": "is:unread"
    }
    
  2. Search Emails:

    {
      "query": "from:example@gmail.com has:attachment",
      "maxResults": 10
    }
    
  3. Send Email:

    {
      "to": "recipient@example.com",
      "subject": "Hello",
      "body": "Message content",
      "cc": "cc@example.com",
      "bcc": "bcc@example.com"
    }
    
  4. Modify Email:

    {
      "id": "message_id",
      "addLabels": ["UNREAD"],
      "removeLabels": ["INBOX"]
    }
    

Calendar Operations

  1. List Events:

    {
      "maxResults": 10,
      "timeMin": "2024-01-01T00:00:00Z",
      "timeMax": "2024-12-31T23:59:59Z"
    }
    
  2. Create Event:

    {
      "summary": "Team Meeting",
      "location": "Conference Room",
      "description": "Weekly sync-up",
      "start": "2024-01-24T10:00:00Z",
      "end": "2024-01-24T11:00:00Z",
      "attendees": ["colleague@example.com"]
    }
    
  3. Update Event:

    {
      "eventId": "event_id",
      "summary": "Updated Meeting Title",
      "location": "Virtual",
      "start": "2024-01-24T11:00:00Z",
      "end": "2024-01-24T12:00:00Z"
    }
    
  4. Delete Event:

    {
      "eventId": "event_id"
    }
    

Troubleshooting

  1. Authentication Issues:

    • Ensure all required OAuth scopes are granted
    • Verify client ID and secret are correct
    • Check if refresh token is valid
  2. API Errors:

    • Check Google Cloud Console for API quotas and limits
    • Ensure APIs are enabled for your project
    • Verify request parameters match the required format

License

This project is licensed under the MIT License.

Google Chat MCP Server

A Model Context Protocol (MCP) server implementation for interacting with Google Chat API. This server provides tools for managing messages, spaces, and memberships in Google Chat.

Features

  • Post text messages to Google Chat spaces
  • Get space details and list spaces
  • Manage memberships (list, get member details)
  • List and retrieve messages with filtering capabilities
  • Natural language filtering support

Setup Instructions

1. Google Cloud Project Setup

  1. Go to Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable the Google Chat API
  4. Create OAuth 2.0 credentials:
    • Go to API & Services > Credentials
    • Click "Create Credentials" > OAuth client ID
    • Choose "Web application"
    • Set "Authorized redirect URIs" to include: http://localhost:3000/auth/callback
    • Note down the Client ID and Client Secret

2. Get Refresh Token

  1. Create a temporary credentials file:
cp temp-credentials.json.example temp-credentials.json
  1. Update the temp-credentials.json with your Client ID and Client Secret

  2. Run the refresh token script:

node get-refresh-token.js
  1. Follow the browser authentication flow to get the refresh token

3. Install via Smithery

Install the server using Smithery's CLI:

npx spinai-mcp install @KaranThink41/google_chat_mcp_server --provider smithery --config '{"spaceId":"your_space_id","googleClientId":"your_google_client_id","googleClientSecret":"your_google_client_secret","googleRefreshToken":"your_google_refresh_token"}'

Alternatively, you can use the following configuration:

export default {
  KaranThink41_google_chat_mcp_server: {
    command: 'npx',
    args: [
      '-y',
      '@smithery/cli@latest',
      'run',
      '@KaranThink41/google_chat_mcp_server'
    ]
  },
};

4. Local Development (Optional)

If you prefer to run the server locally:

  1. Clone the repository:
git clone https://github.com/KaranThink41/Google_chat_mcp_server.git
cd Google_chat_mcp_server
  1. Install dependencies:
npm install
  1. Build the project:
npm run build
  1. Run the server:
node build/index.js

Available Tools

Message Management

  • post_text_message: Post a text message to a Google Chat space

    {
      "method": "tools/call",
      "params": {
        "name": "post_text_message",
        "arguments": {
          "spaceId": "AAAAfkdUqxE",
          "text": "Hello, this is a test message!"
        }
      }
    }
    
  • fetch_message_details: Get detailed information about a specific message

    {
      "method": "tools/call",
      "params": {
        "name": "fetch_message_details",
        "arguments": {
          "spaceId": "AAAAfkdUqxE",
          "messageId": "cpwLU-2f_z8.cpwLU-2f_z8"
        }
      }
    }
    
  • list_space_messages: List messages in a space with optional filtering

    {
      "method": "tools/call",
      "params": {
        "name": "list_space_messages",
        "arguments": {
          "spaceId": "AAAAfkdUqxE",
          "pageSize": 10,
          "orderBy": "createTime"
        }
      }
    }
    

Space Management

  • fetch_space_details: Get comprehensive details about a space

    {
      "method": "tools/call",
      "params": {
        "name": "fetch_space_details",
        "arguments": {
          "spaceId": "AAAAfkdUqxE"
        }
      }
    }
    
  • list_joined_spaces: List all spaces the caller is a member of

    {
      "method": "tools/call",
      "params": {
        "name": "list_joined_spaces",
        "arguments": {
          "pageSize": 10
        }
      }
    }
    

Membership Management

  • list_space_memberships: List all memberships in a space

    {
      "method": "tools/call",
      "params": {
        "name": "list_space_memberships",
        "arguments": {
          "spaceId": "AAAAfkdUqxE",
          "pageSize": 10
        }
      }
    }
    
  • fetch_member_details: Get detailed information about a specific member

    {
      "method": "tools/call",
      "params": {
        "name": "fetch_member_details",
        "arguments": {
          "spaceId": "AAAAfkdUqxE",
          "memberId": "user_123"
        }
      }
    }
    

Natural Language Filtering

  • apply_natural_language_filter: Convert natural language queries into API filter strings
    {
      "method": "tools/call",
      "params": {
        "name": "apply_natural_language_filter",
        "arguments": {
          "filterText": "messages from Monday"
        }
      }
    }
    

Error Handling

The server implements proper error handling with descriptive error messages. Common errors include:

  • Authentication failures
  • Invalid space IDs
  • Rate limiting
  • API quota exceeded

Security

  • All sensitive credentials are stored in environment variables
  • OAuth refresh tokens are securely managed
  • API keys are never exposed in the code

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Playwright McpPlaywright MCP server
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Serper MCP ServerA Serper MCP Server
WindsurfThe new purpose-built IDE to harness magic
CursorThe AI Code Editor
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Amap Maps高德地图官方 MCP Server
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
ChatWiseThe second fastest AI chatbot™
DeepChatYour AI Partner on Desktop
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Tavily Mcp