大模型MCP制作旅游攻略
1 、 需求
2 、 什么是 mcp ?
3 、 ⾼德配置
4 、 cursor
5 、 制作过程
第—步: cursor 中配置⾼德 mcp server
第⼆步:提示词
6 、 代码
1 、 需求
使⽤ 大模型cursor + mcp 实现—份⾮常精美的五—旅游攻略
2 、 什么是 mcp?
3 、 ⾼德配置
⾼德开放平台:https://console.amap.com/dev/key/app
点击:快速接⼊指南
https://lbs.amap.com/api/mcp-server/gettings
4 、cursor
https://www.cursor.com/cn
下载安装:
需要注册和登录 Cursor, 登录成功后, 选择 AI 使⽤的语⾔:
新建⽂件夹 gonglve,然后打开⽬录, 点击拓展,输⼊ Chinese 进⾏安装
点击 Ctrl + shift + p ,输⼊命令:configure display language, 选择 中⽂(简体)
5 、 制作过程
第⼀步 :cursor 中配置⾼德 mcp server
|
|
1 |
{ |
|
"mcpServers": { |
|
"amap-amap-sse": { |
"url": "https://mcp.amap.com/sse?key = 您在⾼德官⽹上申请的key" | |
5 |
} |
6 |
} |
7 |
} |
第⼆步 :提示词
第—次的提示词:
使⽤⾼德MCP服务, 为我规划从北京到洛阳, 2025 年 5 ⽉ 1 ⽇ ~5 ⽉ 5 ⽇ , 5 天的旅游指南, 坐⾼ 铁或者⻜机都可以, 我喜欢历史遗迹 、⼈⽂ 、 ⾃然景观, ⽐较喜欢各个地⽅的当地特⾊美⻝, 酒店⾄ 少三星以上 。请为我推荐靠近景点的酒店和景点往来之间的交通⽅式 。我的总预算是 5000 元。
第⼆次提示词:
我是年轻⼈, 体⼒旺, 每天可以玩8⼩时, 可以再多安排—些景点, 费⽤不变。
第三次的提示词:
请将这个5天的计划, ⽣成为—个html⽂件, 界⾯要美观, 适应 pc 和⼿机端, 点击地址可以打开⾼德 地图
第四次的提示词:
⽣成的链接, 跳转不到⾼德地图, 报404错误, 请检查, 修复
使⽤浏览器打开, ⾮常的漂亮
6 、 代码
1 <!DOCTYPE html>
2 <html lang="zh-CN">
3 <head>
4 <meta charset="UTF-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1.
0">
6 <title>洛阳五⽇游攻略 - 2025年5⽉</title>
7 <style>
8- * {
9 margin: 0;
10 padding: 0;
11 box-sizing: border-box;
12 }
13
14 body {
15 font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", R oboto, "Helvetica Neue", Arial, sans-serif;
16 line-height: 1.6;
17 color: #333;
18 max-width: 1200px;
19 margin: 0 auto;
20 padding: 20px;
21 background-color: #f5f5f5;
22 } 23
24 .header {
25 text-align: center;
26 padding: 40px 0;
27 background: linear-gradient(135deg, #1e3c72 0%, #2a5298 10 0%);
28 color: white;
29 border-radius: 10px;
30 margin-bottom: 30px;
31 } 32
33- .header h1 {
34 font-size: 2.5em;
35 margin-bottom: 10px;
36 } 37
38 .header p {
39 font-size: 1.2em;
40 opacity: 0.9;
41 }
42
43 .card {
44 background: white;
45 border-radius: 10px;
46 padding: 20px;
47 margin-bottom: 20px;
48 box-shadow: 0 2px 4px rgba(0,0,0,0.1);
49 }
50
51 .day-title {
52 color: #1e3c72;
53 border-bottom: 2px solid #1e3c72;
54 padding-bottom: 10px;
55 margin-bottom: 20px;
56 }
57
58 .schedule-item {
59 margin-bottom: 15px;
60 padding-left: 20px;
61 border-left: 3px solid #1e3c72;
62 }
63
64 .time {
65 font-weight: bold;
66 color: #2a5298;
67 }
68
69 .location {
70 color: #0066cc;
71 text-decoration: none;
72 padding: 2px 5px;
73 border-radius: 3px;
74 transition: background-color 0.3s;
75 }
76
77 .location:hover {
78 background-color: #f0f7ff;
79 }
80
81 .budget-section {
82 display: grid;
83 grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
84 gap: 20px;
85 margin-top: 20px;
86 }
87
88 .budget-item {
89 background: #f8f9fa;
90 padding: 15px;
91 border-radius: 8px;
92 border-left: 4px solid #1e3c72;
93 }
94
95 .tips {
96 background-color: #e8f4f8;
97 padding: 20px;
98 border-radius: 8px;
99 margin-top: 20px;
100 }
101
102 .tips h3 {
103 color: #1e3c72;
104 margin-bottom: 10px;
105 }
106
107 .tips ul {
108 list-style-position: inside;
109 }
110
111 @media (max-width: 768px) {
112 body {
113 padding: 10px;
114 }
115
116 .header {
117 padding: 20px 0;
118 }
119
120 .header h1 {
121 font-size: 1.8em;
122 }
123
124 .budget-section {
125 grid-template-columns: 1fr;
126 }
127 }
128 </style>
129 </head>
130 <body>
131 <div class="header">
132 <h1>洛阳五⽇游攻略</h1>
133 <p>2025年5⽉1⽇ - 5⽉5⽇</p>
134 </div>
135
136 <div class="card">
137 <h2 class="day-title">交通⽅案</h2>
138 <div class="schedule-item">
139 <p><span class="time">⾼铁⽅案:</span> 北京站/北京⻄站 -> 洛阳龙 ⻔站,约4-5⼩时,票价⼆等座约420-500元</p>
140 <p><span class="time">飞机⽅案:</span> 北京⾸都机场 -> 洛阳北郊机 场,约2⼩时,机票约800-1200元</p>
141 </div>
142 </div>
143
144 <div class="card">
145 <h2 class="day-title">推荐住宿</h2>
146 <div class="schedule-item">
147 <p><span class="time">⽼城区:</span> <a class="location" href ="uri.amap.com/marker?position=112.453895,34.619702&name=洛阳升龙 ⼴场亚朵酒店" target="_blank">洛阳升龙⼴场亚朵酒店</a>( 四星,约300-400元/晚)</p
148 >
<p><span class="time">龙⻔区域:</span> <a class="location" hr ef="uri.amap.com/marker?position=112.477141,34.567215&name=洛阳龙
149 ⻔⽯窟智选假⽇酒店" target="_blank">洛阳龙⻔⽯窟智选假⽇酒店</a>( 四星,约350-450 元/晚)</p>
</div>
150 </div>
151
152 <div class="card">
153 <h2 class="day-title">第—天( 5⽉1⽇ ):抵达洛阳</h2>
154 <div class="schedule-item">
155 <p><span class="time">上午:</span> 北京出发( 建议乘坐上午的⾼铁) </p>
156 <p><span class="time">下午:</span> 抵达洛阳,⼊住⽼城区酒店</p>
157 <p><span class="time">晚上:</span> 游览<a class="location" hr ef="https://uri.amap.com/marker?position=112.469687,34.681462&name=洛⾢古 城" target="_blank">洛⾢古城</a>, 品尝洛阳⽔席</p>
158 <p><span class="time">特⾊美⻝:</span> 洛阳牡丹燕菜 、银针⾯ 、胡辣 汤</p>
159 </div>
160 </div>
161
162 <div class="card">
163 <h2 class="day-title">第⼆天( 5⽉2⽇ ):⽼城区游览</h2>
164 <div class="schedule-item">
165 <p><span class="time">上午:</span> <a class="location" href ="uri.amap.com/marker?position=112.605311,34.721828&name=⽩⻢寺" t arget="_blank">⽩⻢寺</a>( ⻔票60元)</p>
166 <p><span class="time">中午:</span> 品尝洛阳杂肝汤</p>
167 <p><span class="time">下午:</span> <a class="location" href ="uri.amap.com/marker?position=112.469825,34.682115&name=洛阳博物
168 馆" target="_blank">洛阳博物馆</a>( 免费) 、天⼦驾六博物馆</p>
<p><span class="time">晚上:</span> <a class="location" href
169 ="uri.amap.com/marker?position=112.469687,34.681462&name=丽景⻔夜 市" target="_blank">丽景⻔夜市</a></p>
</div>
170 </div>
171
172
<div class="card">
173 <h2 class="day-title">第三天( 5⽉3⽇ ):龙⻔⽯窟</h2>
174 <div class="schedule-item">
175 <p><span class="time">上午:</span> 换住龙⻔区域酒店,游览<a clas s="location" href="uri.amap.com/marker?position=112.477141,34.567
176 215&name=龙⻔⽯窟" target="_blank">龙⻔⽯窟</a>( ⻔票120元)</p>
<p><span class="time">中午:</span> 龙⻔⽯窟附近农家乐</p>
177 <p><span class="time">下午:</span> 继续游览龙⻔⽯窟,<a class="l ocation" href="uri.amap.com/marker?position=112.475874,34.563199&
178 name=⾹⼭寺" target="_blank">⾹⼭寺</a></p>
<p><span class="time">晚上:</span> 龙⻔⼤道夜市</p>
179 </div>
180
</div>
181
182
<div class="card">
183 <h2 class="day-title">第四天( 5⽉4⽇ ):关林-⽼君⼭</h2>
184 <div class="schedule-item">
185 <p><span class="time">上午:</span> <a class="location" href ="uri.amap.com/marker?position=112.401780,34.658220&name=关林" ta
186 rget="_blank">关林</a>( ⻔票50元)</p>
<p><span class="time">中午:</span> 品尝关林⽔席</p>
187 <p><span class="time">下午:</span> <a class="location" href
188 ="uri.amap.com/marker?position=112.854681,34.477466&name=⽼君⼭风 景区" target="_blank">⽼君⼭风景区</a>( ⻔票90元)</p>
<p><span class="time">晚上:</span> 返回酒店, 品尝特⾊⼩吃</p>
189 </div>
190
</div>
191
192
<div class="card">
193 <h2 class="day-title">第五天( 5⽉5⽇ ):返程</h2>
194 <div class="schedule-item">
195 <p><span class="time">上午:</span> <a class="location" href
196 ="uri.amap.com/marker?position=112.442252,34.627755&name=洛阳国花 园" target="_blank">洛阳国花园</a>( 赏牡丹, ⻔票40元)</p>
<p><span class="time">中午:</span> 购买特产(核桃 、牡丹饼等)</p>
197 <p><span class="time">下午:</span> 返回北京</p>
198 </div>
199 </div>
200
201
<div class="card">
202 <h2 class="day-title">预算分配( 约5000元)</h2>
203 <div class="budget-section">
204 <div class="budget-item">
205 <h3>交通费</h3>
206 <p>⾼铁往返:约1000元</p> 207 <p>市内交通:约400元</p>
208 </div>
209 <div class="budget-item">
210 <h3>住宿费</h3>
211 <p>4晚住宿:约1500元</p>
212 </div>
213 <div class="budget-item">
214 <h3>⻔票费</h3>
215 <p>景点⻔票总计:约360元</p>
216 </div>
217 <div class="budget-item">
218 <h3>餐饮费</h3>
219 <p>⽇均150元, 5天约750元</p>
220 </div>
221 <div class="budget-item">
222 <h3>购物和其他</h3>
223 <p>特产和纪念品:约500元</p>
224 <p>预备⾦: 约490元</p>
225 </div>
226 </div> 227 </div>
228
229 <div class="card tips">
230 <h3>出⾏建议</h3>
231 <ul>
232 <li>5⽉天⽓较好,但昼夜温差⼤, 建议带件外套</li>
233 <li>洛阳公共交通便利,可以下载⾼德地图导航</li>
234 <li>建议提前在⽹上预订酒店和景点⻔票</li>
235 <li>准备—些零⻝和⽔ ,景区游览时补充体⼒</li>
236 <li>龙⻔⽯窟游览建议请导游讲解,更能了解历史⽂化</li>
237 </ul>
238 </div>
239 </body
总结
MCP (Model Context Protocol) 代表了 AI 与外部工具和数据交互的标准建立。MCP 的本质:它是一个统一的协议标准,使 AI 模型能够以一致的方式连接各种数据源和工具,类似于 AI 世界的"USB-C"接口。
它能够在 LLM/AI Agent 与外部资源之间实现无缝、安全且可扩展的数据交换。MCP 采用客户端-服务器架构,其中 MCP 主机(AI 应用)与 MCP 服务器(数据/工具提供方)进行通信。开发者可以使用 MCP 构建可复用、模块化的连接器,并利用针对主流平台的预构建服务器,从而打造一个由社区驱动的生态系统。
MCP 的价值:它解决了传统 function call 的平台依赖问题,提供了更统一、开放、安全、灵活的工具调用机制,让用户和开发者都能从中受益。
使用与开发:对于普通用户,MCP 提供了丰富的现成工具,用户可以在不了解任何技术细节的情况下使用;对于开发者,MCP 提供了清晰的架构和 SDK,使工具开发变得相对简单。
- 点赞
- 收藏
- 关注作者
评论(0)