ON

ONLYOFFICE DocSpace MCP Server API Guide

Create rooms, manage files and folders using the ONLYOFFICE DocSpace MCP server API to integrate and automate document workflows.

Quick Install
npx -y @ONLYOFFICE/docspace-mcp

Overview

The ONLYOFFICE DocSpace MCP Server provides a Model Context Protocol (MCP) implementation that manages rooms, folders and files for DocSpace integrations. It exposes a simple HTTP API for creating isolated “rooms” that group documents, storing and retrieving files, and performing common file operations. This makes it easy to automate document workflows, connect storage backends, or embed document services into other systems.

Developers use the MCP server to decouple document storage and metadata management from editing and collaboration layers. Typical integrations include programmatic room provisioning, automated import/export pipelines, indexing for search, and bridging external storage solutions (S3, local disk, network shares) with ONLYOFFICE editors or other consumers.

Features

  • Room-based multi-tenant workspace management
  • File and folder CRUD (create/read/update/delete) operations
  • Upload and download file content via HTTP
  • Metadata endpoints for file size, MIME type, last-modified and versioning
  • Simple authentication support (API key / JWT) and CORS configuration
  • Pluggable storage backends (local disk, S3-compatible stores)
  • Designed for embedding into automated workflows and editor integrations

Installation / Configuration

Run with Docker (recommended for quick start):

docker run -d \
  -p 8080:8080 \
  -e MCP_PORT=8080 \
  -e STORAGE_PATH=/data \
  -e JWT_SECRET=your-secret \
  -v /local/storage:/data \
  onlyoffice/docspace-mcp:latest

Example docker-compose.yml:

version: "3.8"
services:
  docspace-mcp:
    image: onlyoffice/docspace-mcp:latest
    ports:
      - "8080:8080"
    environment:
      - MCP_PORT=8080
      - STORAGE_PATH=/data
      - JWT_SECRET=supersecret
      - ALLOWED_ORIGINS=*
    volumes:
      - ./data:/data

Environment variables commonly used:

  • MCP_PORT — HTTP port (default 8080)
  • STORAGE_PATH — filesystem path for persisted files (or config for S3)
  • JWT_SECRET — secret key for signing authentication tokens
  • ALLOWED_ORIGINS — CORS origins for browser-based clients

If the project exposes an explicit config file (YAML/JSON), mount and edit it in the container or provide values via env vars as shown.

Core API (examples)

Below are representative endpoints and payloads. Adjust paths according to the server instance you run.

Create a room

curl -X POST "http://localhost:8080/api/rooms" \
  -H "Content-Type: application/json" \
  -d '{"name":"project-alpha","description":"Room for Project Alpha"}'

Response (201)

{ "id": "room_123", "name": "project-alpha", "createdAt": "2025-10-01T12:00:00Z" }

Create a folder inside a room

curl -X POST "http://localhost:8080/api/rooms/room_123/folders" \
  -H "Content-Type: application/json" \
  -d '{"name":"specs"}'

Upload a file

curl -X POST "http://localhost:8080/api/rooms/room_123/files" \
  -F "file=@./doc1.docx" \
  -F "path=/specs/doc1.docx"

List files in a folder

curl "http://localhost:8080/api/rooms/room_123/files?path=/specs"

Download a file

curl -o doc1.docx "http://localhost:8080/api/rooms/room_123/files/doc1-id/content"

Update file metadata (rename/move)

curl -X PUT "http://localhost:8080/api/rooms/room_123/files/doc1-id" \
  -H "Content-Type: application/json" \
  -d '{"path":"/specs/archived/doc1.docx"}'

Delete file

curl -X DELETE "http://localhost:8080/api/rooms/room_123/files/doc1-id"

Authentication

  • The server typically accepts an Authorization header (Bearer ) or an API key header (e.g., X-API-Key). Check your deployed instance configuration for the exact scheme.

    Available Resources

    • GitHub: https://github.com/ONLYOFFICE/docspace-mcp — source, issues, contributions
    • Example clients: use curl, Postman or generate requests from an OpenAPI/Swagger spec if the repo includes one
    • Storage backends: local filesystem by default; the repo documents S3-compatible options if supported
    • Support and contributions: file issues on the GitHub repo, submit PRs for bug fixes or feature additions

    Use Cases

    • Automated room provisioning: create rooms for new projects or users as part of onboarding flows.

      • Example: when a new project is created in your app, call POST /api/rooms and create initial folders and templates.
    • Editor integration: supply files and save callbacks for ONLYOFFICE or other rich editors.

      • Example: upload a doc via /files and return the document URL to the editor; on save, the editor can PUT the updated content back to the MCP server.
    • Document ingestion and indexing: programmatically upload batches of documents for search indexing or compliance processing.

      • Example: a scheduled job reads files from S3 and POSTs them into a room for downstream processors.
    • Backup and migration: export room contents for backup or transfer between environments.

      • Example: list files in a room, stream downloads, and push to another storage target.
    • Multi-tenant document workflows: isolate tenant documents into rooms, enforce access boundaries, and integrate lifecycle actions (archive, delete) by room.

    Notes for Developers

    • Start by running a local instance (Docker) and exercise the example endpoints with curl or Postman.
    • Check the repository README and docs for exact endpoint paths, authentication scheme, and any OpenAPI/Swagger artifacts.
    • When integrating, prefer using tokens scoped to the minimum permissions required for your workflow (read-only vs read/write).
    • For production, configure persistent storage (S3 or mounted volumes), secure JWT/API secrets, and restrict CORS/origins.

    This guide gives a practical starting point for working with the ONLYOFFICE DocSpace MCP server API. For detailed API contract, schema definitions, or SDKs, consult the GitHub repository and its documentation.