Files
nexus/wiki/concepts/ModalContextProtocol.md
2026-04-27 08:02:55 +08:00

43 lines
1.6 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: "Modal Context Protocol (MCP)"
type: concept
tags: [ai, ai-agent, mcp, protocol]
sources: [mcp在cursor中的集成与应用详解]
last_updated: 2026-04-26
---
## Definition
MCPModal Context Protocol是一种基于 **Client-Server 架构**的协议,旨在实现 AI 大模型与外部工具和服务的高效集成。MCP 为 AI 应用提供了标准化的工具扩展框架,使大模型能够无缝调用外部数据源和工具。
## Architecture
MCP 基于 Client-Server 架构,包含两个核心组件:
- **MCP Server服务端**:服务提供方,负责对外暴露资源和工具接口。
- **MCP Client客户端**:集成 MCP 协议的应用程序或大模型对话客户端(如 Cursor、Claude Desktop
## Core Interfaces
MCP Server 提供三类核心功能接口:
| 接口类型 | 类比 | 用途 |
|----------|------|------|
| 资源访问Resource | HTTP GET | 获取外部数据 |
| 工具调用Tool | HTTP POST | 执行外部操作 |
| Promise 提示词 | 扩展接口 | 异步交互 |
## MCP in Cursor
在 Cursor 中MCP Server 有两种接入方式:
1. **SSEServer-Sent Events**:通过 HTTP SSE 方式连接远程 MCP Server。
2. **Command命令行**:通过本地执行命令的方式与 MCP Server 交互。
接入后在 Cursor Composer 中切换到 Agent 模式即可调用 MCP 工具链。
## Connections
- [[Mcp在Cursor中的集成与应用详解]] ← 使用场景
- [[McpBuilderAgent]] ← 构建工具
- [[Cursor]] ← 客户端
- [[SequentialThinking]] ← 常用 MCP 工具
## See Also
- [[ClientServerArchitecture]]
- [[AgentMode]]
- [[McpBuilderAgent]]