Skip to content

Commit 0fa3be8

Browse files
authored
Add doc tool (#15)
* add doc tool
1 parent 8fd7aa2 commit 0fa3be8

9 files changed

Lines changed: 450 additions & 20 deletions

README.md

Lines changed: 51 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,37 @@ A Model Context Protocol (MCP) server that provides AI assistants with direct ac
44

55
![Mapbox MCP DevKit Server Demo](./assets/mcp_server_devkit.gif)
66

7-
## Integration with Developer Tools
7+
## Table of Contents
8+
9+
- [Quick Start](#quick-start)
10+
- [Integration with Developer Tools](#integration-with-developer-tools)
11+
- [DXT Package Distribution](#dxt-package-distribution)
12+
- [Getting Your Mapbox Access Token](#getting-your-mapbox-access-token)
13+
- [Tools](#tools)
14+
- [Documentation Tools](#documentation-tools)
15+
- [Style Management Tools](#style-management-tools)
16+
- [Token Management Tools](#token-management-tools)
17+
- [Local Processing Tools](#local-processing-tools)
18+
- [Development](#development)
19+
- [Testing](#testing)
20+
- [Inspecting Server](#inspecting-server)
21+
- [Creating New Tools](#creating-new-tools)
22+
- [Environment Variables](#environment-variables)
23+
24+
## Quick Start
25+
26+
### Integration with Developer Tools
827

928
Get started by integrating with your preferred AI development environment:
1029

1130
- [Claude Code Integration](./docs/claude-code-integration.md) - Command-line development with Claude
1231
- [Claude Desktop Integration](./docs/claude-desktop-integration.md) - Desktop application integration
1332

14-
## DXT Package Distribution
33+
### DXT Package Distribution
1534

1635
This MCP server can be packaged as a DXT (Desktop Extension) file for easy distribution and installation. DXT is a standardized format for distributing local MCP servers, similar to browser extensions.
1736

18-
### Creating the DXT Package
37+
#### Creating the DXT Package
1938

2039
To create a DXT package:
2140

@@ -39,7 +58,7 @@ The DXT package includes:
3958
- User configuration schema for the Mapbox access token
4059
- Automatic environment variable setup
4160

42-
## Getting Your Mapbox Access Token
61+
### Getting Your Mapbox Access Token
4362

4463
**A Mapbox access token is required to use this MCP server.**
4564

@@ -59,9 +78,24 @@ The `MAPBOX_ACCESS_TOKEN` environment variable is required. **Each tool requires
5978

6079
## Tools
6180

62-
### Mapbox API tools
81+
### Documentation Tools
6382

64-
#### Style Management Tools
83+
**get_latest_mapbox_docs_tool** - Access the latest official Mapbox documentation directly from the source. This tool fetches comprehensive, up-to-date information about all Mapbox APIs, SDKs, and developer resources from docs.mapbox.com/llms.txt.
84+
85+
86+
**Example prompts:**
87+
88+
- "What are the latest Mapbox APIs available for developers?"
89+
- "Show me all current Mapbox services and SDKs"
90+
- "I need up-to-date Mapbox documentation for my project"
91+
- "What mapping solutions does Mapbox offer for my tech stack?"
92+
- "Give me an overview of Mapbox's navigation and routing capabilities"
93+
- "Compare Mapbox web SDKs versus mobile SDKs"
94+
- "What's new in the Mapbox ecosystem?"
95+
96+
📖 **[See more examples and interactive demo →](./docs/mapbox-docs-tool-demo.md)**
97+
98+
### Style Management Tools
6599

66100
Complete set of tools for managing Mapbox styles via the Styles API:
67101

@@ -115,7 +149,7 @@ Complete set of tools for managing Mapbox styles via the Styles API:
115149
- "Please generate a preview link for this style"
116150
- "Can you change the background to snow style?"
117151

118-
#### Token Management Tools
152+
### Token Management Tools
119153

120154
#### create-token
121155

@@ -189,7 +223,7 @@ List Mapbox access tokens for the authenticated user with optional filtering and
189223
- "List the 5 most recently modified tokens"
190224
- "Show all public tokens in my account"
191225

192-
### Local processing tools
226+
### Local Processing Tools
193227

194228
#### GeoJSON Preview tool (Beta)
195229

@@ -315,11 +349,11 @@ An array of four numbers representing the bounding box: `[minX, minY, maxX, maxY
315349
- "Calculate the bounding box of this GeoJSON file" (then upload a .geojson file)
316350
- "What's the bounding box for the coordinates in the uploaded parks.geojson file?"
317351

318-
# Development
352+
## Development
319353

320-
## Testing
354+
### Testing
321355

322-
### Tool Snapshot Tests
356+
#### Tool Snapshot Tests
323357

324358
The project includes snapshot tests to ensure tool integrity and prevent accidental additions or removals of tools. These tests automatically discover all tools and create a snapshot of their metadata.
325359

@@ -360,9 +394,9 @@ npm test -- --updateSnapshot
360394

361395
**Important**: Only update snapshots when you have intentionally added, removed, or modified tools. Unexpected snapshot failures indicate accidental changes to the tool structure.
362396

363-
## Inspecting server
397+
### Inspecting Server
364398

365-
### Using Node.js
399+
#### Using Node.js
366400

367401
```sh
368402
# Build
@@ -372,7 +406,7 @@ npm run build
372406
npx @modelcontextprotocol/inspector node dist/index.js
373407
```
374408

375-
### Using Docker
409+
#### Using Docker
376410

377411
```sh
378412
# Build the Docker image
@@ -382,7 +416,7 @@ docker build -t mapbox-mcp-devkit .
382416
npx @modelcontextprotocol/inspector docker run -i --rm --env MAPBOX_ACCESS_TOKEN="YOUR_TOKEN" mapbox-mcp-devkit
383417
```
384418

385-
## Create new tool
419+
### Creating New Tools
386420

387421
```sh
388422
npx plop create-tool
@@ -432,9 +466,9 @@ src/tools/your-tool-name-tool/
432466
- Consistent with existing tools in the project
433467
- Enhanced TypeScript type safety
434468

435-
## Environment Variables
469+
### Environment Variables
436470

437-
### VERBOSE_ERRORS
471+
#### VERBOSE_ERRORS
438472

439473
Set `VERBOSE_ERRORS=true` to get detailed error messages from the MCP server. This is useful for debugging issues when integrating with MCP clients.
440474

docs/mapbox-docs-tool-demo.md

Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
# Mapbox Documentation Tool Demo
2+
3+
This demo showcases the `get_latest_mapbox_docs_tool` and provides example prompts that will trigger the AI assistant to use this tool instead of web search.
4+
5+
> **⚠️ Important Note**: Different MCP clients (Claude Desktop, Claude Code, etc.) and different LLM models may exhibit varying behavior when selecting tools. The examples below are demonstrations of intended behavior and may not work identically across all environments. Tool selection depends on the specific AI model's training, the MCP client implementation, and system prompts used.
6+
7+
## 🎯 Tool Overview
8+
9+
The `get_latest_mapbox_docs_tool` automatically fetches the latest official Mapbox documentation from `docs.mapbox.com/llms.txt`. This ensures AI assistants always have access to current, authoritative information about Mapbox APIs and services.
10+
11+
## 📝 Demo Prompts
12+
13+
Try these prompts with your AI assistant to see the tool in action:
14+
15+
### 1. Basic Documentation Queries
16+
17+
```
18+
What are the latest Mapbox APIs available for developers? I want to make sure I'm using the most current information.
19+
```
20+
21+
```
22+
I need the most up-to-date official Mapbox documentation. Can you provide a complete overview?
23+
```
24+
25+
```
26+
Please show me all current Mapbox services and APIs using the latest documentation.
27+
```
28+
29+
### 2. Development Planning (More Direct Approach)
30+
31+
```
32+
Can you get the latest official Mapbox documentation and help me understand what developer tools are available?
33+
```
34+
35+
```
36+
I need current information from Mapbox documentation about their complete developer platform.
37+
```
38+
39+
```
40+
Please use the most recent Mapbox documentation to show me all mapping solutions they offer.
41+
```
42+
43+
### 3. Learning & Research
44+
45+
```
46+
Using the latest Mapbox documentation, give me a comprehensive overview of their current product ecosystem.
47+
```
48+
49+
```
50+
I need up-to-date official information about Mapbox's navigation and routing capabilities.
51+
```
52+
53+
```
54+
Please check the current Mapbox documentation and explain the differences between their web and mobile SDKs.
55+
```
56+
57+
```
58+
I'm new to Mapbox. Can you get the latest official documentation and give me an overview of their resources?
59+
```
60+
61+
### 4. Architecture Decisions
62+
63+
```
64+
Can you check the latest Mapbox documentation and tell me what APIs are available for real estate applications with maps and search?
65+
```
66+
67+
```
68+
I need current Mapbox documentation about mapping, geocoding, and routing options. What's available?
69+
```
70+
71+
```
72+
Using the latest official Mapbox documentation, compare their web versus mobile solutions.
73+
```
74+
75+
```
76+
Please get the most recent Mapbox documentation and show me services relevant for logistics platforms.
77+
```
78+
79+
### 5. Latest Information Requests
80+
81+
```
82+
What's new in the Mapbox ecosystem? Please use the latest official documentation to show me all current offerings.
83+
```
84+
85+
```
86+
Can you get the most recent Mapbox documentation and tell me about any recent additions to their APIs?
87+
```
88+
89+
```
90+
I need the current state of Mapbox developer tools - please check their latest documentation.
91+
```
92+
93+
```
94+
I last used Mapbox 2 years ago. Can you get the latest documentation and show me what has changed?
95+
```
96+
97+
## 🎪 Interactive Demo Session
98+
99+
### More Effective Examples (Based on Real Testing):
100+
101+
**Try these prompts that are more likely to trigger the documentation tool:**
102+
103+
**Example 1:**
104+
105+
```
106+
What are the latest Mapbox APIs available for developers? I want to make sure I'm using the most current information.
107+
```
108+
109+
**Example 2:**
110+
111+
```
112+
I need the most up-to-date Mapbox documentation for my project. Can you show me all current services available?
113+
```
114+
115+
**Example 3:**
116+
117+
```
118+
Please use the latest official Mapbox documentation to tell me about their navigation capabilities.
119+
```
120+
121+
### Less Effective Examples:
122+
123+
**"I'm planning a food delivery app with real-time tracking and route optimization. What current Mapbox services would be relevant?"**
124+
125+
- _Problem_: Too project-specific, may trigger general knowledge response
126+
127+
**"What Mapbox APIs should I use for my app?"**
128+
129+
- _Problem_: Too general, may trigger web search
130+
131+
**"How do I implement Mapbox in React?"**
132+
133+
- _Problem_: Implementation-focused, may trigger general coding help
134+
135+
### Why Some Examples Work Better:
136+
137+
**Direct documentation requests**: "latest Mapbox documentation", "current APIs available"
138+
**Emphasis on currency**: "most current information", "up-to-date"
139+
**Official source requests**: "official Mapbox documentation", "latest official information"
140+
141+
> **📝 Real-World Note**: Based on testing, prompts that explicitly request documentation or emphasize getting the latest official information have higher success rates for triggering the documentation tool.
142+
143+
## 🔍 What Makes These Prompts Effective
144+
145+
These prompts work because they:
146+
147+
-**Emphasize currency**: Use words like "latest", "current", "up-to-date"
148+
-**Request completeness**: Ask for "all", "comprehensive", "complete overview"
149+
-**Imply official sources**: Request "current offerings", "official documentation"
150+
-**Suggest comparison needs**: Multiple options require comprehensive data
151+
-**Focus on accuracy**: "make sure I'm using correct information"
152+
153+
## 🚀 Benefits Demonstration
154+
155+
### Before (using web search):
156+
157+
- May get outdated information
158+
- Fragmented results from multiple sources
159+
- Potential inaccuracies from third-party sites
160+
- Missing new APIs or changes
161+
162+
### After (using get_latest_mapbox_docs_tool):
163+
164+
- ✅ Always current official information
165+
- ✅ Complete ecosystem overview
166+
- ✅ Authoritative source (directly from Mapbox)
167+
- ✅ Includes latest APIs and features
168+
169+
## 🎛 Advanced Usage
170+
171+
### Complex Project Planning
172+
173+
```
174+
Can you get the latest Mapbox documentation and help me architect a geospatial solution with mapping, search, routing, and analytics? I need to know what services are currently available.
175+
```
176+
177+
### Competitive Analysis
178+
179+
```
180+
I'm evaluating Mapbox versus other platforms. Please use the most current official Mapbox documentation to show me all their capabilities for my analysis.
181+
```
182+
183+
### Migration Planning
184+
185+
```
186+
We're migrating from another platform. Can you check the latest Mapbox documentation and show me all services that could replace our current functionality?
187+
```
188+
189+
## 💡 Pro Tips
190+
191+
1. **Use temporal keywords**: "latest", "current", "up-to-date", "recent"
192+
2. **Request comprehensiveness**: "all", "complete", "entire", "full"
193+
3. **Emphasize accuracy**: "official", "authoritative", "correct"
194+
4. **Avoid specific tool names**: Let the AI choose the right tool naturally
195+
5. **Context matters**: Mention your project needs to get relevant filtering
196+
197+
### 🔧 **Troubleshooting Tool Selection**
198+
199+
If the AI is not using the documentation tool:
200+
201+
- **Be more explicit**: "I need official Mapbox documentation" or "Please use the latest source"
202+
- **Emphasize currency**: "Make sure you have the most current information"
203+
- **Request authority**: "I want authoritative information directly from Mapbox"
204+
- **Try rephrasing**: Different models respond to different prompt styles
205+
- **Check your MCP setup**: Ensure the tool is properly registered and available
206+
207+
### 🌐 **Environment Considerations**
208+
209+
**Claude Desktop vs Claude Code**: Different interfaces may have varying tool selection behaviors.
210+
211+
**Model Versions**: Newer models may be better at tool selection than older ones.
212+
213+
**System Prompts**: Some MCP clients may have system prompts that influence tool selection preferences.
214+
215+
---
216+
217+
## 📋 **Disclaimer**
218+
219+
_This demo file provides **examples and suggestions** for using the Mapbox Documentation Tool. The prompts are crafted to **ideally** trigger correct tool selection, but actual behavior **will vary** across different MCP clients, AI models, and system configurations._
220+
221+
_**Results may vary**: Tool selection depends on many factors including model training, client implementation, and system prompts. These examples show **intended behavior** rather than guaranteed outcomes._
222+
223+
_Use these examples as **starting points** and adjust your prompts based on your specific environment and the AI assistant's responses._

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mapbox/mcp-devkit-server",
3-
"version": "0.3.1",
3+
"version": "0.3.2",
44
"description": "Mapbox MCP devkit server",
55
"main": "dist/index.js",
66
"module": "dist/index-esm.js",

0 commit comments

Comments
 (0)