> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pylancemcp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Continue.dev Setup

> Configure Pylance MCP in Continue.dev for VS Code

## Overview

Continue.dev is an open-source AI coding assistant for VS Code. This guide shows how to integrate Pylance MCP for enhanced Python support.

## Prerequisites

* Visual Studio Code
* Continue.dev extension installed
* Pylance MCP Server
* OpenAI or Anthropic API key

## Installation

<Steps>
  <Step title="Install Continue.dev">
    Install from VS Code Marketplace:

    ```
    Extensions → Search "Continue" → Install
    ```
  </Step>

  <Step title="Install Pylance MCP">
    ```bash theme={null}
    pip install pylance-mcp-server
    ```
  </Step>

  <Step title="Configure Continue">
    Open Continue config: `Cmd/Ctrl+Shift+P` → "Continue: Open config.json"

    ```json config.json theme={null}
    {
      "models": [{
        "title": "GPT-4",
        "provider": "openai",
        "model": "gpt-4",
        "apiKey": "YOUR_OPENAI_KEY"
      }],
      "mcpServers": [{
        "name": "pylance",
        "command": "python",
        "args": ["-m", "pylance_mcp.server"],
        "env": {
          "PYLANCE_WORKSPACE": "${workspaceFolder}"
        }
      }]
    }
    ```
  </Step>

  <Step title="Reload VS Code">
    ```
    Cmd/Ctrl+Shift+P → Developer: Reload Window
    ```
  </Step>
</Steps>

## Usage

### Inline Completion

Start typing and Continue suggests completions:

```python theme={null}
def fetch_user_  # Press Tab
# → def fetch_user_by_id(user_id: int) -> Optional[User]:
```

### Chat with Context

Open Continue sidebar (`Cmd/Ctrl+L`) and ask:

```
@pylance Explain the database schema in models/
```

### Code Actions

Highlight code → Right-click → Continue:

* **Explain Code**: Get detailed explanation
* **Refactor**: Suggest improvements
* **Fix Bugs**: Identify and fix issues
* **Add Tests**: Generate unit tests
* **Add Docs**: Generate docstrings

## Configuration Options

### Custom LLM Provider

Use Claude instead of GPT-4:

```json config.json theme={null}
{
  "models": [{
    "title": "Claude 3 Opus",
    "provider": "anthropic",
    "model": "claude-3-opus-20240229",
    "apiKey": "YOUR_ANTHROPIC_KEY"
  }],
  "mcpServers": [{
    "name": "pylance",
    "command": "python",
    "args": ["-m", "pylance_mcp.server"]
  }]
}
```

### Multiple Workspaces

```json config.json theme={null}
{
  "mcpServers": [
    {
      "name": "pylance-backend",
      "command": "python",
      "args": ["-m", "pylance_mcp.server"],
      "env": {
        "PYLANCE_WORKSPACE": "/workspace/backend"
      }
    },
    {
      "name": "pylance-frontend",
      "command": "python",
      "args": ["-m", "pylance_mcp.server"],
      "env": {
        "PYLANCE_WORKSPACE": "/workspace/frontend"
      }
    }
  ]
}
```

### Remote Server

```json config.json theme={null}
{
  "mcpServers": [{
    "name": "pylance",
    "url": "https://api.pylancemcp.dev",
    "headers": {
      "Authorization": "Bearer ${PYLANCE_API_KEY}"
    }
  }]
}
```

## Advanced Features

### Custom Slash Commands

Define shortcuts for common tasks:

```json config.json theme={null}
{
  "slashCommands": [
    {
      "name": "review",
      "description": "Review code for issues",
      "prompt": "@pylance Review this code for bugs, type errors, and style issues:\n\n{{{ input }}}"
    },
    {
      "name": "tests",
      "description": "Generate pytest tests",
      "prompt": "@pylance Generate comprehensive pytest tests for:\n\n{{{ input }}}"
    },
    {
      "name": "docs",
      "description": "Add documentation",
      "prompt": "@pylance Add Google-style docstrings to:\n\n{{{ input }}}"
    }
  ]
}
```

Usage: Type `/review` in Continue chat

### Context Providers

Include additional context:

```json config.json theme={null}
{
  "contextProviders": [
    {
      "name": "code",
      "params": {
        "includeTypes": ["py", "pyi"],
        "maxFiles": 50
      }
    },
    {
      "name": "docs",
      "params": {
        "urls": [
          "https://docs.python.org/3/",
          "https://fastapi.tiangolo.com/"
        ]
      }
    }
  ]
}
```

### Keyboard Shortcuts

```json keybindings.json theme={null}
[
  {
    "key": "cmd+i",
    "command": "continue.acceptCompletion"
  },
  {
    "key": "cmd+shift+i",
    "command": "continue.rejectCompletion"
  },
  {
    "key": "cmd+l",
    "command": "continue.openChat"
  }
]
```

## Examples

### Code Review

```
/review

def process_payment(amount, card_number):
    # Charge the card
    result = stripe.charge(amount, card_number)
    return result
```

Continue responds:

```
Issues found:
1. Missing type hints
2. No input validation
3. card_number should not be raw string
4. No error handling
5. Missing docstring

Suggested fix:
[shows improved code]
```

### Test Generation

```
/tests

class UserService:
    def create_user(self, email: str, password: str) -> User:
        hashed = hash_password(password)
        return User(email=email, password_hash=hashed)
```

Continue generates:

```python theme={null}
import pytest
from unittest.mock import Mock, patch

def test_create_user_success():
    service = UserService()
    with patch('hash_password') as mock_hash:
        mock_hash.return_value = "hashed_pw"
        user = service.create_user("test@example.com", "password123")
        assert user.email == "test@example.com"
        assert user.password_hash == "hashed_pw"
        mock_hash.assert_called_once_with("password123")

def test_create_user_invalid_email():
    service = UserService()
    with pytest.raises(ValueError):
        service.create_user("invalid-email", "password123")
```

## Troubleshooting

<AccordionGroup>
  <Accordion title="Completions Not Showing">
    * Check Python interpreter is selected
    * Verify workspace folder is open
    * Ensure files are saved
    * Check Continue logs: `Output` → `Continue`
  </Accordion>

  <Accordion title="MCP Server Crashes">
    * Increase memory limit in config
    * Reduce `maxFiles` in context providers
    * Check Python version compatibility (3.9+)
  </Accordion>

  <Accordion title="Slow Performance">
    * Disable unnecessary context providers
    * Reduce workspace scope
    * Use `diagnosticMode: "openFilesOnly"`
  </Accordion>
</AccordionGroup>

## Best Practices

<Check>Use descriptive names in chat for better context</Check>
<Check>Highlight relevant code before asking questions</Check>
<Check>Reference specific files with @filename</Check>
<Check>Use slash commands for repetitive tasks</Check>

## Next Steps

<CardGroup cols={2}>
  <Card title="Windsurf Setup" icon="wind" href="/guides/windsurf-setup">
    Configure for Windsurf IDE
  </Card>

  <Card title="Custom Workspace" icon="folder" href="/guides/custom-workspace">
    Advanced configuration
  </Card>
</CardGroup>
