VS Code + Copilot

Set up ContextPin with Visual Studio Code and GitHub Copilot.

Visual Studio Code with GitHub Copilot can use ContextPin through MCP extensions. This guide shows you how to set up the integration.

MCP Extension for VS Code

VS Code requires an MCP extension to connect to servers like ContextPin. Several community extensions provide this functionality.

Step 1: Install MCP Extension

  1. Open VS Code Extensions (⌘⇧X)
  2. Search for "MCP Client" or "Model Context Protocol"
  3. Install a compatible extension
The MCP ecosystem is evolving. Check the VS Code marketplace for the latest MCP extensions.

Step 2: Configure the Extension

After installation, configure the extension with your ContextPin settings:

  1. Open VS Code Settings (⌘,)
  2. Search for the MCP extension settings
  3. Add ContextPin as a server

Configuration Values

Add this to your VS Code settings.json:

macOS

{
  "mcp.servers": {
    "contextpin": {
      "command": "/Applications/ContextPin.app/Contents/MacOS/contextpin-mcp",
      "args": ["--workspace", "YOUR_WORKSPACE_ID"]
    }
  }
}

Windows

{
  "mcp.servers": {
    "contextpin": {
      "command": "C:\\Program Files\\ContextPin\\contextpin-mcp.exe",
      "args": ["--workspace", "YOUR_WORKSPACE_ID"]
    }
  }
}

Linux

{
  "mcp.servers": {
    "contextpin": {
      "command": "/opt/contextpin/contextpin-mcp",
      "args": ["--workspace", "YOUR_WORKSPACE_ID"]
    }
  }
}

Using with Copilot Chat

Once configured, you can reference ContextPin in Copilot Chat:

Opening Copilot Chat

  • Click the Copilot icon in the sidebar
  • Or use keyboard shortcut ⌘⇧I

Referencing Contexts

"@contextpin list contexts"

"Read my Code Standards from @contextpin"

"Using @contextpin API Guidelines, help me design this endpoint"

Enhancing Inline Suggestions

While inline Copilot suggestions don't directly access MCP, you can:

  1. Use Copilot Chat to generate code following your contexts
  2. Copy the result into your file
  3. Or ask Copilot Chat to apply changes directly

Alternative: Direct API Integration

If MCP extensions aren't available or suitable, you can:

Use Workspace Files

Export your contexts as markdown files in your project:

  1. In ContextPin, select a context
  2. Export as Markdown
  3. Save in your project (e.g., .docs/ folder)
  4. Copilot can then reference these files naturally

Use Copilot Instructions

Create a .github/copilot-instructions.md file:

# Copilot Instructions

When generating code for this project, follow these guidelines:

## Code Standards
- Use TypeScript with strict mode
- Follow functional patterns
- Max function length: 30 lines

## Naming Conventions
- Components: PascalCase
- Functions: camelCase
- Constants: SCREAMING_SNAKE_CASE

Verify the Setup

  1. Restart VS Code after configuration changes
  2. Open Copilot Chat
  3. Try: "@contextpin list my contexts"
  4. If successful, you'll see your ContextPin contexts

Troubleshooting

Extension Not Working

  • Check the extension's documentation for specific setup steps
  • Verify the extension is enabled
  • Look for error messages in VS Code's Output panel

No Connection to ContextPin

  • Make sure ContextPin is running
  • Verify the command path is correct
  • Check the workspace ID

Copilot Not Recognizing MCP

  • MCP support in Copilot may require specific extensions
  • Consider using the alternative approaches above
  • Check for updates to Copilot that may add MCP support

Current Status

Native MCP support in VS Code and GitHub Copilot is still evolving. Check the latest documentation for your specific extensions, as capabilities may have expanded since this guide was written.

Next Steps