MCP Server: Data Rooms for AI Agents
The Mage CLI doubles as a Model Context Protocol server. Point Claude, Cursor, or any MCP client at it and the agent can list documents, upload and organize files, work the readiness checklist, and download what its key permits. It runs over stdio on your machine; the only credential is a room-scoped API key.
Client configuration
Mint a key in your data room under Settings, then add the server to your MCP client:
{
"mcpServers": {
"mage-dataroom": {
"command": "npx",
"args": ["-y", "@magelegal/cli", "mcp"],
"env": { "MAGE_API_KEY": "sk_..." }
}
}
}The key alone is enough: the server discovers which room it belongs to on the first tool call. The machine-readable server card lives at /.well-known/mcp/server.json.
Tools
Six tools cover the agent loop: read the room, fill it, organize it, and check what is still missing. Deletion is deliberately not exposed; removing deal documents stays a human decision.
list_documents
List the documents in the data room with their folder, processing status, category, and index number. Optionally scope to one folder (and its subfolders).
| Argument | Type | Required | Description |
|---|---|---|---|
| folder | string | no | Only documents in this folder path and beneath it |
upload_documents
Upload local files or whole directories into the data room, mirroring directory structure. Optionally place them in a folder and/or attach them to a readiness checklist item.
| Argument | Type | Required | Description |
|---|---|---|---|
| paths | string[] | yes | Absolute or relative paths to files or directories on this machine |
| folder | string | no | Destination folder in the room (created as needed) |
| itemId | string | no | Readiness checklist item to attach the uploads to (see get_readiness) |
get_readiness
The room's readiness checklist (gap analysis): every expected item with its status (present, partial, missing, not_applicable), attached documents, and a hint for what fills it. `computed` is false until the first documents arrive.
attach_to_checklist_item
Attach already-uploaded documents to a readiness checklist item (additive: existing attachments are kept). Documents may be referenced by id, name, or folder/name.
| Argument | Type | Required | Description |
|---|---|---|---|
| itemId | string | yes | Checklist item id (from get_readiness) |
| documents | string[] | yes | Documents to attach — by id, name, or folder/name |
create_folder
Create an empty folder in the room (e.g. "01-Corporate/Charters"). Idempotent.
| Argument | Type | Required | Description |
|---|---|---|---|
| folderPath | string | yes | Folder path to create |
download_document
Download one document to a local directory and return the saved path. Requires the key to carry the Download permission; every download lands on the room audit trail.
| Argument | Type | Required | Description |
|---|---|---|---|
| document | string | yes | The document — by id, name, or folder/name |
| destDir | string | no | Local directory to save into (default: current directory) |
Security model
The server acts as its key, and only its key. A room-scoped key reaches one room, carries the permission set fixed at mint (a key without the Download permission cannot fetch file contents), and dies instantly when revoked in the app. Every download lands on the room audit trail. The server exposes no room management, no sharing controls, and no deletion, whatever the key allows elsewhere. Full details in the CLI documentation.
Give your agent a data room
Create a room, mint a key, paste the config. The whole loop takes minutes.
Create Your Data Room