Workspace sync: auto commit 2026-04-23 12:02:11
This commit is contained in:
52
wiki/concepts/Model-Context-Protocol.md
Normal file
52
wiki/concepts/Model-Context-Protocol.md
Normal file
@@ -0,0 +1,52 @@
|
||||
---
|
||||
title: "Model Context Protocol"
|
||||
type: concept
|
||||
tags: [llm, mcp, protocol, tool-calling]
|
||||
sources: [大模型相关术语和框架总结|llm-mcp-prompt-rag-vllm-token-数据蒸馏]
|
||||
last_updated: 2026-04-25
|
||||
---
|
||||
|
||||
# Model Context Protocol (MCP)
|
||||
|
||||
## Aliases
|
||||
- MCP
|
||||
- Model Context Protocol
|
||||
- 模型上下文协议
|
||||
|
||||
## Definition
|
||||
|
||||
Model Context Protocol(MCP,模型上下文协议)是一个开放协议,旨在为 LLM 应用提供**标准化接口**,使其能够连接外部数据源和各种工具进行交互。
|
||||
|
||||
MCP 充当 LLM 与外部世界之间的**标准化通信层**:当 LLM 处理用户请求时需要访问外部信息或功能,MCP Client 向 MCP Server 发送请求;MCP Server 负责与相应的外部数据源或工具交互,获取数据并按 MCP 协议规范格式化后返回给 LLM。
|
||||
|
||||
## Key Insight
|
||||
|
||||
> "大模型是不会自己去调用外部数据源或者工具的,大模型只会告诉我们需要调用哪些工具,而我们需要自己去实现工具的调用。"
|
||||
|
||||
MCP 解决的核心问题:**LLM 只能返回"需要调用什么工具和参数"的描述,不能自己执行**。MCP 提供了 LLM 与工具之间的标准桥梁。
|
||||
|
||||
## Architecture
|
||||
|
||||
```
|
||||
User Request
|
||||
↓
|
||||
LLM(分析请求,决定需要哪些工具)
|
||||
↓
|
||||
MCP Client(发送标准化请求)
|
||||
↓
|
||||
MCP Server(与外部数据源/工具交互)
|
||||
↓
|
||||
格式化结果
|
||||
↓
|
||||
LLM(整合结果,生成最终响应)
|
||||
```
|
||||
|
||||
## Related Concepts
|
||||
|
||||
- [[AI Agent]]:LLM + MCP + 工具执行 = 真正自主的 Agent
|
||||
- [[Prompt]]:MCP Server 的返回结果作为上下文注入 LLM 的 Prompt
|
||||
- [[Large Language Model]]:MCP 扩展了纯 LLM 的能力边界
|
||||
|
||||
## Sources
|
||||
|
||||
- [[大模型相关术语和框架总结|llm-mcp-prompt-rag-vllm-token-数据蒸馏]]
|
||||
Reference in New Issue
Block a user