darkspace
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
darkspace
darkspace is an MCP server for D2L Brightspace. It uses the Brightspace Valence REST API to read your courses, content, assignments, grades and calendar. The default site is https://purdue.brightspace.com.
This project is vibe coded. An AI wrote most of the code, and nobody audited it. Use it at your own discretion and risk.
darkspace is not affiliated with, endorsed by or supported by Purdue University, D2L or Microsoft. The author does not endorse any use of it. Before you use it, make sure that your use obeys the rules of your school, including its acceptable use policy, and the terms of the services that darkspace connects to.
You alone are responsible for how you use this software. The author is not responsible or liable for damage, data loss, account suspension, disciplinary action or other consequences that come from its use. The software is provided "as is", without warranty of any kind. See LICENSE.
Tools
Tool | Function |
| Shows the user of the credentials. |
| Lists your courses. Other tools use the |
| Lists calendar events across your courses: due dates, quizzes and events. |
| Lists the announcements of a course. |
| Shows the modules and topics of a course. |
| Shows one content topic. |
| Downloads the file of a topic to the disk of the computer that runs darkspace. |
| Lists assignments with instructions, due dates and your submission status. |
| Shows your released grades and your final grade. |
| Lists quizzes with dates, attempts and time limits. |
| Lists discussion forums and topics. |
| Shows the posts of a discussion topic. |
| Sends a GET request to a Valence API route. Use it when no other tool fits. |
All tools only read data from Brightspace.
Related MCP server: nyu-brightspace-mcp
How the login works
Brightspace does not have personal access tokens. darkspace logs in through the Purdue single sign-on (Brightspace, then sso.purdue.edu, then Microsoft) in a dedicated headless Chromium. It keeps the Brightspace session cookies. When Brightspace stops accepting them, darkspace logs in again and repeats the request.
darkspace can sign in to Microsoft in two ways:
With an imported passkey. darkspace gives the passkey to a virtual authenticator in Chromium and completes the sign-in itself. Use this on a server.
Interactively. You sign in once in a browser window. After that, darkspace uses the saved Microsoft session. When the Microsoft session expires, you must sign in again.
Make a passkey for the server
Make a separate passkey for darkspace. Do not export the passkey that you use every day. With a separate passkey, you can remove the server's access and keep your own passkey.
In Bitwarden, make a new login item, for example
Purdue (darkspace server).Go to https://mysignins.microsoft.com/security-info and sign in.
Select Add sign-in method, then Passkey.
When Bitwarden asks where to save the passkey, select the new item.
Export the item:
bw get item "Purdue (darkspace server)" > passkey.json.Give
passkey.jsonto the server (see below). Then delete the local copy.
Warning: The passkey lets anyone who has it sign in to your Purdue account. Keep the file secret. If the server is compromised, remove the passkey in Microsoft Security info.
darkspace supports only P-256 (ES256) passkeys. Bitwarden makes this type.
Run on a NixOS server
Add the flake to your system configuration:
{
inputs.darkspace.url = "github:gmntl/darkspace";
outputs = { nixpkgs, darkspace, ... }: {
nixosConfigurations.server = nixpkgs.lib.nixosSystem {
modules = [
darkspace.nixosModules.default
{
services.darkspace = {
enable = true;
tokenFile = "/run/agenix/darkspace-token"; # openssl rand -hex 32
passkeyFile = "/run/agenix/darkspace-passkey"; # passkey.json from Bitwarden
};
}
];
};
};
}The service listens on 127.0.0.1:8765 at the path /mcp. Put it behind Tailscale or a reverse proxy with HTTPS. Set host and openFirewall only if the network is trusted.
Option | Default | Description |
|
| The Brightspace site. |
|
| The address of the HTTP server. |
| (required) | The bearer token, 32 or more characters. |
|
| The passkey as Bitwarden JSON. |
|
| Opens the port. |
|
| More environment variables. |
The service keeps its state in /var/lib/darkspace. If a login fails, darkspace saves a screenshot to /var/lib/darkspace/login-failure.png. Read the log with journalctl -u darkspace.
Connect a client
Claude Code:
claude mcp add --transport http darkspace https://<server>/mcp \
--header "Authorization: Bearer <token>"Other clients must send the same Authorization header.
Run on your computer
Install Nix with flakes and direnv.
In the project folder, run
direnv allow.Run
uv sync.Run
uv run playwright install chromium.Log in with one of these procedures:
Passkey:
bw get item "Purdue (darkspace server)" | uv run darkspace passkey import, thenuv run darkspace login.Interactive:
uv run darkspace login. Sign in in the window. When Microsoft asks "Stay signed in?", select Yes.
Run
uv run darkspace statusto make sure that the login is correct.
Use stdio for a local client:
claude mcp add darkspace -- uv --directory /path/to/darkspace run darkspaceOr use HTTP: DARKSPACE_HTTP_TOKEN=<token> uv run darkspace serve --http.
If direnv cannot find flake.nix, add the files to Git: git add -N flake.nix flake.lock nix. Nix flakes ignore files that Git does not track.
Commands
Command | Function |
| Runs the MCP server on stdio. |
| Runs the MCP server on Streamable HTTP. |
| Logs in. With a passkey, there is no window unless you give |
| Shows the logged-in user. |
| Imports a passkey from Bitwarden JSON. The default input is stdin. |
| Deletes the imported passkey. |
| Deletes the session and the browser profile. |
Configuration
All variables are optional, except a token for HTTP.
Variable | Description |
| The URL of the Brightspace site. The default is |
| The bearer token for HTTP, or a file that contains it. |
| A passkey as Bitwarden JSON. It has priority over |
| An OAuth 2.0 access token. It has priority over the login. darkspace does not refresh it. |
| Session cookies in the format |
| A Chromium-based browser executable for the login. |
| The folder for downloads. The default is |
| The API versions. darkspace finds the latest versions if you do not set them. |
| darkspace keeps its state in |
Development
uv run pytest
ruff check .
ruff format .
nix build .#defaultThe tests do not connect to Brightspace or Microsoft. They use a mock HTTP transport and fake sign-in pages in a local Chromium.
API reference
https://docs.valence.desire2learn.com/reference.html
License
MIT. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Read users, groups, departments, courses, content and enrollments in iSpring Learn.
Read Axis LMS users, courses, learning paths, certifications and reports; manage enrollments.
Read users, groups, courses and learning paths; add or remove group roles in 360Learning.
Read your plat.plus courses, tasks, course pages, sessions, files and messages. Read-only.
Related MCP Servers
- FlicenseAqualityCmaintenanceEnables local, read-only access to SMU's D2L Brightspace eLearn, allowing users to list courses, browse weekly modules and documents, search content, retrieve metadata, and download files after authenticating through Chrome.112-
- AlicenseAqualityCmaintenanceEnables read-only access to NYU Brightspace for deadlines, assignments, grades, announcements, and course content.16MIT
- AlicenseAqualityBmaintenanceEnables AI apps to read a student's Moodle courses, upcoming and overdue due dates, assignment submission statuses, course grades, gradebook items and announcements. It is strictly read only, so it can never submit, edit or delete anything.1796 npmMIT
- AlicenseAqualityBmaintenanceEnables agents to read Canvas LMS courses, assignments, submissions, feedback, modules, pages, announcements, discussions, calendars, groups, and files without granting write or submission access. It also supports replayable collection change feeds through JSONL events for automation.8Apache 2.0