Supports environment variable configuration for customizing the N Lobby base URL and MCP server settings
Hosts the repository for development installation of the nlobby-mcp server
Supports configuration for Claude Desktop on macOS systems via specific configuration paths
Provides installation and distribution of the nlobby-mcp package to enable easy setup of the MCP server
Used for package management and running development scripts for the MCP server
Enables communication with N Lobby's tRPC endpoints to retrieve and interact with school portal data including news, schedules, and academic information
The MCP server is built with TypeScript, providing type-safe access to N Lobby's API endpoints and data structures
N Lobby MCP Server
Note: The developer assumes no responsibility for any damages that may occur from using this MCP server. This software was developed for educational purposes and its operation is not guaranteed.
A Model Context Protocol (MCP) server for accessing N Lobby school portal data. This server provides secure access to school information including announcements, schedules, and learning resources through browser-based authentication.
Features
- Browser-based Authentication: Interactive login via automated browser window
- Cookie-based Session Management: Secure session handling with NextAuth.js cookies
- School Information Access: Retrieve announcements, schedules, and learning resources
- Required Courses Management: Access required course information and academic data
- Multiple Calendar Types: Support for both personal and school calendars
- User Role Support: Different access levels for students, parents, and staff
- MCP Protocol Compliance: Full compatibility with MCP-enabled AI assistants
- Advanced Testing Tools: Built-in debugging and testing capabilities
Installation
Option 1: Install from npm (Recommended)
Option 2: Development Installation
- Clone the repository:
- Install dependencies:
- Set up environment variables:
- Build the project:
Configuration
Create a .env
file with the following variables (optional, defaults provided):
Usage
Running the Server
For npm installation:
For development installation:
Cursor IDE Setup
Add the following to your Cursor settings (~/.cursor/config.json
):
Claude Desktop Setup
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json
on macOS):
Other MCP Clients
For any MCP-compatible client, use:
- Command:
nlobby-mcp
(if installed globally) ornode /path/to/nlobby-mcp/dist/index.js
- Protocol: stdio
- Environment: Optional environment variables as listed in Configuration section
MCP Resources
The server provides the following resources:
nlobby://news
- School news and noticesnlobby://schedule
- Daily class schedule and eventsnlobby://required-courses
- Required courses and academic informationnlobby://user-profile
- Current user information
MCP Tools
Available tools:
Authentication Tools
interactive_login
- Open browser for manual login to N Lobby (recommended)login_help
- Get personalized login help and troubleshootingset_cookies
- Manually set authentication cookiescheck_cookies
- Check authentication cookie statusverify_authentication
- Verify authentication status across all clients
Data Retrieval Tools
get_news
- Retrieve school news with filtering and sorting optionsget_news_detail
- Retrieve detailed information for a specific news articleget_required_courses
- Retrieve required courses information with filtering optionsget_schedule
- Get schedule for a specific date (backward compatibility)get_calendar_events
- Get calendar events with advanced options (personal/school)test_calendar_endpoints
- Test both personal and school calendar endpointsmark_news_as_read
- Mark a news article as read
Debugging Tools
health_check
- Test N Lobby API connectiondebug_connection
- Debug N Lobby connection with detailed informationtest_page_content
- Test page content retrieval and show sample contenttest_trpc_endpoint
- Test specific tRPC endpoint with detailed response
MCP Prompts
This server does not provide any pre-configured prompts.
Authentication Flow
Method 1: Interactive Browser Login (Recommended)
- Use the
interactive_login
tool (no credentials required) - A browser window will open to N Lobby
- Complete the login process manually in the browser
- The system will detect when you're logged in and extract cookies automatically
- Access real N Lobby data immediately
Method 2: Manual Cookie Setup
- Login to N Lobby via web browser
- Extract cookies from browser developer tools:
- Open Developer Tools (F12)
- Go to Application/Storage tab
- Copy all cookies as a string
- Use
set_cookies
tool with the complete cookie string - Use
health_check
tool to verify connection - Access real N Lobby data via other tools
Quick Start Examples
For Students
For Staff
For Parents
Troubleshooting
Required Courses
The get_required_courses
tool allows you to retrieve academic course information:
The response includes comprehensive course information:
- Course Details: Subject code/name, curriculum code/name
- Academic Credits: Academic credit hours and approved credits
- Progress Tracking: Report completion percentage, average scores
- Status Information: Acquisition status, evaluation grades
- Test Information: Exam status, periodic exam results, makeup exam URLs
- Schooling Data: Attendance counts and requirements
- Time Information: Term year, grade level (1年次, 2年次, 3年次)
- Computed Fields: Progress percentage, completion status, average scores
Calendar Events
The get_calendar_events
tool supports advanced options:
Cookie Format
When using set_cookies
, provide the complete cookie string from browser:
User Types
The server supports three user types based on email domain:
- Students:
@nnn.ed.jp
- Staff:
@nnn.ac.jp
- Parents: Any other registered email addresses (Gmail, Yahoo, company emails, etc.)
Development
Scripts
pnpm run build
- Build the TypeScript projectpnpm run dev
- Watch mode for developmentpnpm run start
- Start the MCP serverpnpm run test
- Run testspnpm run lint
- Lint the codepnpm run format
- Format the code
Project Structure
Architecture
The server uses multiple layers for authentication and API access:
- Browser Authentication: Automated browser for interactive login
- Cookie Management: Handles NextAuth.js session cookies
- HTTP Client: Axios-based client for REST API calls
- tRPC Client: Type-safe client for tRPC endpoints
- Credential Manager: Validates user types and provides guidance
Security Notes
- All authentication tokens are stored in memory only
- The server uses secure cookie-based authentication
- Access is restricted to authorized N High School Group email domains
- No sensitive data is logged or persisted
- Browser automation is used only for authentication, not data scraping
Troubleshooting
Common Issues
- Authentication Failed: Use
interactive_login
for the most reliable authentication - Cookie Sync Issues: Run
verify_authentication
to check synchronization - Connection Problems: Use
health_check
anddebug_connection
for diagnosis - Empty Results: Ensure you're authenticated and have proper permissions
Debug Tools
The server includes comprehensive debugging tools:
debug_connection
- Network and authentication debuggingtest_page_content
- Content retrieval testingtest_trpc_endpoint
- API endpoint testingverify_authentication
- Authentication status verification
License
This project is licensed under the MIT License - see the LICENSE file for details.
This server cannot be installed
A Model Context Protocol server that provides secure access to N Lobby school portal data including announcements, schedules, and learning resources through browser-based authentication.
Related MCP Servers
- AsecurityFlicenseAqualityA Model Context Protocol server that enables interaction with the Canvas Learning Management System API, allowing users to manage courses, assignments, enrollments, and grades within Canvas.Last updated -543733JavaScript
- AsecurityAlicenseAqualityA Model Context Protocol server that provides integration with LeetCode APIs, enabling automated interaction with programming problems, contests, solutions, and user data across both leetcode.com and leetcode.cn platforms.Last updated -1312939TypeScriptMIT License
- -securityAlicense-qualityAn educational implementation of a Model Context Protocol server that demonstrates how to build a functional MCP server integrating with various LLM clients.Last updated -2PythonMIT License
- -securityAlicense-qualityA comprehensive Model Context Protocol server providing educational resources and curriculum planning support with intelligent filtering across multiple educational APIs.Last updated -PythonMIT License