fix(client): restore OST_API_KEY flow to Authorization header#5
Merged
Conversation
Regression from the merge of #4: getConfig() validated OST_API_KEY but dropped it from the return value, and OSTClient lost its apiKey field and the Authorization header attachment. Every MCP request was going out unauthenticated and getting a misleading "Invalid or missing OST_API_KEY" error back from the backend. Restore the plumbing end-to-end: config returns { apiUrl, apiKey }; OSTClient constructor takes (baseUrl, apiKey); request() attaches Authorization: Bearer \${apiKey} on every call. Verified by running ost-mcp via stdio against a live backend + real ost-linker: list_categories and list_techstacks now return the actual taxonomy data.
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.
Summary
Regression fix — merged PR #4 accidentally dropped the `Authorization: Bearer` header on every outbound request. `getConfig()` still validated that `OST_API_KEY` is set at startup, but then dropped it from the return value, and `OSTClient` lost its `apiKey` field. Net effect: every MCP request was unauthenticated → 401'd by the backend → surfaced as a misleading "Invalid or missing OST_API_KEY" in the MCP client.
Caught by a manual stdio smoke before `@opensource-together/mcp@0.2.0` was published to npm. Not user-facing yet.
What this PR does
Verification
Ship this before cutting the v0.2.0 release.
Test plan