feat: improve Claude Desktop support and token refresh reliability#8
Open
rathga wants to merge 1 commit into
Open
feat: improve Claude Desktop support and token refresh reliability#8rathga wants to merge 1 commit into
rathga wants to merge 1 commit into
Conversation
- Fix dotenv to resolve .env relative to script location instead of cwd, which may differ when launched by Claude Desktop - Add automatic token refresh on expiration and 401 retry logic - Use TENANT_ID from env for token refresh endpoint instead of hardcoding - Resolve tokens.json relative to script location with cwd fallback - Pass token expiration time through CLI to server for proactive refresh - Add Claude Desktop configuration instructions and troubleshooting to README - Remove verbose request/response logging Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
rathga
marked this pull request as ready for review
March 4, 2026 20:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I tried using this in Claude Desktop, but had a few issues. I asked Claude code to fix them, which it did and it's all working smoothly now. Here's a PR with the changes that it came up with.
Summary
.envrelative to script location instead ofprocess.cwd(), which differs when launched by Claude Desktop (oftenC:\Windows\System32)TENANT_IDfrom env for the refresh endpoint instead of hardcoding/consumers/tokens.jsonnext to the script before falling back to cwd, so it works when launched from any directoryexpiresAtthrough CLI: Forward token expiration time fromtokens.jsonto the server so it can proactively refresh before API calls failTest plan
build/cli.js.envis loaded correctly regardless of working directorytokens.jsonis found when server is launched from a different directorynpm run buildto confirm TypeScript compiles without errors🤖 Generated with Claude Code