Skip to main content

MCP Server overview

Model Context Protocol (MCP) is a standardized protocol for managing context between large language models (LLMs) and external systems. An MCP server for ONLYOFFICE DocSpace can be found in this repository.

The DocSpace MCP Server connects AI tools directly to ONLYOFFICE DocSpace. This gives AI agents, assistants, and chatbots the ability to manage rooms, collaborate on files, handle permissions, and automate document workflows - all through natural language interactions.

Features

  • Tools with granular control - Access to tools organized into logical toolsets with fine-grained enable/disable capabilities and meta tools.
  • Multiple transport protocols - Support for stdio, SSE, and Streamable HTTP transports.
  • Different authentication methods - Supports API keys, Personal Access Tokens, Basic authentication, and OAuth 2.0 with dynamic client registration. See examples.
  • Request-level configuration - Configure authentication and tool selection during session initialization using custom HTTP headers.
  • Various distribution formats - Available as Docker image, Docker MCP Server, MCP bundle, and Node.js application.

Use Cases

Installation

You can connect to the DocSpace MCP server using any MCP clients. We have covered some popular clients, such as Claude Desktop, Cursor, Windsurf, etc., and here you can read about it.

Remote DocSpace MCP Server

The remote DocSpace MCP Server is hosted by ONLYOFFICE and provides the fastest way to start using DocSpace tools inside your AI agent. You can connect to it instantly without deploying or configuring anything on your machine.

The public instance is available at https://mcp.onlyoffice.com/mcp for clients that support modern Streamable HTTP transport and at https://mcp.onlyoffice.com/sse for clients that support only the legacy SSE transport. It is preferable to use the Streamable HTTP transport whenever possible.

See all options for connecting clients to the Remote DocSpace MCP Server here.

Local DocSpace MCP Server

If your MCP host does not support remote MCP servers, you can run the local version of the DocSpace MCP Server instead.

Most clients that implement the MCP protocol have a common configuration file in the JSON format, inside which you can add the ONLYOFFICE DocSpace MCP Local Server.

Note: The common example below is applicable for Docker image, so Docker must be installed on your system.

Step 1. Locate your config file

Find your client .json configuration file.

Step 2. Add the DocSpace MCP Server entry

Insert the following block into the mcpServers section of your .json configuration file:

{
"mcpServers": {
"onlyoffice-docspace": {
"command": "docker",
"args": ["run", "--interactive", "--rm", "--env", "DOCSPACE_BASE_URL", "--env", "DOCSPACE_API_KEY", "onlyoffice/docspace-mcp"],
"env": {
"DOCSPACE_BASE_URL": "https://your-instance.onlyoffice.com",
"DOCSPACE_API_KEY": "your-api-key"
}
}
}
}

Step 3. Set environment values

  • DOCSPACE_BASE_URL - the URL of your DocSpace instance (e.g. https://portal.onlyoffice.com).
  • DOCSPACE_API_KEY - your personal API key generated in DocSpace settings -> Developer Tools -> API keys.

Step 4. Restart the client

Close and reopen your client. In most cases, the DocSpace MCP Server will start automatically, and you'll be able to issue natural language commands like:

  • Create a new project room and invite Anna with editor rights.
  • Upload this file to "My documents".

Configuration

The only way to configure the ONLYOFFICE DocSpace MCP server is through environment variables. Below is a table with the names of available environment variables and their descriptions. They are used to configure the behavior for API requests.

NameDescription
DOCSPACE_USER_AGENTThe user agent to use for requests. This option is not required but can be used to specify the User-Agent header in requests to DocSpace.
DOCSPACE_BASE_URLThe base URL of the DocSpace instance for API requests. This option is required if either DOCSPACE_AUTHORIZATION, DOCSPACE_API_KEY, DOCSPACE_AUTH_TOKEN, or the DOCSPACE_USERNAME/DOCSPACE_PASSWORD pair is set.
DOCSPACE_AUTHORIZATIONThe raw value to include in the Authorization header for API requests. This option is required if neither DOCSPACE_API_KEY, DOCSPACE_AUTH_TOKEN, nor the DOCSPACE_USERNAME/DOCSPACE_PASSWORD pair is set.
DOCSPACE_API_KEYThe API key for accessing the DocSpace API. This option is required if neither DOCSPACE_AUTHORIZATION, DOCSPACE_AUTH_TOKEN, nor the DOCSPACE_USERNAME/DOCSPACE_PASSWORD pair is set.
DOCSPACE_AUTH_TOKENThe Personal Access Token (PAT) for accessing the DocSpace API. This option is required if neither DOCSPACE_AUTHORIZATION, DOCSPACE_API_KEY, nor the DOCSPACE_USERNAME/DOCSPACE_PASSWORD pair is set.
DOCSPACE_USERNAMEThe username for accessing the DocSpace API using basic authentication. This is used in conjunction with DOCSPACE_PASSWORD. This option is required if neither DOCSPACE_AUTHORIZATION, DOCSPACE_API_KEY nor DOCSPACE_AUTH_TOKEN is provided.
DOCSPACE_PASSWORDThe password for accessing the DocSpace API using basic authentication. This is used in conjunction with DOCSPACE_USERNAME. This option is required if neither DOCSPACE_AUTHORIZATION, DOCSPACE_API_KEY nor DOCSPACE_AUTH_TOKEN is provided.
DOCSPACE_OAUTH_BASE_URLThe base URL of the DocSpace OAuth service for OAuth requests.
DOCSPACE_OAUTH_CLIENT_IDThe client ID of the OAuth application. This is used in conjunction with DOCSPACE_OAUTH_CLIENT_SECRET.
DOCSPACE_OAUTH_CLIENT_SECRETThe client secret of the OAuth application. This is used in conjunction with DOCSPACE_OAUTH_CLIENT_ID.

All available configuration parameters are listed here.

Usage

Model Context Protocol describes several different concepts, however the ONLYOFFICE DocSpace MCP server implements Tools only.

Tools

Below are tables with the names of available tools and their descriptions:

Files

NameDescription
copy_batch_itemsCopy to a folder.
delete_fileDelete a file.
download_file_as_textDownload a file as text.
get_file_infoGet file information.
move_batch_itemsMove to a folder.
update_fileUpdate a file.
upload_fileUpload a file.

Folders

NameDescription
create_folderCreate a folder.
delete_folderDelete a folder.
get_folder_contentGet content of a folder.
get_folder_infoGet folder information.
get_my_folderGet the "My Documents" folder.
rename_folderRename a folder.

People

NameDescription
get_all_peopleGet all people.

Rooms

NameDescription
archive_roomArchive a room.
create_roomCreate a room.
get_room_access_levelsGet a list of available room invitation access levels.
get_room_infoGet room information.
get_room_security_infoGet a list of users with their access levels to a room.
get_room_typesGet a list of available room types.
get_rooms_folderGet the "Rooms" folder.
set_room_securityInvite or remove users from a room.
update_roomUpdate a room.