model-context-protocol-templates

model-context-protocol-templates

By XD3an GitHub

MCP 模板和指南集合,用於快速開發 Model Context Protocol (MCP) 服務器(server)。

Overview

what is Model Context Protocol Templates?

Model Context Protocol Templates is a collection of templates and guidelines for the rapid development of Model Context Protocol (MCP) servers, designed to standardize the connection between AI and external data sources.

how to use Model Context Protocol Templates?

To use the templates, developers can refer to the provided guidelines and examples to set up their own MCP servers, facilitating the integration of large language models with external contexts.

key features of Model Context Protocol Templates?

  • Structured framework for integrating AI with external data sources.
  • Collection of templates for quick server development.
  • Guidelines for standardizing AI interactions with external systems.

use cases of Model Context Protocol Templates?

  1. Developing servers that allow AI models to access real-time data.
  2. Enhancing AI responses by providing contextual information from external sources.
  3. Standardizing the way AI interacts with various data systems.

FAQ from Model Context Protocol Templates?

  • What is the purpose of MCP?

MCP aims to provide a standardized protocol for large language models to connect with external data sources, improving their functionality and response accuracy.

  • Is there documentation available for using MCP?

Yes! Comprehensive documentation and examples are provided in the repository to assist developers.

  • Can MCP be used with any AI model?

Yes! MCP is designed to be compatible with various large language models.

Content

model-context-protocol-templates

Introduction

Model Context Protocol(MCP)是 Anthropic 於 2024 年 11 月發布的開源協定,專為大型語言模型(Large Language Model,LLM)設計,旨在解決 AI 與外部資料源和系統連接的標準化問題。MCP 提供了一個結構化框架,使模型能夠在對話中整合和利用外部上下文(context),從而擴展其功能並提高回應的準確性。

MCP 提供以下 3 種能力對 LLM 進行擴展:

  • Resources 對知識擴展
  • Tools 調用外部工具
  • Prompts 預編寫提示詞

參考以下:

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

No tools information available.
No content found.