model-context-protocol-templates logo

model-context-protocol-templates

by XD3an

This repository provides templates for creating Model Context Protocol (MCP) servers. MCP is an open-source protocol designed for large language models to standardize connecting AI with external data sources and systems.

View on GitHub

Last updated: N/A

model-context-protocol-templates

πŸ‘‰ Introduction

Model Context Protocol (MCP) is an open source protocol released by Anthropic in November 2024. It is designed for large language models (LLM) and aims to solve the standardization problem of connecting AI with external data sources and systems. MCP provides a structural framework that enables models to integrate and leverage external context in conversations, thereby extending their capabilities and improving the accuracy of their responses.

MCP provides the following three capabilities to extend LLM:

  • Resources for knowledge expansion
  • Tools calls external tools
  • Prompts Pre-written prompts

Refer to the following:

πŸ‘¨β€πŸ’» SDK πŸ‘©β€πŸ’»

πŸ”˜ Quickstart

πŸ”Debugging & Inspection

Debugging

  1. MCP Inspector

  2. Claude Desktop Developer Tools

  3. Server Logging

Inspector

npx @modelcontextprotocol/inspector <command> <arg1> <arg2>
Inspecting servers from NPM or PyPi
  • NPM package

    npx -y @modelcontextprotocol/inspector npx <package-name> <args>
    # For example
    npx -y @modelcontextprotocol/inspector npx server-postgres postgres://127.0.0.1/testdb
    
  • PyPi package

    npx @modelcontextprotocol/inspector uvx <package-name> <args>
    # For example
    npx @modelcontextprotocol/inspector uvx mcp-server-git --repository ~/code/mcp/servers.git
    
Inspecting locally developed servers
  • TypeScript

    npx @modelcontextprotocol/inspector node path/to/server/index.js args...
    
  • Python

    npx @modelcontextprotocol/inspector \
        uv \
        --directory path/to/server \
        run \
        package-name \
        args...
    

πŸ’» MCP Servers

🧾 Templates

Python MCP Server Template

TypeScript MCP Server Template

Java MCP Server Template

Kotlin MCP Server Template

🚨 MCP Security