Commit 9121ca4
fix: PascalCase tool names after mcp_ prefix to match Claude Code convention (#191)
## Summary
- PascalCase tool names after `mcp_` prefix (e.g. `bash` → `mcp_Bash`,
`read` → `mcp_Read`) to match Claude Code's actual naming convention
- Lowercase `mcp_` names (e.g. `mcp_bash`) are flagged as
non-Claude-Code clients by Anthropic's billing validator, causing
spurious 400 "out of extra usage" errors
- Reverse mapping in `stripToolPrefix` restores original tool names by
lowercasing the first char after stripping `mcp_`
- Add explicit `baseURL` to ensure correct API endpoint construction
## Context
Anthropic's billing validator rejects requests with lowercase
`mcp_`-prefixed tool names when multiple tools are present. Binary
search testing with isolated curl requests confirmed specific tool names
like `background_output` trigger 400 errors, while PascalCase
equivalents (`mcp_Background_output`) pass.
Approach aligned with ex-machina-co/opencode-anthropic-auth#81.
Fixes #190 #188
## Test plan
- [x] All 39 tests pass
- [x] Verify Claude Max users no longer receive spurious "out of extra
usage" errors
- [x] Verify all tools remain functional with PascalCase mcp_ prefix
- [x] Verify responses correctly restore original tool names
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: SeaL773 <SeaL773@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 66968d0 commit 9121ca4
3 files changed
Lines changed: 74 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| 263 | + | |
263 | 264 | | |
264 | 265 | | |
265 | 266 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
| 39 | + | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
452 | 497 | | |
453 | 498 | | |
454 | 499 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
6 | 22 | | |
7 | 23 | | |
8 | 24 | | |
| |||
206 | 222 | | |
207 | 223 | | |
208 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
209 | 228 | | |
210 | 229 | | |
211 | 230 | | |
212 | | - | |
| 231 | + | |
213 | 232 | | |
214 | 233 | | |
215 | 234 | | |
| |||
226 | 245 | | |
227 | 246 | | |
228 | 247 | | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
| 248 | + | |
233 | 249 | | |
234 | 250 | | |
235 | 251 | | |
| |||
246 | 262 | | |
247 | 263 | | |
248 | 264 | | |
249 | | - | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
250 | 269 | | |
251 | 270 | | |
252 | 271 | | |
| |||
0 commit comments