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

Positron Integration

Positron is Posit’s next-generation data science IDE, and it includes native support for the Model Context Protocol (MCP). If you want to use the Package Manager MCP server across all your projects, you can add its configuration to your user profile so it’s available in every workspace.

Setting Up in Positron

To add the Package Manager MCP server to your user settings, open the Command Palette and run MCP: Add Server. When prompted, provide the following details

  1. Type of MCP server to add: HTTP (HTTP or Server-Sent Events)
  2. URL of the MCP server, for example: https://[package-manager-server-address]/mcp
  3. Server ID: pm-mcp-server
  4. Select the configuration target: Global

The configuration will then be saved to your user profile.

You can also configure it manually by running MCP: Open User Configuration, which opens the mcp.json file in your user profile. Add your server information directly to the file, for example:

        "pm-mcp-server": {
            "url": "https://[package-manager-server-address]/mcp",
            "type": "http"
        }
Warning

Be sure to set Positron Assistant to Agent chat mode to enable MCP tool usage. You can find the available chat modes here: https://positron.posit.co/assistant.html#chat-modes

Posit Assistant integration

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

Setting up in Posit Assistant

To configure the Package Manager MCP server, add it to your Posit Assistant settings file. You can configure settings 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)

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.

Configuration with authentication

If your Package Manager server requires authentication, you can include headers in the configuration. Use the {env:VAR_NAME} syntax to reference environment variables for sensitive values:

File: ~/.posit/assistant/settings.json
{
  "mcpServers": {
    "package-manager": {
      "type": "remote",
      "url": "https://[package-manager-server-address]/mcp",
      "headers": {
        "Authorization": "Bearer {env:PPM_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 (e.g., for authentication)
enabled No Set to false to disable the server without removing the configuration (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.

Back to top