Skip to main content

MCP Server

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.

Installation

Most clients that implement the MCP protocol have a common configuration file in JSON format, inside which you can add the ONLYOFFICE DocSpace MCP server as follows:

{
"mcpServers": {
"onlyoffice-docspace": {
"env": {
"DOCSPACE_BASE_URL": "https://your-instance.onlyoffice.com",
"DOCSPACE_API_KEY": "your-api-key"
},
"command": "npx",
"args": ["--yes", "@onlyoffice/docspace-mcp"]
}
}
}

For a more detailed example of the MCP server installation process, see how it can be done using Claude Desktop.

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:

NameDescription
DOCSPACE_BASE_URLThe base URL of the DocSpace instance. This configuration is required for making API requests to DocSpace.
DOCSPACE_ORIGINThe origin of the DocSpace instance. This configuration is not required but can be used to specify the Origin header in requests to DocSpace.
DOCSPACE_USER_AGENTThe user agent to use for requests. This configuration is not required but can be used to specify the User-Agent header in requests to DocSpace.
DOCSPACE_API_KEYThe API key for accessing the DocSpace API. This configuration is required if neither DOCSPACE_AUTH_TOKEN nor DOCSPACE_USERNAME and DOCSPACE_PASSWORD are provided.
DOCSPACE_AUTH_TOKENThe authentication token for accessing the DocSpace API. This configuration is required if neither DOCSPACE_API_KEY nor DOCSPACE_USERNAME and DOCSPACE_PASSWORD are provided.
DOCSPACE_USERNAMEThe username for accessing the DocSpace API using basic authentication. This configuration is required if neither DOCSPACE_API_KEY nor DOCSPACE_AUTH_TOKEN is provided. This is used in conjunction with DOCSPACE_PASSWORD.
DOCSPACE_PASSWORDThe password for accessing the DocSpace API using basic authentication. This configuration is required if neither DOCSPACE_API_KEY nor DOCSPACE_AUTH_TOKEN is provided. This is used in conjunction with DOCSPACE_USERNAME.

Usage

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

Tools

Below is a table with the names of available tools and their descriptions:

NameDescription
files_archive_roomArchive a room.
files_copy_batch_itemsCopy to a folder.
files_create_folderCreate a folder.
files_create_roomCreate a room.
files_delete_fileDelete a file.
files_delete_folderDelete a folder.
files_get_file_infoGet file information.
files_get_folderGet the contents of a folder.
files_get_folder_infoGet folder information.
files_get_foldersGet the subfolders of a folder.
files_get_my_folderGet the "My documents" folder.
files_get_operation_statusesGet active file operations.
files_get_room_infoGet room information.
files_get_room_security_infoGet a list of users with their access levels to a room.
files_get_rooms_folderGet the "Rooms" folder.
files_move_batch_itemsMove to a folder.
files_rename_folderRename a folder.
files_set_room_securityInvite or remove users from a room.
files_update_fileUpdate a file.
files_update_roomUpdate a room.
others_download_as_textDownload a file as text.
others_get_available_room_invitation_accessGet a list of available room invitation access levels.
others_get_available_room_typesGet a list of available room types.
others_upload_fileUpload a file.
people_get_allGet all people.
portal_get_quotaGet the current quota.
portal_get_tariffGet the current tariff.
settings_get_supported_culturesGet a list of the supported cultures, languages.
settings_get_time_zonesGet a list of the available time zones.