Model Context Protocol(MCP) 编程极速入门
@liaokongVFX
Model Context Protocol(MCP) 编程极速入门 について
Model Context Protocol(MCP) 编程极速入门
基本情報
設定
以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。
{
"mcpServers": {
"MCP-Chinese-Getting-Started-Guide": {
"command": "uv",
"args": [
"init",
"mcp_getting_started"
]
}
}
}ツール
ツールは検出されませんでした
ツールは README から自動的に抽出されます。メンテナーは ## Tools という見出しの下に記載することで、このタブに反映できます。
概要
What is Model Context Protocol(MCP) 编程极速入门?
This is a step‑by‑step tutorial that teaches how to build a Model Context Protocol (MCP) server and client from scratch using Python 3.11 and the uv package manager. It focuses on implementing a web‑search tool via the ZhiPu API and integrating it with a large language model like DeepSeek. The guide is designed for developers who want to learn how to connect LLMs to external data sources and tools through MCP.
How to use Model Context Protocol(MCP) 编程极速入门?
Follow the tutorial in order: initialize a uv project, install dependencies (mcp[cli], httpx, openai), write an MCP server using FastMCP, run it via uv run web_search.py, debug with the MCP Inspector (npx -y @modelcontextprotocol/inspector or mcp dev), and finally build a client that uses the OpenAI‑compatible API and the MCP SDK to call tools.
Key features of Model Context Protocol(MCP) 编程极速入门
- Builds an MCP server with the
FastMCPabstraction. - Implements a real‑world web‑search tool using the ZhiPu web‑search‑pro API.
- Uses
stdiotransport to communicate between server and client. - Demonstrates how to call MCP tools from a client using
ClientSession. - Integrates a DeepSeek‑compatible LLM with MCP tools via function calling.
- Covers the
Samplingfeature for human‑in‑the‑loop approval. - Provides a minimal, self‑contained code example with no persistent storage.
Use cases of Model Context Protocol(MCP) 编程极速入门
- Learn how to create an MCP server that exposes a custom tool.
- Understand how to connect any LLM (e.g., DeepSeek) to external APIs through MCP.
- Build a pattern for combining multiple MCP servers into a single agent workflow.
- Prototype a simple but functional AI assistant that can search the web.
FAQ from Model Context Protocol(MCP) 编程极速入门
What dependencies are required to run the examples?
Python 3.11, uv, the Python packages mcp[cli], httpx, openai, and python-dotenv. Node.js is also required for the MCP Inspector.
Does the tutorial require any external API keys?
Yes, you need a ZhiPu API key for the web‑search tool (obtainable at bigmodel.cn) and an API key/compatible endpoint for the LLM (e.g., DeepSeek via OPENAI_BASE_URL).
Where are the data and logs stored?
The examples do not persist any data to disk. All state exists only in memory during a single run. No databases or file storage are used.
What transport is used in the tutorial?
The examples use stdio (standard input/output). The README mentions SSE as an alternative but focuses on stdio.
Can the server be used with other LLMs besides DeepSeek?
Yes, the client code uses the OpenAI‑compatible API, so any LLM that supports the same interface (e.g., OpenAI, DeepSeek) can be used by changing the base_url and model name.
「その他」の他のコンテンツ
Blender
ahujasidOpen-source MCP to use Blender with any LLM
MCP Go 🚀
mark3labsA Go implementation of the Model Context Protocol (MCP), enabling seamless integration between LLM applications and external data sources and tools.
ghidraMCP
LaurieWiredMCP Server for Ghidra
MCP Registry
modelcontextprotocolA community driven registry service for Model Context Protocol (MCP) servers.
Awesome Mlops
visengerA curated list of references for MLOps
コメント