mcp-vscode-template

mcp-vscode-template

By timsonner GitHub

MCP server template for VS Code

mcp vscode
Overview

what is mcp-vscode-template?

The mcp-vscode-template is a server template designed for use with Visual Studio Code (VS Code) that facilitates the setup of an MCP (Multi-Channel Processing) server.

how to use mcp-vscode-template?

To use the mcp-vscode-template, follow the setup instructions to install the necessary dependencies, create a virtual environment, and configure the server settings in VS Code. You can initialize the project and start the server using specific commands in the terminal.

key features of mcp-vscode-template?

  • Easy setup for an MCP server in VS Code.
  • Customizable server configuration.
  • Based on existing work with modifications for enhanced functionality.

use cases of mcp-vscode-template?

  1. Setting up a development environment for MCP applications.
  2. Running external reconnaissance scripts in a controlled environment.
  3. Facilitating collaborative development in security projects.

FAQ from mcp-vscode-template?

  • What programming language is used?

The project is primarily written in Python.

  • Is there any specific Python version required?

Yes, Python version 3.11 or above is recommended for this project.

  • Can I modify the server settings?

Yes, the server settings can be customized in the VS Code settings.json file.

Content

mcp-vscode-template

MCP server template for VS Code Agent

Setup

Install uv however you like. May options available.
https://docs.astral.sh/uv/getting-started/installation/

Project setup is heavily based off of Renae Schilg's work. I didn't even bother to change the project name as an homage although I did deviate on a few things, namely not using Claude Desktop, but also modified external-recon.py fairly heavily.
https://nae-bo.medium.com/building-your-first-offensive-security-mcp-server-dd655e258d5f

# Initialize project
uv init external-recon
cd external-recon

I had to modify the python versions in .python-version to 3.11 or something above 3.8 or 3.10
I also had to modify the line requires-python = ">=3.11" in pyroject.toml to something above 3.8 or 3.10 Mileage will vary... It may not be necessary.

# Create virtual environment and activate it
uv venv --python 3.11
source .venv/bin/activate

# Install mcp
uv add "mcp[cli]"

# Install dnspython (dependency for external-recon.py, not necessary for all projects, but for this one yes)
uv pip install dnspython

# Create MCP server external-recon.py file or empty and rename main.py
touch external-recon.py

The VS Code settings.json should be modified.
Use which uv to find the path to uv.
The "/path/to/project/external-recon" should refer to the project path, where the MCP server .py file is located (use absoulte path).

settings.json

    "mcp": {
        "servers": {
                "external-recon": {
                 "command": "/path/to/uv",
                 "args": [
                  "--directory",
                  "/path/to/project/external-recon",
                  "run",
                  "external-recon.py"
                 ]
                }
        }
    },

One of the main differences between Renae's work and mine is I used @mcp.tool() instead of @mcp.prompt() in external-recon.py

Start the server

From the venv of the project, start the server with uv run external-recon.py
Example:

(external-recon) user@workstation external-recon % uv run external-recon.py
No tools information available.

This is a basic MCP Server-Client Impl using SSE

mcp server-client
View Details

-

mcp model-context-protocol
View Details

Buttplug.io Model Context Protocol (MCP) Server

mcp buttplug
View Details

MCP web search using perplexity without any API KEYS

mcp puppeteer
View Details

free MCP server hosting using vercel

mcp mantle-network
View Details

MCPHubs is a website that showcases projects related to Anthropic's Model Context Protocol (MCP)

mcp mcp-server
View Details