MCP Server

A Model Context Protocol (MCP) server implementation for Posit Package Manager (PPM), enabling AI assistants to interact with your package repositories programmatically. This MCP server provides seamless integration between AI assistants and Posit Package Manager, allowing you to:

The server leverages the Model Context Protocol to expose PPM’s Server APIs as tools that AI assistants can use to help you manage and explore your package ecosystem.

How to Enable MCP Server

EnhancedAdvanced

If you’d like to enable access to the MCP server, edit the configuration property [AI].MCPEnabled as follows and restarting Package Manager:

File: /etc/rstudio-pm/rstudio-pm.gcfg
[AI]
MCPEnabled = true

Using a reverse proxy on the same host

If a reverse proxy on the Package Manager host forwards to localhost or 127.0.0.1 and keeps the client’s Host header, set Server.Address to the public URL of Package Manager. Otherwise, the MCP server rejects each request with 403 Forbidden: invalid Host header.

File: /etc/rstudio-pm/rstudio-pm.gcfg
[Server]
Address = https://packagemanager.example.com

Posit Assistant integration

Posit Assistant is an AI-powered assistant from Posit. It supports the Model Context Protocol (MCP), allowing you to connect the Package Manager MCP server to enhance your AI-assisted workflows.

Posit Assistant can also install AI agent plugins that Package Manager hosts. See AI Agent Plugins.

Setting up in Posit Assistant

  1. Open your settings file.

    Posit Assistant reads MCP server configuration from a JSON settings file. You can configure at two levels:

    • Global settings: ~/.posit/assistant/settings.json (applies to all projects)
    • Project settings: .posit/assistant/settings.json in your project directory (overrides global)

    Create the file if it does not exist.

  2. Add the Package Manager MCP server.

    Add the following configuration to your settings file:

    File: ~/.posit/assistant/settings.json
    {
      "mcpServers": {
        "package-manager": {
          "type": "remote",
          "url": "https://[package-manager-server-address]/mcp"
        }
      }
    }

    Replace [package-manager-server-address] with the address of your Package Manager server (for example, packagemanager.example.com).

  3. Restart Posit Assistant.

    If Posit Assistant is already running, restart it to load the new configuration. Posit Assistant connects to configured MCP servers on startup.

  4. Verify the connection.

    In Posit Assistant, type /mcp to see the status of connected MCP servers. The package-manager server appears as connected. Once connected, Posit Assistant can use Package Manager tools to help you find packages, check system dependencies, and explore your repositories.

Configuration with authentication

Some tools need a token even when your repositories do not require authentication. A global:admin token works for all of them, within the features of your license. Otherwise, the token needs these scopes:

Tool Token scope
list_sources sources:write for any source
get_curated_bioc_versions sources:write for that source
filter_packages with source_name sources:write for that source, or metadata:admin

list_sources and get_curated_bioc_versions also require Full Remote Administration, which is part of Advanced. On Enhanced, they refuse every token, including global:admin.

To create a token, see API Tokens.

If your Package Manager server requires authentication, or you use the tools in the table above, include an Authorization header. Use the {env:VAR_NAME} syntax to reference environment variables for sensitive values like API tokens:

File: ~/.posit/assistant/settings.json
{
  "mcpServers": {
    "package-manager": {
      "type": "remote",
      "url": "https://[package-manager-server-address]/mcp",
      "headers": {
        "Authorization": "Bearer {env:PACKAGEMANAGER_TOKEN}"
      }
    }
  }
}

Set the environment variable before starting Posit Assistant:

Terminal
export PACKAGEMANAGER_TOKEN="your-api-token"

Configuration options

Option Required Description
type Yes Set to "remote" for HTTP-based MCP servers
url Yes The URL of your Package Manager MCP endpoint
headers No HTTP headers to include with requests (for authentication)
enabled No Set to false to temporarily disable the server (default: true)
timeout No Request timeout in milliseconds (default: 10000)

For more details on Posit Assistant MCP server configuration, see the Posit Assistant MCP Servers documentation.

Positron integration

Positron is a next-generation data science IDE from Posit. Positron includes a built-in assistant that supports the Model Context Protocol (MCP).

Positron 2026.07 and later includes Posit Assistant as the built-in AI experience. If you are using Positron 2026.07 or later, follow the Posit Assistant integration instructions above instead.

For earlier Positron versions, use the mcp.json configuration described below to connect the Package Manager MCP tools to Positron Assistant.

Setting up in Positron

To configure the Package Manager MCP server in Positron, open the Command Palette and run MCP: Open User Configuration. This opens the mcp.json file in your user profile. Add your server configuration:

mcp.json
{
  "servers": {
    "package-manager": {
      "url": "https://[package-manager-server-address]/mcp",
      "type": "http"
    }
  }
}

Replace [package-manager-server-address] with the address of your Package Manager server.

Important

Set Positron Assistant to Agent chat mode to enable MCP tool usage. See Positron Assistant documentation for details.

Back to top