Files
nexus/wiki/concepts/Model-Context-Protocol.md

53 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
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 ProtocolMCP模型上下文协议是一个开放协议旨在为 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-数据蒸馏]]