VS Code MCP Client Extension
MCP Client for VS Code
A Visual Studio Code extension that connects to MCP (Model Control Protocol) servers via WebSocket, allowing you to execute prompts and receive responses directly from your editor.
Features
- Connect to MCP servers via WebSocket
- Execute prompts and receive responses
- Integrate with VS Code's status bar for easy access
- Configurable server URLs and authentication
Installation
From VS Code Marketplace
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "MCP Client"
- Click "Install"
Manual Installation
- Download the
.vsix
file from the releases page
- Open VS Code
- Go to the Extensions view (Ctrl+Shift+X)
- Click on the "..." menu in the top-right corner of the Extensions view
- Select "Install from VSIX..."
- Navigate to and select the
.vsix
file
- Click "Install"
Generating a VSIX File
To generate a VSIX file from source:
# Install dependencies if you haven't already
npm install
# Use our direct packaging method that bypasses all dependency validation
npm run direct-package
This will create a .vsix
file in the project root directory that you can share or install manually, regardless of dependency issues.
Alternatively, you can run one of these commands directly in your terminal:
# Option 1: Direct npx command
npx vsce package --no-dependencies --no-yarn
# Option 2: Ultimate fallback if nothing else works
npx vsce package --no-dependencies --no-yarn --skip-license
Note: See PACKAGING_HELP.md for troubleshooting packaging issues.
Usage
Configuration
You can configure the extension in VS Code settings:
{
"mcpClient.serverUrl": "ws://localhost:8080",
"mcpClient.apiKey": "your-api-key"
}
Commands
This extension provides the following commands:
MCP Client: Connect to Server
: Connect to the configured MCP server
MCP Client: Execute Prompt
: Send a prompt to the MCP server
MCP Client: Disconnect
: Disconnect from the MCP server
Status Bar
The extension adds an icon to the status bar that shows the connection status:
- 🔴 Disconnected
- 🟡 Connecting
- 🟢 Connected
Clicking on the status bar icon provides quick access to common commands.
Development
Building from Source
Clone the repository:
git clone https://github.com/yourusername/vscode-mcp-client.git
cd vscode-mcp-client
Install dependencies:
npm install
Compile the extension:
npm run compile
Package the extension:
npx vsce package
Testing
Run the tests with:
npm test
Or launch the Extension Development Host by pressing F5 in VS Code.
License
MIT
A VS Code extension that implements a Model Control Protocol (MCP) client, similar to Cursor. This extension allows you to connect to MCP servers running in Docker containers and use LLMs through your own API keys.
Note: For detailed installation and usage instructions, please see the USAGE_GUIDE.md file.
Features
- Connect to MCP servers
- Execute AI prompts with current file context
- View AI responses in a dedicated panel
- Status bar indicators for connection and processing status
Requirements
- VS Code 1.60.0 or higher
- Access to an MCP server (can be run locally in Docker)
- LLM API key (e.g., OpenAI, Anthropic, etc.)
Setup
- Install the extension in VS Code
- Configure the extension settings:
mcpClient.serverUrl
: URL of your MCP server
mcpClient.apiKey
: Your LLM API key
- Connect to the server using the command palette (
MCP: Connect to Server
)
Usage
- Connect to an MCP server using the command palette or by clicking the connection status in the status bar
- Execute a prompt using the command palette (
MCP: Execute Prompt
)
- View the AI response in the dedicated panel
Extension Settings
This extension contributes the following settings:
mcpClient.serverUrl
: URL of the MCP server (default: http://localhost:8080)
mcpClient.apiKey
: API Key for the LLM service
Setting Up Your Own MCP Server
You'll need to set up your own MCP server to use with this extension. The server should be compatible with the Model Control Protocol.
Running with Docker
docker run -p 8080:8080 -e API_KEY=your_api_key your-mcp-server-image
Development
Building the Extension
- Clone the repository
- Run
npm install
to install dependencies
- Run
npm run compile
to compile the TypeScript code
- Press F5 to run the extension in debug mode
Next Steps
- Implement the MCP server component that can be run in a Docker container
- Add support for different LLM providers
- Implement streaming responses
- Add code completion features
License
MIT