Google Admin MCP Server

Google Admin MCP Server

By securityfortech GitHub

-

Overview

what is Google Admin MCP Server?

Google Admin MCP Server is a FastMCP server designed for managing Google Workspace users through the Admin Directory API.

how to use Google Admin MCP Server?

To use the server, clone the repository, install the dependencies, set the required environment variable for OAuth2 token, and start the server.

key features of Google Admin MCP Server?

  • List users in a domain
  • Create new users with secure random passwords
  • Get detailed user information
  • Suspend and unsuspend users

use cases of Google Admin MCP Server?

  1. Managing user accounts in a Google Workspace environment.
  2. Automating user creation and management tasks.
  3. Monitoring user status and information in real-time.

FAQ from Google Admin MCP Server?

  • What are the prerequisites to run the server?

You need Node.js >= 20.0.0, a Google Workspace Admin account, and the Google Admin Directory API enabled.

  • How do I create a new user?

Use the addUser tool with the user's primary email, first name, and last name.

  • What security measures are in place for user passwords?

All users created will be required to change their password on first login, and passwords are generated securely.

Content

Google Admin MCP Server

A FastMCP server for managing Google Workspace users through the Admin Directory API.

Features

  • List users in a domain
  • Create new users with secure random passwords
  • Get detailed user information
  • Suspend and unsuspend users

Prerequisites

  • Node.js >= 20.0.0
  • Google Workspace Admin account
  • Google Admin Directory API enabled
  • Base64 encoded OAuth2 token in GOOGLE_TOKEN_JSON environment variable

Installation

  1. Clone the repository
  2. Install dependencies:
npm install

Configuration

Set the required environment variable:

export GOOGLE_TOKEN_JSON="your_base64_encoded_token"

Available Tools

listUsers

Lists users in a domain.

{
  "domain": "yourdomain.com"
}

addUser

Creates a new user with a secure random password.

{
  "primaryEmail": "user@yourdomain.com",
  "firstName": "First",
  "lastName": "Last"
}

getUser

Gets detailed information about a specific user.

{
  "userKey": "user@yourdomain.com"
}

suspendUser

Suspends a user account.

{
  "userKey": "user@yourdomain.com"
}

unsuspendUser

Unsuspends a user account.

{
  "userKey": "user@yourdomain.com"
}

Running the Server

Start the server:

npm start

Security Notes

  • All users created will be required to change their password on first login
  • Passwords are generated securely with:
    • Minimum 12 characters
    • Uppercase and lowercase letters
    • Numbers
    • Special characters
  • The server requires a valid OAuth2 token with appropriate Admin Directory API scopes

Error Handling

The server provides clear error messages for:

  • Authentication failures
  • Invalid parameters
  • API errors
  • Missing environment variables

License

MIT License

No tools information available.
No content found.