mcp-server-maptec 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mcp_server_maptec-1.0.0/.gitignore +12 -0
- mcp_server_maptec-1.0.0/LICENSE +21 -0
- mcp_server_maptec-1.0.0/PKG-INFO +225 -0
- mcp_server_maptec-1.0.0/README.md +204 -0
- mcp_server_maptec-1.0.0/pyproject.toml +45 -0
- mcp_server_maptec-1.0.0/schemas/tools.json +237 -0
- mcp_server_maptec-1.0.0/scripts/publish.sh +119 -0
- mcp_server_maptec-1.0.0/scripts/verify.sh +26 -0
- mcp_server_maptec-1.0.0/scripts/verify_mcp.py +141 -0
- mcp_server_maptec-1.0.0/src/maptec_mcp_python/__init__.py +3 -0
- mcp_server_maptec-1.0.0/src/maptec_mcp_python/__main__.py +4 -0
- mcp_server_maptec-1.0.0/src/maptec_mcp_python/client/__init__.py +0 -0
- mcp_server_maptec-1.0.0/src/maptec_mcp_python/client/maptec_client.py +157 -0
- mcp_server_maptec-1.0.0/src/maptec_mcp_python/config.py +30 -0
- mcp_server_maptec-1.0.0/src/maptec_mcp_python/schemas/tools.json +237 -0
- mcp_server_maptec-1.0.0/src/maptec_mcp_python/server.py +54 -0
- mcp_server_maptec-1.0.0/src/maptec_mcp_python/utils/__init__.py +0 -0
- mcp_server_maptec-1.0.0/src/maptec_mcp_python/utils/filter.py +28 -0
- mcp_server_maptec-1.0.0/src/maptec_mcp_python/utils/mask.py +13 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Maptec
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: mcp-server-maptec
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: MapTech MCP Server (Python) - stdio transport for Cursor / Claude Desktop
|
|
5
|
+
Project-URL: Homepage, https://github.com/maptechbj/maptec-mcp-python
|
|
6
|
+
Project-URL: Repository, https://github.com/maptechbj/maptec-mcp-python
|
|
7
|
+
Author: MapTech
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: http,lbs,map,maptec,mcp
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
17
|
+
Requires-Python: >=3.11
|
|
18
|
+
Requires-Dist: httpx>=0.27.0
|
|
19
|
+
Requires-Dist: mcp[cli]>=1.12.0
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# mcp-server-maptec
|
|
23
|
+
|
|
24
|
+
Maptec的webapi服务已全面兼容[MCP协议](https://modelcontextprotocol.io/docs/getting-started/intro)。
|
|
25
|
+
Maptec MCP Server支持10个LBS服务能力,包含了地点检索、周边检索、输入提示、地点详情、地理编码、逆地理编码、路线规划、距离矩阵、轨迹纠偏、IP定位。
|
|
26
|
+
|
|
27
|
+
## 环境变量
|
|
28
|
+
|
|
29
|
+
| 变量 | 默认值 | 说明 |
|
|
30
|
+
|------|--------|------|
|
|
31
|
+
| `MAPTEC_API_KEY` | — | **必填**,`mp_1_...` 格式 |
|
|
32
|
+
| `MAPTEC_BASE_URL` | `https://api.maptec.cn` | WebAPI 地址 |
|
|
33
|
+
| `MAPTEC_TIMEOUT_MS` | `30000` | HTTP 超时(毫秒) |
|
|
34
|
+
|
|
35
|
+
## 快速开始
|
|
36
|
+
|
|
37
|
+
### 1. 注册账号并申请 AK
|
|
38
|
+
|
|
39
|
+
前往 **Maptec 开发者中心** 注册账号,创建应用并申请 API Key(AK,`mp_1_...` 格式)。
|
|
40
|
+
|
|
41
|
+
### 2. 安装 Python 包
|
|
42
|
+
|
|
43
|
+
推荐使用 [uv](https://docs.astral.sh/uv/) 一键运行(无需预先安装):
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
uvx mcp-server-maptec
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
或通过 pip 安装:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pip install mcp-server-maptec
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
安装后可执行:`maptec-mcp-python`
|
|
56
|
+
|
|
57
|
+
### 3. 在 Cursor 中配置 MCP
|
|
58
|
+
|
|
59
|
+
以 Cursor 为例,在其 MCP 配置中加入以下内容,填入上一步申请的 API Key 后保存,进入 **Settings → MCP → Reload**:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"mcpServers": {
|
|
64
|
+
"maptec": {
|
|
65
|
+
"command": "uvx",
|
|
66
|
+
"args": ["mcp-server-maptec"],
|
|
67
|
+
"env": {
|
|
68
|
+
"MAPTEC_API_KEY": "mp_1_YOUR_KEY",
|
|
69
|
+
"MAPTEC_BASE_URL": "https://api.maptec.cn"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
确认 `maptec` 为绿点 Connected,展开可见 10 个 Tool。
|
|
77
|
+
|
|
78
|
+
上述 `mcpServers` 为 MCP stdio 通用配置,Claude Desktop、Cline、Windsurf 等支持 MCP 的客户端同样适用,差异仅在于配置文件位置与重载方式。
|
|
79
|
+
|
|
80
|
+
### 4. 应用场景示例:第三方智能体调用 MCP 查询美食
|
|
81
|
+
|
|
82
|
+
除 Cursor 等 IDE 外,任何支持 MCP 的**第三方智能体**(如基于 LangChain、OpenAI Agents SDK、Claude Agent、或自研 Agent 框架)都可通过官方 MCP 客户端以 stdio 方式拉起本服务,把 10 个 LBS Tool 暴露给大模型自动编排。下面以「查询美食」为例。
|
|
83
|
+
|
|
84
|
+
**第三方 Agent 接入(stdio 启动 + 传入 API Key):**
|
|
85
|
+
|
|
86
|
+
以官方 [MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk) 为例,Agent 在初始化时以子进程方式拉起 MCP Server,随后 `list_tools()` 拿到工具清单交给大模型:
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
import asyncio
|
|
90
|
+
from mcp import ClientSession, StdioServerParameters
|
|
91
|
+
from mcp.client.stdio import stdio_client
|
|
92
|
+
|
|
93
|
+
async def main():
|
|
94
|
+
server_params = StdioServerParameters(
|
|
95
|
+
command="uvx",
|
|
96
|
+
args=["mcp-server-maptec"],
|
|
97
|
+
env={
|
|
98
|
+
"MAPTEC_API_KEY": "mp_1_YOUR_KEY",
|
|
99
|
+
"MAPTEC_BASE_URL": "https://api.maptec.cn",
|
|
100
|
+
},
|
|
101
|
+
)
|
|
102
|
+
async with stdio_client(server_params) as (read, write):
|
|
103
|
+
async with ClientSession(read, write) as session:
|
|
104
|
+
await session.initialize()
|
|
105
|
+
|
|
106
|
+
# 交给大模型:把工具清单作为 function/tool 列表
|
|
107
|
+
tools = await session.list_tools()
|
|
108
|
+
|
|
109
|
+
# 大模型决定调用某个工具时:
|
|
110
|
+
result = await session.call_tool(
|
|
111
|
+
"map_search_nearby",
|
|
112
|
+
arguments={
|
|
113
|
+
"query": "火锅",
|
|
114
|
+
"locationLimit": {
|
|
115
|
+
"center": {"latitude": 1.3048, "longitude": 103.8318},
|
|
116
|
+
"radius": 2000,
|
|
117
|
+
},
|
|
118
|
+
"resultLimit": 5,
|
|
119
|
+
"region": "SG",
|
|
120
|
+
},
|
|
121
|
+
)
|
|
122
|
+
print(result)
|
|
123
|
+
|
|
124
|
+
asyncio.run(main())
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
> Node.js 智能体同理:用 `@modelcontextprotocol/sdk` 的 `StdioClientTransport`,`command`/`args`/`env` 改为 `npx -y @maptec/mcp-server-node` 即可。
|
|
128
|
+
|
|
129
|
+
**用户提问(发给第三方智能体):**
|
|
130
|
+
|
|
131
|
+
> 我在新加坡乌节路附近,想找评分高的火锅店,推荐几家,并告诉我从这里去最近一家怎么走。
|
|
132
|
+
|
|
133
|
+
**Agent 编排流程:**
|
|
134
|
+
|
|
135
|
+
```mermaid
|
|
136
|
+
sequenceDiagram
|
|
137
|
+
participant U as 用户
|
|
138
|
+
participant LLM as 智能体大模型
|
|
139
|
+
participant MCP as Maptec MCP
|
|
140
|
+
U->>LLM: 找乌节路附近评分高的火锅店并给出路线
|
|
141
|
+
LLM->>MCP: map_search_geocode(乌节路)
|
|
142
|
+
MCP-->>LLM: 坐标
|
|
143
|
+
LLM->>MCP: map_search_nearby(火锅, center, resultLimit)
|
|
144
|
+
MCP-->>LLM: POI 列表(placeId...)
|
|
145
|
+
LLM->>MCP: map_search_places(placeId)
|
|
146
|
+
MCP-->>LLM: 店铺详情
|
|
147
|
+
LLM->>MCP: map_routes_directions(origin, destination, walking)
|
|
148
|
+
MCP-->>LLM: 步行路线
|
|
149
|
+
LLM-->>U: 自然语言推荐 + 导航
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**关键工具调用示例:**
|
|
153
|
+
|
|
154
|
+
1. `map_search_geocode` 把地址转为坐标:
|
|
155
|
+
|
|
156
|
+
```json
|
|
157
|
+
{
|
|
158
|
+
"address": "乌节路, 新加坡",
|
|
159
|
+
"region": "SG"
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
2. `map_search_nearby` 以坐标为中心检索周边火锅店:
|
|
164
|
+
|
|
165
|
+
```json
|
|
166
|
+
{
|
|
167
|
+
"query": "火锅",
|
|
168
|
+
"locationLimit": {
|
|
169
|
+
"center": { "latitude": 1.3048, "longitude": 103.8318 },
|
|
170
|
+
"radius": 2000
|
|
171
|
+
},
|
|
172
|
+
"resultLimit": 5,
|
|
173
|
+
"region": "SG"
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
3. `map_search_places` 取 Top 店铺详情,`placeId` 来自上一步结果:
|
|
178
|
+
|
|
179
|
+
```json
|
|
180
|
+
{
|
|
181
|
+
"placeId": "PLACE_ID_FROM_NEARBY",
|
|
182
|
+
"language": "zh-CN",
|
|
183
|
+
"region": "SG"
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
4. `map_routes_directions` 规划到最近一家的步行路线:
|
|
188
|
+
|
|
189
|
+
```json
|
|
190
|
+
{
|
|
191
|
+
"origin": { "latitude": 1.3048, "longitude": 103.8318 },
|
|
192
|
+
"destination": { "latitude": 1.3021, "longitude": 103.8360 },
|
|
193
|
+
"mode": "walking"
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
**Agent 最终回答示例:**
|
|
198
|
+
|
|
199
|
+
> 已为你找到乌节路附近 3 家评分较高的火锅店:
|
|
200
|
+
> 1. 海底捞火锅(ION Orchard)— 评分 4.6,营业至 22:30,步行约 6 分钟;
|
|
201
|
+
> 2. 小龙坎老火锅(313@Somerset)— 评分 4.5,营业至 23:00,步行约 9 分钟;
|
|
202
|
+
> 3. 谭鸭血老火锅(Orchard Central)— 评分 4.4,营业至 22:00,步行约 11 分钟。
|
|
203
|
+
>
|
|
204
|
+
> 最近的是海底捞(ION Orchard),从你当前位置沿乌节路向东步行约 450 米、6 分钟即可到达。
|
|
205
|
+
|
|
206
|
+
以上全部由大模型自动调用 MCP 工具完成,用户无需关心任何接口参数。
|
|
207
|
+
|
|
208
|
+
## Tool 列表
|
|
209
|
+
|
|
210
|
+
| Tool | 说明 |
|
|
211
|
+
|------|------|
|
|
212
|
+
| `map_search_text` | 关键字检索 |
|
|
213
|
+
| `map_search_nearby` | 周边检索 |
|
|
214
|
+
| `map_search_suggest` | 输入提示 |
|
|
215
|
+
| `map_search_places` | 地点详情 |
|
|
216
|
+
| `map_search_geocode` | 地理编码 |
|
|
217
|
+
| `map_search_reverse` | 逆地理编码 |
|
|
218
|
+
| `map_routes_directions` | 路线规划 |
|
|
219
|
+
| `map_matrix_distance` | 距离矩阵 |
|
|
220
|
+
| `map_track_snap_to_roads` | 轨迹纠偏 |
|
|
221
|
+
| `map_location_ip` | IP 定位 |
|
|
222
|
+
|
|
223
|
+
## License
|
|
224
|
+
|
|
225
|
+
[MIT](./LICENSE) © 2026 Maptec
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# mcp-server-maptec
|
|
2
|
+
|
|
3
|
+
Maptec的webapi服务已全面兼容[MCP协议](https://modelcontextprotocol.io/docs/getting-started/intro)。
|
|
4
|
+
Maptec MCP Server支持10个LBS服务能力,包含了地点检索、周边检索、输入提示、地点详情、地理编码、逆地理编码、路线规划、距离矩阵、轨迹纠偏、IP定位。
|
|
5
|
+
|
|
6
|
+
## 环境变量
|
|
7
|
+
|
|
8
|
+
| 变量 | 默认值 | 说明 |
|
|
9
|
+
|------|--------|------|
|
|
10
|
+
| `MAPTEC_API_KEY` | — | **必填**,`mp_1_...` 格式 |
|
|
11
|
+
| `MAPTEC_BASE_URL` | `https://api.maptec.cn` | WebAPI 地址 |
|
|
12
|
+
| `MAPTEC_TIMEOUT_MS` | `30000` | HTTP 超时(毫秒) |
|
|
13
|
+
|
|
14
|
+
## 快速开始
|
|
15
|
+
|
|
16
|
+
### 1. 注册账号并申请 AK
|
|
17
|
+
|
|
18
|
+
前往 **Maptec 开发者中心** 注册账号,创建应用并申请 API Key(AK,`mp_1_...` 格式)。
|
|
19
|
+
|
|
20
|
+
### 2. 安装 Python 包
|
|
21
|
+
|
|
22
|
+
推荐使用 [uv](https://docs.astral.sh/uv/) 一键运行(无需预先安装):
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
uvx mcp-server-maptec
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
或通过 pip 安装:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install mcp-server-maptec
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
安装后可执行:`maptec-mcp-python`
|
|
35
|
+
|
|
36
|
+
### 3. 在 Cursor 中配置 MCP
|
|
37
|
+
|
|
38
|
+
以 Cursor 为例,在其 MCP 配置中加入以下内容,填入上一步申请的 API Key 后保存,进入 **Settings → MCP → Reload**:
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"mcpServers": {
|
|
43
|
+
"maptec": {
|
|
44
|
+
"command": "uvx",
|
|
45
|
+
"args": ["mcp-server-maptec"],
|
|
46
|
+
"env": {
|
|
47
|
+
"MAPTEC_API_KEY": "mp_1_YOUR_KEY",
|
|
48
|
+
"MAPTEC_BASE_URL": "https://api.maptec.cn"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
确认 `maptec` 为绿点 Connected,展开可见 10 个 Tool。
|
|
56
|
+
|
|
57
|
+
上述 `mcpServers` 为 MCP stdio 通用配置,Claude Desktop、Cline、Windsurf 等支持 MCP 的客户端同样适用,差异仅在于配置文件位置与重载方式。
|
|
58
|
+
|
|
59
|
+
### 4. 应用场景示例:第三方智能体调用 MCP 查询美食
|
|
60
|
+
|
|
61
|
+
除 Cursor 等 IDE 外,任何支持 MCP 的**第三方智能体**(如基于 LangChain、OpenAI Agents SDK、Claude Agent、或自研 Agent 框架)都可通过官方 MCP 客户端以 stdio 方式拉起本服务,把 10 个 LBS Tool 暴露给大模型自动编排。下面以「查询美食」为例。
|
|
62
|
+
|
|
63
|
+
**第三方 Agent 接入(stdio 启动 + 传入 API Key):**
|
|
64
|
+
|
|
65
|
+
以官方 [MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk) 为例,Agent 在初始化时以子进程方式拉起 MCP Server,随后 `list_tools()` 拿到工具清单交给大模型:
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
import asyncio
|
|
69
|
+
from mcp import ClientSession, StdioServerParameters
|
|
70
|
+
from mcp.client.stdio import stdio_client
|
|
71
|
+
|
|
72
|
+
async def main():
|
|
73
|
+
server_params = StdioServerParameters(
|
|
74
|
+
command="uvx",
|
|
75
|
+
args=["mcp-server-maptec"],
|
|
76
|
+
env={
|
|
77
|
+
"MAPTEC_API_KEY": "mp_1_YOUR_KEY",
|
|
78
|
+
"MAPTEC_BASE_URL": "https://api.maptec.cn",
|
|
79
|
+
},
|
|
80
|
+
)
|
|
81
|
+
async with stdio_client(server_params) as (read, write):
|
|
82
|
+
async with ClientSession(read, write) as session:
|
|
83
|
+
await session.initialize()
|
|
84
|
+
|
|
85
|
+
# 交给大模型:把工具清单作为 function/tool 列表
|
|
86
|
+
tools = await session.list_tools()
|
|
87
|
+
|
|
88
|
+
# 大模型决定调用某个工具时:
|
|
89
|
+
result = await session.call_tool(
|
|
90
|
+
"map_search_nearby",
|
|
91
|
+
arguments={
|
|
92
|
+
"query": "火锅",
|
|
93
|
+
"locationLimit": {
|
|
94
|
+
"center": {"latitude": 1.3048, "longitude": 103.8318},
|
|
95
|
+
"radius": 2000,
|
|
96
|
+
},
|
|
97
|
+
"resultLimit": 5,
|
|
98
|
+
"region": "SG",
|
|
99
|
+
},
|
|
100
|
+
)
|
|
101
|
+
print(result)
|
|
102
|
+
|
|
103
|
+
asyncio.run(main())
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
> Node.js 智能体同理:用 `@modelcontextprotocol/sdk` 的 `StdioClientTransport`,`command`/`args`/`env` 改为 `npx -y @maptec/mcp-server-node` 即可。
|
|
107
|
+
|
|
108
|
+
**用户提问(发给第三方智能体):**
|
|
109
|
+
|
|
110
|
+
> 我在新加坡乌节路附近,想找评分高的火锅店,推荐几家,并告诉我从这里去最近一家怎么走。
|
|
111
|
+
|
|
112
|
+
**Agent 编排流程:**
|
|
113
|
+
|
|
114
|
+
```mermaid
|
|
115
|
+
sequenceDiagram
|
|
116
|
+
participant U as 用户
|
|
117
|
+
participant LLM as 智能体大模型
|
|
118
|
+
participant MCP as Maptec MCP
|
|
119
|
+
U->>LLM: 找乌节路附近评分高的火锅店并给出路线
|
|
120
|
+
LLM->>MCP: map_search_geocode(乌节路)
|
|
121
|
+
MCP-->>LLM: 坐标
|
|
122
|
+
LLM->>MCP: map_search_nearby(火锅, center, resultLimit)
|
|
123
|
+
MCP-->>LLM: POI 列表(placeId...)
|
|
124
|
+
LLM->>MCP: map_search_places(placeId)
|
|
125
|
+
MCP-->>LLM: 店铺详情
|
|
126
|
+
LLM->>MCP: map_routes_directions(origin, destination, walking)
|
|
127
|
+
MCP-->>LLM: 步行路线
|
|
128
|
+
LLM-->>U: 自然语言推荐 + 导航
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**关键工具调用示例:**
|
|
132
|
+
|
|
133
|
+
1. `map_search_geocode` 把地址转为坐标:
|
|
134
|
+
|
|
135
|
+
```json
|
|
136
|
+
{
|
|
137
|
+
"address": "乌节路, 新加坡",
|
|
138
|
+
"region": "SG"
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
2. `map_search_nearby` 以坐标为中心检索周边火锅店:
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"query": "火锅",
|
|
147
|
+
"locationLimit": {
|
|
148
|
+
"center": { "latitude": 1.3048, "longitude": 103.8318 },
|
|
149
|
+
"radius": 2000
|
|
150
|
+
},
|
|
151
|
+
"resultLimit": 5,
|
|
152
|
+
"region": "SG"
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
3. `map_search_places` 取 Top 店铺详情,`placeId` 来自上一步结果:
|
|
157
|
+
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"placeId": "PLACE_ID_FROM_NEARBY",
|
|
161
|
+
"language": "zh-CN",
|
|
162
|
+
"region": "SG"
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
4. `map_routes_directions` 规划到最近一家的步行路线:
|
|
167
|
+
|
|
168
|
+
```json
|
|
169
|
+
{
|
|
170
|
+
"origin": { "latitude": 1.3048, "longitude": 103.8318 },
|
|
171
|
+
"destination": { "latitude": 1.3021, "longitude": 103.8360 },
|
|
172
|
+
"mode": "walking"
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**Agent 最终回答示例:**
|
|
177
|
+
|
|
178
|
+
> 已为你找到乌节路附近 3 家评分较高的火锅店:
|
|
179
|
+
> 1. 海底捞火锅(ION Orchard)— 评分 4.6,营业至 22:30,步行约 6 分钟;
|
|
180
|
+
> 2. 小龙坎老火锅(313@Somerset)— 评分 4.5,营业至 23:00,步行约 9 分钟;
|
|
181
|
+
> 3. 谭鸭血老火锅(Orchard Central)— 评分 4.4,营业至 22:00,步行约 11 分钟。
|
|
182
|
+
>
|
|
183
|
+
> 最近的是海底捞(ION Orchard),从你当前位置沿乌节路向东步行约 450 米、6 分钟即可到达。
|
|
184
|
+
|
|
185
|
+
以上全部由大模型自动调用 MCP 工具完成,用户无需关心任何接口参数。
|
|
186
|
+
|
|
187
|
+
## Tool 列表
|
|
188
|
+
|
|
189
|
+
| Tool | 说明 |
|
|
190
|
+
|------|------|
|
|
191
|
+
| `map_search_text` | 关键字检索 |
|
|
192
|
+
| `map_search_nearby` | 周边检索 |
|
|
193
|
+
| `map_search_suggest` | 输入提示 |
|
|
194
|
+
| `map_search_places` | 地点详情 |
|
|
195
|
+
| `map_search_geocode` | 地理编码 |
|
|
196
|
+
| `map_search_reverse` | 逆地理编码 |
|
|
197
|
+
| `map_routes_directions` | 路线规划 |
|
|
198
|
+
| `map_matrix_distance` | 距离矩阵 |
|
|
199
|
+
| `map_track_snap_to_roads` | 轨迹纠偏 |
|
|
200
|
+
| `map_location_ip` | IP 定位 |
|
|
201
|
+
|
|
202
|
+
## License
|
|
203
|
+
|
|
204
|
+
[MIT](./LICENSE) © 2026 Maptec
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "mcp-server-maptec"
|
|
3
|
+
version = "1.0.0"
|
|
4
|
+
description = "MapTech MCP Server (Python) - stdio transport for Cursor / Claude Desktop"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.11"
|
|
7
|
+
license = { text = "MIT" }
|
|
8
|
+
authors = [{ name = "MapTech" }]
|
|
9
|
+
keywords = ["http", "mcp", "map", "maptec", "lbs"]
|
|
10
|
+
classifiers = [
|
|
11
|
+
"Development Status :: 4 - Beta",
|
|
12
|
+
"License :: OSI Approved :: MIT License",
|
|
13
|
+
"Intended Audience :: Developers",
|
|
14
|
+
"Programming Language :: Python :: 3",
|
|
15
|
+
"Programming Language :: Python :: 3.11",
|
|
16
|
+
"Programming Language :: Python :: 3.12",
|
|
17
|
+
"Topic :: Software Development :: Libraries",
|
|
18
|
+
]
|
|
19
|
+
dependencies = [
|
|
20
|
+
"mcp[cli]>=1.12.0",
|
|
21
|
+
"httpx>=0.27.0",
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
[project.urls]
|
|
25
|
+
Homepage = "https://github.com/maptechbj/maptec-mcp-python"
|
|
26
|
+
Repository = "https://github.com/maptechbj/maptec-mcp-python"
|
|
27
|
+
|
|
28
|
+
[project.scripts]
|
|
29
|
+
maptec-mcp-python = "maptec_mcp_python:main"
|
|
30
|
+
|
|
31
|
+
[build-system]
|
|
32
|
+
requires = ["hatchling>=1.21,<1.27"]
|
|
33
|
+
build-backend = "hatchling.build"
|
|
34
|
+
|
|
35
|
+
[dependency-groups]
|
|
36
|
+
dev = ["twine>=6.0.0", "build>=1.2.0"]
|
|
37
|
+
|
|
38
|
+
[tool.hatch.build.targets.wheel]
|
|
39
|
+
packages = ["src/maptec_mcp_python"]
|
|
40
|
+
|
|
41
|
+
[tool.hatch.build.targets.wheel.force-include]
|
|
42
|
+
"src/maptec_mcp_python/schemas/tools.json" = "maptec_mcp_python/schemas/tools.json"
|
|
43
|
+
|
|
44
|
+
[tool.hatch.build.targets.sdist]
|
|
45
|
+
include = ["src/maptec_mcp_python", "schemas", "scripts", "README.md"]
|