MCP Servers

MCP Servers

Sweep supports integration with Model Context Protocol (MCP) servers that allow you to extend Sweep's capabilities. We support both local MCP installations and remote MCP servers via Server-Sent Events (SSE).

Best Practices

When using MCP servers with Sweep, follow these guidelines:

Core Principles

  • Install only what you need: Only install the MCP servers that are necessary for your specific use case
  • Less is more: The more tools you provide, the worse an agent performs at using all of them effectively

Avoid Duplicate Functionality

Don't install MCP servers that replicate functionality Sweep already provides:

Sweep's built-in capabilities:

  • Explore and navigate your codebase
  • Create and modify files
  • Execute terminal commands
  • Use the IDE's LSP to find code usages
  • Internal planning for more complex tasks

Examples to avoid:

  • Filesystem MCP servers (Sweep already has file access)
  • Code editing tools (Sweep has built-in editing capabilities)
  • Terminal/shell servers (Sweep can execute commands)

Local MCP Server Configuration

Scenario: Enabling PR review in Sweep

In this example, we'll demonstrate how to install and configure the GitHub MCP server to give Sweep PR review abilities.

Step 1: Access MCP Configuration

  1. Open Sweep settings (double-press shift -> Sweep Settings)
  2. Navigate to the MCP Servers section
  3. Click on "Edit MCP Config File" button

This should open a JSON file like this:

{
  "mcpServers": {
  }
}

Step 2: Add GitHub MCP Server

Modify the configuration file to add the GitHub MCP server:

{
  "mcpServers": {
    "github": {
      "command": "/opt/homebrew/bin/npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-github"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "<your_github_pat>"
      }
    }
  }
}

Configuration breakdown:

  • command: The path to npx/your desired executable (use which npx or Get-Command npx to find your system's path)
  • args: Arguments to install and run the GitHub MCP server
  • env: Any environment variables, in this case your GitHub Personal Access Token

Step 3: Create a GitHub Token

  1. Generate a GitHub Personal Access Token (PAT) from GitHub Settings → Developer settings → Personal access tokens (opens in a new tab)
  2. Replace <your_github_pat> with your actual token
  3. Save the configuration file

Step 4: Manage Available Tools

After saving:

  • Return to Sweep settings
  • The GitHub MCP server should show as enabled with 26/26 tools
  • Important: Disable tools you don't need to improve performance
  • Only enable the tools you need for PR review workflows (get_pull_request, get_pull_request_files and create_pull_request_review)

Remote MCP Server Configuration (SSE)

Scenario: Providing Sweep with up-to-date library documentation

In this example, we'll demonstrate how to configure the remote Context7 MCP server to give Sweep context for libraries.

Step 1: Access MCP Configuration

  1. Open Sweep settings (double-press shift -> Sweep Settings)
  2. Navigate to the MCP Servers section
  3. Click on "Edit MCP Config File" button

This should open a JSON file like this:

{
  "mcpServers": {
  }
}

Step 2: Add Context7 MCP Server

Modify the configuration file to add the Context7 MCP server:

{
  "mcpServers": {
    "context7": {
      "url": "https://mcp.context7.com/sse"
    }
  }
}

Configuration breakdown:

  • url: The endpoint of the remote MCP server using Server-Sent Events (SSE). This should be the full URL provided by your MCP server provider (e.g., https://mcp.context7.com/sse).

Remote MCP Server Configuration w/ Auth

In this example, we'll demonstrate how to configure remote MCP servers that require authentication for a sample MCP server.

Step 1: Access MCP Configuration

Navigate to Remote MCP Server with JWT Auth (opens in a new tab) Follow the instructions to spin up a server running on http://localhost:3001/sse (opens in a new tab) and get your authorization token which will be valid for the next hour.

Step 2: Access MCP Configuration

  1. Open Sweep settings (double-press shift -> Sweep Settings)
  2. Navigate to the MCP Servers section
  3. Click on "Edit MCP Config File" button

This should open a JSON file like this:

{
  "mcpServers": {
  }
}

Step 3: Add MCP Server

Modify the configuration file to add the MCP server:

{
  "mcpServers": {
    "example_server": {
      "url": "http://localhost:3001/sse",
      "authorization_token": "your_auth_token_here"
    }
  }
}

Configuration breakdown:

  • url: The endpoint of the remote MCP server using Server-Sent Events (SSE). This should be the full URL provided by your MCP server provider (e.g., https://mcp.context7.com/sse).
  • authorization_token: A valid token for authentication with the remote MCP server. Will be passed in the Authorization header.

Troubleshooting

Common Issues

  1. Connection Timed Out

    • Ensure the command you passed in your configuration file is correct
    • Run which <server-command> or Get-Command <server-command> to get the correct path
    • For example, if which npx returns /opt/homebrew/bin/npx then that is what needs to go into the command field
  2. Expected status code 200 but was ...

    • Verify the URL path is correct
    • Verify that your authentication token is not missing or expired

Stay Updated

We are actively working on improving support for MCP so email team@sweep.dev or join our discord (opens in a new tab) for any questions/feedback.