CloudProductivitySuite_IntegratedAPI_Node
A centralized Node.js service facilitating synchronous and asynchronous manipulation of user data across Gmail and Google Calendar via their respective APIs, designed to streamline task automation and information retrieval.
Author

KaranThink41
Quick Info
Actions
Tags
Integrated Workspace Toolkit for Cloud Services
This Model Context Protocol (MCP) endpoint furnishes developers with a unified toolkit for programmatically engaging with core Google Workspace functionalities, specifically managing electronic mail (via Gmail API) and scheduling (via Calendar API).
Core Functionalities
Electronic Mail Management
fetch_mail_stream: Retrieve a list of messages from the inbox, supporting sophisticated filtering syntax.execute_advanced_search: Perform targeted queries against mail archives using Gmail's DSL.dispatch_electronic_message: Formulate and transmit new correspondence, including optional recipients for carbon copy (CC) and blind carbon copy (BCC).amend_message_metadata: Update message status, such as archiving, marking as read/unread, or moving to trash.
Scheduling & Event Coordination
query_upcoming_events: Fetch scheduled appointments within specified temporal boundaries.schedule_new_occurrence: Book novel calendar entries, specifying participants and location details.revise_existing_event: Modify parameters of a pre-existing calendar item.nullify_calendar_item: Remove a scheduled event from the calendar.
Deployment Prerequisites
- Runtime Environment: Node.js execution environment, version 14 or newer.
- Google Cloud Project Configuration:
- Access the Google Cloud Console.
- Establish or select your designated project.
- Activate necessary APIs:
- Navigate to 'APIs & Services' > 'API Library'.
- Locate and enable the 'Gmail API'.
- Locate and enable the 'Google Calendar API'.
- Configure OAuth 2.0 Authorization:
- Navigate to 'APIs & Services' > 'Credentials'.
- Initiate 'Create Credentials' > 'OAuth client ID'.
- Select 'Web application' as the application type.
- Ensure the following callback URI is listed:
http://localhost:3000/auth/callback. - Securely record the generated Client ID and Client Secret.
Installation via Smithery Platform
Deploy the server using the Smithery command-line interface:
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, configure deployment via smithery.config.js:
// smithery.config.js
export default {
WorkspaceToolkit_NodeServer: {
command: 'npx',
args: [
'-y',
'@smithery/cli@latest',
'run',
'@KaranThink41/google_chat_mcp_server'
]
},
};
On-Premise Execution (For Development)
If local execution is preferred:
- Obtain the source code:
git clone https://github.com/KaranThink41/Google_workspace_mcp_server.git
cd Google_workspace_mcp_server
- Resolve dependencies:
npm install
- Compile assets:
npm run build
- Initiate the server process:
node build/index.js
Operational Examples
Mailbox Actions
-
Retrieving Latest Correspondence:
json { "maxResults": 5, "query": "is:unread" } -
Targeted Message Lookup:
json { "query": "from:example@gmail.com has:attachment", "maxResults": 10 } -
Transmitting Mail:
json { "to": "recipient@example.com", "subject": "Greetings", "body": "Body of the communication", "cc": "cc@example.com", "bcc": "bcc@example.com" } -
Adjusting Message Tags:
json { "id": "message_id", "addLabels": ["UNREAD"], "removeLabels": ["INBOX"] }
Scheduling Actions
-
Viewing Future Commitments:
json { "maxResults": 10, "timeMin": "2024-01-01T00:00:00Z", "timeMax": "2024-12-31T23:59:59Z" } -
Booking a New Appointment:
json { "summary": "Project Review Session", "location": "Virtual Link", "description": "Weekly review of project milestones", "start": "2024-01-24T10:00:00Z", "end": "2024-01-24T11:00:00Z", "attendees": ["colleague@example.com"] } -
Modifying an Existing Slot:
json { "eventId": "event_id", "summary": "Revised Session Title", "location": "Physical Room", "start": "2024-01-24T11:00:00Z", "end": "2024-01-24T12:00:00Z" } -
Cancelling an Entry:
json { "eventId": "event_id" }
Diagnostics and Issue Resolution
- Authorization Failures:
- Verify necessary API permissions (scopes) are granted.
- Confirm the accuracy of the client credentials.
-
Validate the freshness/status of the refresh token.
-
API Service Rejections:
- Consult the Google Cloud Console for current API utilization quotas and constraints.
- Ensure the required backend services are explicitly enabled.
- Cross-reference input payload structure against API specifications.
Licensing
This software is distributed under the MIT License terms.
Google Chat Interface Module
This section details a separate, bundled MCP server implementation dedicated to managing interactions within the Google Chat API environment. It supports operations involving messages, designated chat areas (spaces), and participant rosters.
Chat Module Capabilities
- Transmitting formatted textual content to designated Chat areas.
- Retrieving metadata for specific spaces and enumerating known spaces.
- Roster administration (listing participants, fetching individual participant profiles).
- Message history retrieval with advanced filtering options.
- Translation of plain language requests into effective search parameters.
Implementation Steps
Phase 1: Cloud Project Configuration
- Access Google Cloud Console.
- Select or provision a suitable project.
- Enable the Google Chat API.
- Establish OAuth 2.0 Credentials:
- Navigate to API & Services > Credentials.
- Create an OAuth client ID, selecting 'Web application'.
- Input
http://localhost:3000/auth/callbackas a valid redirect endpoint. - Save the Client ID and Secret.
Phase 2: Token Acquisition
- Prepare configuration template:
cp temp-credentials.json.example temp-credentials.json
-
Update
temp-credentials.jsonwith the credentials from Phase 1. -
Execute the token generation utility:
node get-refresh-token.js
- Complete the browser-based authorization process to secure the refresh token.
Phase 3: Installation via Smithery
Install using the CLI, providing necessary configuration parameters:
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"}'
Configuration mapping in smithery.config.js:
export default {
KaranThink41_google_chat_mcp_server: {
command: 'npx',
args: [
'-y',
'@smithery/cli@latest',
'run',
'@KaranThink41/google_chat_mcp_server'
]
},
};
Phase 4: Local Runtime Setup
- Repository Cloning:
git clone https://github.com/KaranThink41/Google_chat_mcp_server.git
cd Google_chat_mcp_server
- Dependency Resolution:
npm install
- Build Artifact Generation:
npm run build
- Server Launch:
node build/index.js
Accessible Chat Functions
Communication Tools
-
post_text_message: Deliver plain text content to a designated space.json { "method": "tools/call", "params": { "name": "post_text_message", "arguments": { "spaceId": "AAAAfkdUqxE", "text": "Greetings from the automation script!" } } } -
fetch_message_details: Retrieve granular attributes for a specific communicated item.json { "method": "tools/call", "params": { "name": "fetch_message_details", "arguments": { "spaceId": "AAAAfkdUqxE", "messageId": "cpwLU-2f_z8.cpwLU-2f_z8" } } } -
list_space_messages: Enumerate the history of messages within a space, supporting pagination and ordering.json { "method": "tools/call", "params": { "name": "list_space_messages", "arguments": { "spaceId": "AAAAfkdUqxE", "pageSize": 10, "orderBy": "createTime" } } }
Space Administration
-
fetch_space_details: Obtain extensive descriptive data about a specific chat area.json { "method": "tools/call", "params": { "name": "fetch_space_details", "arguments": { "spaceId": "AAAAfkdUqxE" } } } -
list_joined_spaces: Produce a catalog of all accessible group conversations.json { "method": "tools/call", "params": { "name": "list_joined_spaces", "arguments": { "pageSize": 10 } } }
Participant Roster Tools
-
list_space_memberships: Generate a roster of all entities belonging to a space.json { "method": "tools/call", "params": { "name": "list_space_memberships", "arguments": { "spaceId": "AAAAfkdUqxE", "pageSize": 10 } } } -
fetch_member_details: Retrieve detailed profile data for an identified participant.json { "method": "tools/call", "params": { "name": "fetch_member_details", "arguments": { "spaceId": "AAAAfkdUqxE", "memberId": "user_123" } } }
Linguistic Query Processing
apply_natural_language_filter: Transform free-text search terms into structured API query strings.json { "method": "tools/call", "params": { "name": "apply_natural_language_filter", "arguments": { "filterText": "messages from Monday" } } }
Resilience and Security Posture
Robust exception handling is integrated, yielding explicit diagnostic feedback. Common issues involve authorization failures, invalid identifiers, and service constraint violations (rate limits/quotas).
Security prioritizes credential isolation using environment variables, secure refresh token management, and ensuring API keys remain internal to the service.
Contribution Guidelines
Standard procedure involves forking the repository, creating a feature branch, committing atomic changes, and submitting a Pull Request for review.
Legal Notice
This project adheres to the terms specified in the MIT License file.
Cloud Computing Context: Cloud computing is defined as "a paradigm for enabling network access to a scalable and elastic pool of shareable physical or virtual resources with self-service provisioning and administration on-demand," per ISO standards. This concept is ubiquitously known as 'the cloud'.
Essential Attributes (NIST): In 2011, NIST outlined five core characteristics: 1. On-demand self-service: Unilateral provisioning of compute capacity without provider intervention. 2. Broad network access: Capabilities accessible via standard network protocols across diverse client platforms. 3. Resource pooling: Multi-tenant architecture where resources are dynamically allocated based on collective consumer need. 4. Rapid elasticity: Scalability that appears virtually limitless to the consumer, adapting quickly to fluctuating demand. 5. Measured service: Automated metering and reporting of resource consumption (storage, compute time, bandwidth) ensuring transparency.
Historical Perspective: Early foundations trace back to 1960s time-sharing models. The specific 'cloud' graphical metaphor for abstracted services was popularized around 1994 by General Magic, evolving from pre-existing telecommunications diagrams.
