Values like phone numbers, PINs, or codes with leading zeros (e.g. 000123)
are auto-coerced to numbers by default. The --raw-strings flag (or --no-coerce
alias) preserves them as strings.
Note: Cannot use --raw as the flag name because it conflicts with the
existing --raw output format shortcut in output-format.ts.
Fixes: numeric strings being silently converted to numbers
Ensure waitForAuthorizationCode uses the same deferred created by redirectToAuthorization instead of creating a new one. If waitForAuthorizationCode is called before redirectToAuthorization has been invoked, it now waits for the redirect to be initiated before proceeding. This fixes the race condition where the OAuth callback could resolve a different promise than what the runtime was waiting on, causing authentication to fail with a timeout.
Fixes#36
Previously json() in createCallResult returned early on the first
parseable JSON entry. When an MCP server returned multiple results
in the content array, only the first item was ever surfaced.
Now all parseable entries are collected. A single item still returns
as a single object (backward compatible); multiple items return as
an array.
Also increased inspect depth in printRaw from 2 to null to prevent
truncation of deeply nested list results.
Address review feedback: wrap the redirect URI mismatch check in
try/catch so that if readClientInfo() or clear() throws (malformed
cache JSON, filesystem permissions), the already-bound HTTP callback
server is closed before rethrowing. Prevents the process from hanging
with an open listener in failure paths.
1. Remove hardcoded scope='mcp:tools' from client metadata.
Providers like Granola reject this scope at the authorize endpoint
(invalid_scope). Let the MCP SDK derive scope from server metadata
instead, falling back to the auth server's scopes_supported.
2. Swallow xdg-open ENOENT on headless Linux servers.
On VPS/CI environments without a desktop, spawning xdg-open throws
an unhandled error event that crashes the process before the OAuth
callback server can receive the redirect.
3. Clear stale client registration when dynamic callback port changes.
With dynamic ports (the default), each run picks a different port.
If a previous client registration is cached with a different
redirect_uri, the auth server rejects subsequent requests with
invalid_redirect_uri. Now detects the mismatch and re-registers.
Fixes#67
When parsing CLI array arguments like `--corner1 0,0`, the values were
being split by comma but kept as strings. This caused JSON schema
validation to fail when the schema specified number arrays.
Changes:
- Add `arrayItemType` field to `GeneratedOption` interface
- Add `inferArrayItemType()` function to extract item type from schema
- Update `optionParser()` to coerce array elements based on item type:
- number arrays: parseFloat each element
- boolean arrays: compare against 'false'
- string arrays: trim whitespace (existing behavior)
Fixes issues with MCP tools that have array<number> parameters like
Onshape's `create_sketch_rectangle` which expects corner coordinates.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Commander.js converts kebab-case flag names (e.g., --relative-path) to
camelCase property names (e.g., relativePath) when accessing cmdOpts.
The generated CLI template was using the original property names from the
schema (often snake_case), causing option values to not be recognized.
This converts the CLI option name to camelCase when generating cmdOpts
property access.
* fix(cli): prevent string truncation in raw output
Node's util.inspect() has a default maxStringLength of 10000 characters,
causing large MCP responses to be truncated with '... N more characters'.
See: https://nodejs.org/api/util.html#utilinspectobject-options
This affects --output raw and the default output format when it falls
back to printRaw().
Fix: set maxStringLength: null to disable string truncation while
preserving depth: 2 for readable nested object summaries.
Verify (before fix shows 10000, after fix shows 15000):
node -e "console.log('x count:', (require('util').inspect({t:'x'.repeat(15000)}, {depth:2}).match(/x/g)||[]).length)"
node -e "console.log('x count:', (require('util').inspect({t:'x'.repeat(15000)}, {depth:2, maxStringLength:null}).match(/x/g)||[]).length)"
* test(cli): ensure raw output not truncated
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>