MCP Server Boilerplate

MCP Server Boilerplate

A minimal, extensible template for building Python-based MCP servers supporting STDIO and SSE transports with VS Code integration.

Category
Visit Server

README

MCP Server Boilerplate

A minimal, extensible template for building Python-based MCP (Model-Context Protocol) servers. This repository provides a small, well-documented starting point that demonstrates common patterns for transport selection, tool registration, configuration, and VS Code integration.

Overview

This boilerplate implements:

  • A simple MCP server entrypoint (mcp_server.py)
  • Pluggable transports (STDIO and SSE) selectable via mcp_settings.py
  • A transport configurator that can generate a .vscode/mcp.json entry
  • A clear place to add MCP tools (commands) and helper modules

The goal is to make it easy to prototype and ship MCP servers that integrate with tooling and editors while keeping the code small and approachable.

Features

  • Example STDIO and SSE transports with configuration
  • Automated VS Code server configuration (mcp_transport_configurator.py)
  • Virtual-environment friendly startup and PYTHONPATH support
  • Lightweight structure for adding MCP tools and utilities

File Structure

├── mcp_server.py
├── mcp_settings.py
├── mcp_setup_env.py
├── mcp_transport_configurator.py
├── mcp_utils.py
├── requirements.txt
├── README.md
└── tools/               # place to add reusable helper modules

Customize the layout as your project grows — add src/, tests/, or split tools into packages.

Setup

  1. Create and activate a virtual environment (recommended):

    python -m venv .venv
    # Windows
    .venv\Scripts\activate
    # macOS/Linux
    source .venv/bin/activate
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. (Optional) Run the environment helper to set a project env var used by the configurator:

    python mcp_setup_env.py
    

Configuration

Edit mcp_settings.py to choose transport protocol and other runtime options:

  • PROTOCOL — set to STDIO (default) or SSE
  • PORT — used only for SSE mode
  • MCP_NAME — logical name used by the transport configurator

Running the Server

Start the server directly:

python mcp_server.py

Or only update the editor/server configuration without starting:

python mcp_transport_configurator.py

VS Code Integration

The included configurator writes a .vscode/mcp.json entry that can be used by editor extensions to launch the MCP server in STDIO mode or connect via SSE.

Development Notes

  • Prefer keeping requirements.txt or migrate to pyproject.toml + lockfile for modern dependency management.
  • Add unit tests under tests/ and run them with your preferred test runner.
  • Keep tools small and focused; register MCP commands from a single initialization point.

Contributing

Contributions are welcome. Open issues or pull requests for bug fixes, documentation improvements, or new example tools demonstrating MCP patterns.

License

See the LICENSE file for licensing details.

Author

Provided as an MCP server boilerplate.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured