You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,6 +71,7 @@ This file provides Claude and developers with essential context, commands, and s
71
71
72
72
## Known Issues & Warnings
73
73
74
+
-**Cursor + OpenAI models compatibility issue** - ALL OpenAI models (GPT-4, GPT-3.5, o1, o1-mini) fail with `[invalid_argument]` errors in Cursor when using `create_style_tool` and `update_style_tool` (works fine in VS Code, works fine with Claude in Cursor). Root cause: Cursor can't handle tools with complex input schemas when used with OpenAI models. **Workaround:** Set `CURSOR_OPENAI_MODE=true` to auto-disable the problematic tools. You'll still have 15/17 tools working.
74
75
- Large GeoJSON files may cause slow performance in preview tools
75
76
- Always check token scopes if a tool fails with authentication errors
76
77
- Use `VERBOSE_ERRORS=true` for detailed error output
@@ -558,6 +562,109 @@ Set `VERBOSE_ERRORS=true` to get detailed error messages from the MCP server. Th
558
562
559
563
By default, the server returns generic error messages. With verbose errors enabled, you'll receive the actual error details, which can help diagnose API connection issues, invalid parameters, or other problems.
560
564
565
+
#### CURSOR_OPENAI_MODE
566
+
567
+
Set `CURSOR_OPENAI_MODE=true` when using **any OpenAI model (GPT-4, GPT-3.5, o1, o1-mini) in Cursor**. This is a simple workaround for Cursor's bug with OpenAI models and complex tool schemas.
568
+
569
+
**What it does:**
570
+
571
+
- Automatically disables `create_style_tool` and `update_style_tool`
572
+
- These tools have complex input schemas that break Cursor's OpenAI integration
573
+
- You'll still have 15 out of 17 tools working (all read/query/preview operations)
574
+
575
+
**When to use:**
576
+
577
+
- ✅ Using GPT-4, GPT-3.5, o1, or o1-mini in Cursor
578
+
- ❌ Not needed for Claude models in Cursor (all tools work)
579
+
- ❌ Not needed in VS Code (all tools work with all models)
580
+
581
+
**Example:**
582
+
583
+
```json
584
+
{
585
+
"mcpServers": {
586
+
"mapbox-devkit": {
587
+
"env": {
588
+
"MAPBOX_ACCESS_TOKEN": "your-token",
589
+
"CURSOR_OPENAI_MODE": "true"
590
+
}
591
+
}
592
+
}
593
+
}
594
+
```
595
+
596
+
## Troubleshooting
597
+
598
+
### Cursor + OpenAI Models Issues
599
+
600
+
**Problem:** When using **any OpenAI model (GPT-4, GPT-3.5, o1, o1-mini)** in Cursor, the `create_style_tool` and `update_style_tool` cause failures with `[invalid_argument]` errors.
601
+
602
+
**Example error:**
603
+
604
+
```
605
+
ConnectError: [invalid_argument] Error
606
+
The model returned an error. Try disabling MCP servers, or switch models.
607
+
```
608
+
609
+
**Cause:** This is a Cursor-specific bug with o1 model MCP integration. The same server works fine with o1 in VS Code and other MCP clients.
610
+
611
+
**Root Cause:** Cursor's integration with OpenAI models fails when tools have complex input schemas with `.passthrough()` (like `create_style_tool` and `update_style_tool` which accept full Mapbox Style Specification objects). The error is: `[AiService] streamResponse ConnectError: [invalid_argument]`
612
+
613
+
**Affected:**
614
+
615
+
- ❌ Cursor + GPT-4 - Fails with these 2 tools
616
+
- ❌ Cursor + GPT-3.5 - Fails with these 2 tools
617
+
- ❌ Cursor + o1/o1-mini - Fails with these 2 tools
618
+
- ✅ Cursor + Claude - Works with all tools
619
+
- ✅ VS Code + any model - Works with all tools
620
+
621
+
**Simple Fix - Use CURSOR_OPENAI_MODE:**
622
+
Add `CURSOR_OPENAI_MODE=true` to automatically disable the problematic tools:
623
+
624
+
```json
625
+
{
626
+
"mcpServers": {
627
+
"mapbox-devkit": {
628
+
"command": "node",
629
+
"args": ["/path/to/dist/esm/index.js"],
630
+
"env": {
631
+
"MAPBOX_ACCESS_TOKEN": "your-token",
632
+
"CURSOR_OPENAI_MODE": "true"
633
+
}
634
+
}
635
+
}
636
+
}
637
+
```
638
+
639
+
This automatically disables `create_style_tool` and `update_style_tool` which have complex input schemas that break Cursor's OpenAI integration. You'll still have **15 out of 17 tools** working, including all read/query operations.
640
+
641
+
**Other Solutions:**
642
+
643
+
1.**Use Claude in Cursor** - All 17 tools work perfectly with Claude models in Cursor
644
+
2.**Use VS Code** - All OpenAI models work with all 17 tools in VS Code (no workaround needed)
645
+
3.**Manually disable tools:**
646
+
```json
647
+
{
648
+
"args": [
649
+
"/path/to/dist/esm/index.js",
650
+
"--disable-tools",
651
+
"create_style_tool,update_style_tool"
652
+
]
653
+
}
654
+
```
655
+
656
+
**Status:** This is a Cursor bug with how it handles OpenAI models + MCP tools with complex input schemas. The same tools work fine in VS Code.
657
+
658
+
### General Troubleshooting
659
+
660
+
**Issue:** Tools fail with authentication errors
661
+
662
+
**Solution:** Check that your `MAPBOX_ACCESS_TOKEN` has the required scopes for the tool you're using. See the token scopes section above.
663
+
664
+
**Issue:** Large GeoJSON files cause slow performance
665
+
666
+
**Solution:** The GeoJSON preview tool may be slow with very large files. Consider simplifying geometries or using smaller datasets for preview purposes.
667
+
561
668
## Contributing
562
669
563
670
We welcome contributions to the Mapbox Development MCP Server! Please review our standards and guidelines before contributing:
0 commit comments