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.
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:
-
https://www.anthropic.com/news/model-context-protocol
-
https://modelcontextprotocol.io/introduction
π¨βπ» SDK π©βπ»
π Quickstart
πDebugging & Inspection
Debugging
-
MCP Inspector
-
Claude Desktop Developer Tools
-
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
-
Features
- Resources
- Tool
- Prompt
- Image
- Context
- ...
TypeScript MCP Server Template
Java MCP Server Template
Kotlin MCP Server Template
π¨ MCP Security
- InvariantLabs: MCP Security Notification Tool Poisoning Attacks : A new security issue has been identified in the MCP protocol.
- /security/mcp-security-demo
- demo1: MCP Rug Pulls
- demo2: Shadowing Tool Descriptions
- /security/mcp-security-demo