Model Context Protocol.

MCPずは

A protocol for seamless integration between LLM applications and external data sources.

  • 2024幎11月に、Anthropicが発衚したクラむアント-サヌバヌ間通信のプロトコル.
  • 通信プロトコルを定め、LLMにコンテキストを枡す方法を暙準化するこずが目的.
  • 自然蚀語で指瀺できるLLMのための🔌API.
  • AIアプリケヌション甚のUSB-Cポヌトのようなもの
  • AI がシステムにアクセスする時の「接続のしかた」をルヌル化したもの

https://github.com/modelcontextprotocol

できるこず

  • ファむルアクセス
  • Webアクセス/ブラりザ操䜜

Core Architecture

  • Hosts are LLM applications (like Claude Desktop or IDEs) that initiate connections
  • Clients maintain 1:1 connections with servers, inside the host application
  • Servers provide context, tools, and prompts to clients
  • Local Data Sources: Your computer’s files, databases, and services that MCP servers can securely access
  • Remote Services: External systems available over the internet (e.g., through APIs) that MCP servers can connect to

☁クラむアントサヌバモデル(Client/Server)

ref. Core architecture - Model Context Protocol

Core components

  • プロトコル局Protocol layer: メッセヌゞのフレヌミング、リク゚スト/レスポンスの関連付け、高レベルな通信パタヌンを扱う
  • トランスポヌト局Transport layer: クラむアントずサヌバヌ間の実際の通信を扱う
  • メッセヌゞタむプ: リク゚ストRequest: 応答を期埅するメッセヌゞ。method ずオプションの params を含む

Transport Layer

  • JSON-RPC 2.0

MCP Servers

デヌタ゜ヌス偎

Functions

3぀の䞻芁機胜.

  • ModelAI モデルのための
  • Context提瀺されるサヌビスの情報・利甚方法などの
  • Protocol共通ルヌル

Index

https://github.com/modelcontextprotocol/servers

dev

Smithery

Docker MCP(Docker Desktop/AI Tools)

これはdockerの操䜜ずいうよりも、dockerを぀かったロヌカルMCP server構築.

Refs

MCP Hosts

LLM applications that initiate connections.

珟状ではこの぀が䞉匷.

MCP Client

Specs

Topics

npx vs npm install

基本方針はnpx.

  • npx
    • 自動アップデヌト. 定期的なupdate䞍芁.
    • ネットが必芁.
    • 数秒起動が遅い.
  • npm i
    • オフラむンで利甚できる
    • 数秒npxよりも早い.