Get the FREE Ultimate OpenClaw Setup Guide →

mcp -template

Easy Manageable Way to create your own MCP Server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio shubhamgupta-dat-mcp-server-template python -m {{cookiecutter.module_name}}.server

How to use

This MCP server template provides a Python-based server structure that exposes the MCP primitives: Tools, Resources, and Prompts. The project is organized to be extended with your own tool implementations, data sources, and reusable prompt templates, making it easy to add domain-specific functionality for LLM interactions. The server is designed to be run in development and can be integrated with Claude Desktop for local testing. You can run the server in development mode to expose an inspector that helps you test tool calls, resource lookups, and prompts in a controlled environment. The template includes sample components under the tools/, resources/, and prompts/ directories to illustrate how to implement each MCP primitive and how to decorate functions with the provided decorators for automatic registration and lifecycle management. When running, MCP will expose endpoints that LLMs can call to execute tools, fetch context from resources, and format responses using prompts.

How to install

Prerequisites:

  • Python 3.12+ (as recommended by the template)
  • Cookiecutter
  • Git (for cloning templates)
  1. Install prerequisites
  • Ensure Python is installed: python3 --version
  • Install Cookiecutter:
pip install cookiecutter
  1. Generate a new MCP server project from the template
  • From GitHub:
cookiecutter gh:shubhamgupta-dat/mcp-server-cookiecutter
  • From a local copy:
cookiecutter /path/to/mcp-server-cookiecutter
  1. Install dependencies and set up the environment
  • Navigate to the generated project directory
cd your-project-name
  • Install development requirements (via Makefile or pip):
# Using the provided Makefile (recommended)
make setup
  1. Run in development mode
make dev
  1. Optional: Install in Claude Desktop for testing
make install

Notes:

  • The Makefile targets assume the project uses a Python/uv-based setup and a module named as specified during cookiecutter generation.
  • Replace placeholders with your actual module/project names when you generate a real project.

Additional notes

Tips and common considerations:

  • Environment variables: MCP-based projects commonly support configuration via environment variables prefixed with MCP_. For example, MCP_CONFIG_FILE can point to a JSON/YAML config file.
  • If you customize tools/resources/prompts, ensure they are properly registered with the MCP decorators and that your sampling logic respects the MCP protocol (tools return structured results, resources provide stable data sources, and prompts are properly formatted templates).
  • When testing locally, you can use the MCP Inspector provided by the development workflow to verify tool calls and prompt rendering in isolation before integrating with Claude Desktop.
  • If you upgrade Python versions, re-create the virtual environment and reinstall dependencies to avoid compatibility issues.
  • Docker support is available in the template (Dockerfile and related Makefile targets) for containerized deployment and easier environment parity across development and production.

Related MCP Servers

Sponsor this space

Reach thousands of developers