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.
For an automated installation process with Claude Desktop:
npx -y @smithery/cli install @faizan45640/google-classroom-mcp-server --client claude
npm install
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"]
}
}
node index.js auth
This will open a browser window for you to complete the OAuth flow and save your credentials to tokens.json
.
claude_desktop_config.json
(typically in %APPDATA%\Claude\
):{
"mcpServers": {
"class": {
"command": "node",
"args": [
"PATH_TO_YOUR_DIRECTORY\\index.js"
]
}
}
}
Lists all your Google Classroom courses:
Use the 'courses' tool to get a list of all your Google Classroom courses
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)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)The server requests these Google Classroom API permissions:
classroom.courses.readonly
- Access course informationclassroom.announcements.readonly
- Access course announcementsclassroom.coursework.me.readonly
- Access your coursework and assignmentsclassroom.rosters.readonly
- Access class rostersIf you encounter permission errors:
Refresh permissions by running:
node index.js auth
Ensure your Google account is added as a test user in the Google Cloud Console if your app is in testing mode
Verify that the OAuth scopes in the authenticateAndSaveCredentials
function match your requirements
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.
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.
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"
]
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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