Google Classroom MCP server

Integrates with Google Classroom to retrieve courses, announcements, and assignments using OAuth2 authentication, enabling students and educators to access classroom information without switching contexts.
Back to servers
Setup instructions
Provider
Faizan
Release date
Mar 22, 2025
Language
TypeScript
Stats
1 star

This MCP server allows you to access and interact with your Google Classroom data through Claude and other AI assistants that support the Model Context Protocol. It provides a bridge between AI assistants and the Google Classroom API, making it easy to view courses, assignments, and more.

Prerequisites

  • Node.js (v16 or higher)
  • A Google Cloud Platform project with the Google Classroom API enabled
  • OAuth 2.0 client credentials for the Google Classroom API

Installation Options

Installing via Smithery

For an automated installation process with Claude Desktop:

npx -y @smithery/cli install @faizan45640/google-classroom-mcp-server --client claude

Manual Installation

  1. Clone the repository
  2. Install dependencies:
npm install
  1. Create a credentials.json file in the project root with your Google OAuth client credentials:
{
  "web": {
    "client_id": "YOUR_CLIENT_ID",
    "project_id": "YOUR_PROJECT_ID",
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://oauth2.googleapis.com/token",
    "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
    "client_secret": "YOUR_CLIENT_SECRET",
    "redirect_uris": ["http://localhost:3000/auth/google/callback"]
  }
}
  1. Authenticate with Google:
node index.js auth

This will open a browser window for you to complete the OAuth flow and save your credentials to tokens.json.

  1. Configure Claude to use this server by updating claude_desktop_config.json (typically in %APPDATA%\Claude\):
{
  "mcpServers": {
    "class": {
      "command": "node",
      "args": [
        "PATH_TO_YOUR_DIRECTORY\\index.js"
      ]
    }
  }
}

Using the Server

Available Tools

Courses Tool

Lists all your Google Classroom courses:

Use the 'courses' tool to get a list of all your Google Classroom courses

Course Details Tool

Gets detailed information about a specific course:

Use the 'course-details' tool with the courseId parameter to get details and announcements for a specific course

Parameters:

  • courseId: The ID of the course (obtained from the courses tool)

Assignments Tool

Gets assignments for a specific course:

Use the 'assignments' tool with the courseId parameter to get assignments and your submissions for a specific course

Parameters:

  • courseId: The ID of the course (obtained from the courses tool)

Example Prompts for Claude

  • "Show me all my Google Classroom courses"
  • "Get details for my Math course with ID 123456789"
  • "Show me all assignments for my History course with ID 987654321"

Permissions

The server requests these Google Classroom API permissions:

  • classroom.courses.readonly - Access course information
  • classroom.announcements.readonly - Access course announcements
  • classroom.coursework.me.readonly - Access your coursework and assignments
  • classroom.rosters.readonly - Access class rosters

Troubleshooting

If you encounter permission errors:

  1. Refresh permissions by running:

    node index.js auth
    
  2. Ensure your Google account is added as a test user in the Google Cloud Console if your app is in testing mode

  3. Verify that the OAuth scopes in the authenticateAndSaveCredentials function match your requirements

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "class" '{"command":"node","args":["PATH_TO_YOUR_DIRECTORY\\index.js"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "class": {
            "command": "node",
            "args": [
                "PATH_TO_YOUR_DIRECTORY\\index.js"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "class": {
            "command": "node",
            "args": [
                "PATH_TO_YOUR_DIRECTORY\\index.js"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later