Mapbox MCP 服务器是专门为 Mapbox API 打造的工具,能提供丰富的导航、验证及错误处理功能,助力开发者高效使用 Mapbox API。
mapbox_directions
coordinates ({latitude: number, longitude: number}[]):坐标数组。profile(可选):支持 "driving-traffic"、"driving"、"walking"、"cycling" 等出行模式。mapbox_directions_by_places
places(字符串数组):地名数组。profile(可选):支持 "driving-traffic"、"driving"、"walking"、"cycling" 等出行模式。language(可选):两位字母语言代码(例如 "zh"、"en")。mapbox_matrix
coordinates ({latitude: number, longitude: number}[]):坐标数组。profile(可选):支持 "driving"、"walking"、"cycling" 等出行模式。annotations(可选):支持 "duration"、"distance"、"duration,distance" 等标注类型。sources(可选):源坐标点的索引。destinations(可选):目标坐标点的索引。mapbox_matrix_by_places
places(字符串数组):地名数组(2 - 25 个地点)。profile(可选):支持 "driving"、"walking"、"cycling" 等出行模式。annotations(可选):支持 "duration"、"distance"、"duration,distance" 等标注类型。language(可选):两位字母语言代码。sources(可选):源地点的索引。destinations(可选):目标地点的索引。mapbox_input_validation
mapbox_error_handling
{
"name": "mapbox_mcp_server",
"description": "Mapbox API 的 MCP 服务器工具集",
"version": "1.0.0",
"parameters": {
"api_key": {
"type": "string",
"required": true,
"description": "Mapbox API 的访问密钥"
},
"tools": [
"mapbox_directions",
"mapbox_directions_by_places",
"mapbox_matrix",
"mapbox_matrix_by_places",
"mapbox_input_validation",
"mapbox_error_handling"
]
}
}
npm install mapbox-mcp-server express validator
process.env.NODE_ENV = 'production';
process.env.MAPBOX_API_KEY = 'your_api_key_here';
所有工具均实现全面的错误处理机制,可处理以下错误:
本 MCP 服务器根据 MIT License 分发。这意味着您可以自由地使用、修改和分发软件,但需遵守 MIT 许可证的条款和条件。更多详情,请参阅项目存储库中的 LICENSE 文件。