Skip to main content
Glama
priyankapsi

StudentManagementMCP_Server

by priyankapsi
README.md
# student_management_crud MCP server

Generated from [https://github.com/priyankapsi/Student-management-using-CRUD-operations-](https://github.com/priyankapsi/Student-management-using-CRUD-operations-) (commit `fd84c6894014d853b69d9350b2b2cb0e46dc3e87`).

## Setup

1. `pip install -e .` (or `pip install -r requirements.txt` if provided separately).
2. Copy `.env.example` to `.env` and fill in the values below, or have your
   deployment platform inject them as environment variables directly -
   nothing here contains real credentials.
3. Run: `python server.py`

## Required environment variables

| Variable | Secret? | Purpose |
|---|---|---|
| `STUDENT_MANAGEMENT_CRUD_BASE_URL` | no | Base URL of the running student_management_crud API instance |
| `STUDENT_MANAGEMENT_CRUD_BEARER_TOKEN` | yes | Static bearer token |


## Transport

Two transports, selected via `MCP_TRANSPORT`:

- `stdio` (default) - the standard subprocess transport most MCP hosts use.
- `streamable-http` - hosts this server over HTTP/HTTPS at `/mcp`, so it can
  run as a standalone network service. Configure with:
  - `HOST` (default `0.0.0.0`), `PORT` (default `8000`)
  - `MCP_TLS_CERTFILE` / `MCP_TLS_KEYFILE` - set both to serve HTTPS directly;
    otherwise plain HTTP is served (fine behind a TLS-terminating proxy/ingress).

  Example: `MCP_TRANSPORT=streamable-http PORT=8000 python server.py`

## Tools

- **register_user** - Registers a new user account (username/email, password, optional list of role names) in the ASP.NET Identity store used by the Student Management API.
- **login** - Authenticates a user with username and password, returning a JWT access token and refresh token that must be sent as an Authorization: Bearer header on the /api/Student endpoints.
- **refresh_token** - Exchanges an expired JWT plus its matching refresh token for a new JWT/refresh-token pair.
- **get_all_students** - Lists all students. Requires a JWT bearer token belonging to a user with the 'Reader' role.
- **get_student_by_id** - Retrieves a single student by its numeric id. Requires a JWT bearer token belonging to a user with the 'Reader' role.
- **add_student** - Creates a new student record with a name, optional image, and class id. Requires a JWT bearer token belonging to a user with the 'Writer' role.
- **update_student** - Updates an existing student's name, image, and class by id. Requires a JWT bearer token belonging to a user with the 'Writer' role.
- **delete_student** - Deletes a student by id. Requires a JWT bearer token belonging to a user with the 'Reader' or 'Writer' role.