home / mcp / flex mcp server

Flex MCP Server

Provides an MCP bridge to the Flex Student Portal for querying academic data via AI assistants.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "ahtishamdilawar-nuces-flex-mcp": {
      "command": "python",
      "args": [
        "C:/path/to/FLEX/server.py"
      ],
      "env": {
        "FLEX_ROLL_NO": "22F-XXXX",
        "FLEX_PASSWORD": "your_password"
      }
    }
  }
}

You can run a Python-based MCP server that connects your Flex Student Portal to AI assistants like Claude Desktop or GitHub Copilot. This enables natural-language queries about your academic data, with actions like checking attendance, viewing marks, or generating a transcript, all through an MCP client you already use.

How to use

- Start your MCP client (Claude Desktop or Copilot). - When you are ready, say a natural prompt like: "Get my attendance for this semester" or "Show my transcript". - The server uses your local credentials to log in to Flex and fetch information. - You can ask for comparisons, calculations, or detailed records, and the MCP client will present the results. - If you need to re-authenticate, say "Login to FLEX" to trigger the login flow in Chrome.

How to install

Prerequisites: Python 3.11 or newer and Google Chrome installed on your machine.

1. Clone the project repository and install dependencies.

git clone <repo-url>
cd FLEX
pip install -r requirements.txt

2. Create a local credentials file. Replace the placeholder values with your actual Flex roll number and password.

# Example .env content
FLEX_ROLL_NO=22F-XXXX
FLEX_PASSWORD=your_password

3. Configure your MCP client to connect to the local server. You will add an MCP entry that points to the server script and passes your credentials.

# Claude Desktop
{
  "mcpServers": {
    "flex": {
      "command": "python",
      "args": ["C:/path/to/FLEX/server.py"],
      "env": {
        "FLEX_ROLL_NO": "22F-XXXX",
        "FLEX_PASSWORD": "your_password"
      }
    }
  }
}
# GitHub Copilot
{
  "flex": {
    "command": "python",
    "args": ["C:/path/to/FLEX/server.py"]
  }
}

Additional sections

Configuration details, security notes, and usage tips are important for smooth operation. The login session persists until you restart the MCP server. Chrome is required for the login flow, and credentials are used only locally on your machine. If a CAPTCHA appears, you will solve it manually in the opened Chrome window. You should have a working Python 3.11+ environment and a stable local setup for best results.

Available tools

login

Opens Chrome to complete CAPTCHA-authenticated login to FLEX and establish a session.

get_attendance

Fetches attendance records for all courses in the current term.

get_marks

Retrieves detailed marks with class statistics for your courses.

get_transcript

Returns the full academic transcript including GPAs.

get_mca

Provides Modified Class Average for relative grading insights.

get_courses

Lists current semester registered courses.

get_fee_report

Shows payment history and fee details.

check_login_status

Verifies whether the current session is active.