All docsDocs · MCP · v0.5.0

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).

ArgumentTypeRequiredDescription
folderstringnoOnly 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.

ArgumentTypeRequiredDescription
pathsstring[]yesAbsolute or relative paths to files or directories on this machine
folderstringnoDestination folder in the room (created as needed)
itemIdstringnoReadiness 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.

ArgumentTypeRequiredDescription
itemIdstringyesChecklist item id (from get_readiness)
documentsstring[]yesDocuments to attach — by id, name, or folder/name

create_folder

Create an empty folder in the room (e.g. "01-Corporate/Charters"). Idempotent.

ArgumentTypeRequiredDescription
folderPathstringyesFolder 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.

ArgumentTypeRequiredDescription
documentstringyesThe document — by id, name, or folder/name
destDirstringnoLocal 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