Skip to main content

Installing the DocSpace MCP server

Before interacting with the DocSpace MCP server, you need to install or connect to it. DocSpace offers two ways to do this:

Before you start

  • Ensure you have a DocSpace instance. Sign up to DocSpace to access your instance and get an API key.
  • Choose your desired client. You can build a custom client or choose from the different MCP clients available based on your integration, features, user interface, or security needs.

Access via a local DocSpace MCP server

You can configure your local machine to interact with the DocSpace MCP server using:

Before proceeding, make sure to set these environment variables:

  • 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 ToolsAPI keys.

Install with Docker image

  1. Follow these steps to pull the latest DocSpace MCP server from Docker Hub.

  2. Locate your MCP client .json config file. The location of this file depends on the specific client.

  3. 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"
    }
    }
    }
    }

Configuration options

OptionDescription
dockerThe executable to run
runCommand to create and start a container
--interactiveKeep stdin open so the client can communicate with the server over stdio
--rmAutomatically remove the container when it exits
--envFlag to pass environment variables
onlyoffice/docspace-mcpDocker image name to run

Install with Docker MCP Toolkit

Using the Docker MCP Toolkit requires Docker Desktop to be installed on your system and the Docker MCP Toolkit to be enabled.

note

The Docker MCP Toolkit is currently a beta feature and is only available to specific user segments, subscription tiers, or by invitation.

  1. Follow this guide to install the server through the Docker Desktop interface.

  2. Connect the server to an MCP client through the Docker Desktop interface.

  3. Configure the server through the Docker Desktop interface. In general:

    • Select the DocSpace MCP server in Docker Desktop
    • Open the server's configuration or settings panel
    • Enter your DocSpace base URL (e.g., https://your-instance.onlyoffice.com)
    • Enter your personal API key
    • Save the configuration

Install with MCP bundle

Running the MCP bundle requires Node.js version 18 or higher to be installed on your system.

  1. Download the latest MCP bundle from GitHub Releases (typically named docspace-mcp-bundle-x.x.x.zip or similar).

  2. Install the MCP bundle in an application by following the application's MCP bundles installation procedure.

  3. Configure the server through the application's interface. In general:

    • Open the server settings within your application
    • Enter your DocSpace base URL (e.g., https://your-instance.onlyoffice.com)
    • Enter your personal API key
    • Save the configuration and restart the application if required

Install via Node.js application

note

Running the Node.js application requires Node.js version 18 or higher to be installed on your system.

Configure your MCP client to use the Node.js application by adding the following configuration to your client's configuration file:

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

Configuration options

OptionDescription
npxThe Node.js package runner, which downloads and executes packages on demand
--yesAutomatically confirms the installation prompt, enabling unattended startup
@onlyoffice/docspace-mcpThe official DocSpace MCP server package from npm

Access via the remote DocSpace MCP server

Another way to use the DocSpace MCP server is to access it via a public DocSpace MCP Server instance hosted by ONLYOFFICE. This eliminates the need to run your own server infrastructure while providing access to DocSpace functionality through your AI assistant. To do this, provide the DocSpace MCP server public instance URL when connecting to any of the MCP clients.

Public instance

The public instance is available at two endpoints:

EndpointTransportRecommendation
https://mcp.onlyoffice.com/mcpHTTPPreferred: use this endpoint whenever your client supports it. Streamable HTTP offers better performance and reliability.
https://mcp.onlyoffice.com/sseServer-Sent Events (SSE)Legacy: use this endpoint only if your client does not support the modern Streamable HTTP transport.

The public instance provides access to all available tools by default. Tool selection can be customized using query parameters or custom headers. However, we recommend using the MCP client interface for tool configuration when supported.

Tool configuration

Tool selection can be customized using the following options:

Authenticating the remote MCP server-client connection

The public instance supports multiple authentication methods to meet different security requirements and client capabilities: OAuth, API key, Personal Access Token (PAT), username/password pair, or raw Authorization header.

note

OAuth is the recommended method as it provides the strongest security model by allowing users to authorize specific permissions without sharing their credentials directly.

Authentication methodDefinitionRequirementsExampleRecommendations
OAuth (public app)Authenticates the connection without requiring custom credentialsConnection URLSee VS Code remote connectionSimplest and most secure method, requiring no custom credentials or additional configuration
OAuth (custom app)Connects using a client ID and client secret after creating a custom appConnection URL, Client ID, Client SecretSee Claude Desktop connectionOffers more flexibility and full control over the OAuth configuration, including custom redirect URIs, specific scopes, and branding.
API Key (Header)Connects using an API key and base URL configured via custom headersConnection URL, API keySee Le Chat connectionIdeal when integrating with platforms that support custom HTTP headers but don't have built-in OAuth support
API Key (Authorization header)Connects using an API key in the Authorization header and a base URL in a query parameterConnection URL, API keySee Le Chat connectionIdeal when working with clients that support Bearer token authentication but don't allow custom headers
Username & password in URLConnects using URL-encoded credentials and a base URL in a query parameterConnection URL, username, passwordSee Claude web connectionIdeal for quick setup, testing, or when using clients with limited authentication options

After installation