Skip to content

feat: mcp-server credential fallback, chat reuse docs#92

Merged
jflayhart merged 1 commit into
mainfrom
stainless/release
Jul 26, 2026
Merged

feat: mcp-server credential fallback, chat reuse docs#92
jflayhart merged 1 commit into
mainfrom
stainless/release

Conversation

@jflayhart

@jflayhart jflayhart commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Regenerated by stlc. This release carries one hand-written change and one spec change.

1. mcp-server falls back to the linq CLI credential

packages/mcp-server/src/linq-cli-credentials.ts (new), wired in index.ts.

MCP clients launch the server as a detached child process, so it never inherits a login shell. On macOS a GUI-launched editor does not see export LINQ_API_V3_API_KEY=... from a shell profile — which leaves the env var, the only supported credential source, unreachable for most desktop users.

The server now reads the token linq login already wrote to ~/.linq/config.json when the env var is unset, honouring LINQ_PROFILE and the config's active profile. An explicitly provided key still wins. Every failure path — file absent, unreadable, malformed, or tokenless — falls through to the previous behaviour, so the SDK still reports the missing credential itself.

This was driven by a concrete finding: a relative script path in a Cursor plugin's mcp.json does not resolve to the plugin root (Cursor looks in the open workspace; the spawned process cwd is $HOME), so a launcher script could not be used to supply the key. Resolving it in the server removes the need for one, and Claude Code and Codex get the same fix.

Verified end to end with no env var set: the server logged Using the API key from ~/.linq/config.json, the Deno sandbox booted, and an authenticated phone_numbers call returned live data.

This is sealed as custom code

The patch lives in linq-sdks at stainless/custom-code/typescript/, so a future regeneration re-applies it instead of reverting it. That matters here specifically: f8bdf2d fixed the Deno sandbox by hand, 567485d1 regenerated over it, and 0.29.0 shipped with execute broken on every call. The same tracking file also carries that --allow-net fix, already released in 0.30.0.

Please do not hand-edit packages/mcp-server/src/linq-cli-credentials.ts or the --allow-net flag in code-tool.ts on main — edits there are erased by the next regeneration. Change them via stlc build --commit in linq-sdks.

2. Document chat reuse and named-group behaviour

src/resources/chats/chats.ts and the mcp-server docs index, regenerated from the OpenAPI spec change in synapse. Documentation only; no behaviour change.

Checks

lint and build pass. Merging cuts 0.31.0 via release-please.

@jflayhart jflayhart changed the title feat: regenerate SDKs from updated API spec feat: document chat reuse behavior and display_name handling Jul 26, 2026
@jflayhart
jflayhart force-pushed the stainless/release branch from dca098d to 161a904 Compare July 26, 2026 20:00
@jflayhart jflayhart changed the title feat: document chat reuse behavior and display_name handling feat: mcp-server credential fallback, chat reuse docs Jul 26, 2026
@jflayhart jflayhart changed the title feat: mcp-server credential fallback, chat reuse docs feat: regenerate SDKs from updated API spec Jul 26, 2026
@jflayhart
jflayhart force-pushed the stainless/release branch from 161a904 to 8810f53 Compare July 26, 2026 21:22
@jflayhart jflayhart changed the title feat: regenerate SDKs from updated API spec feat: mcp-server credential fallback, chat reuse docs Jul 26, 2026
@jflayhart
jflayhart merged commit 969edb3 into main Jul 26, 2026
5 checks passed
@jflayhart
jflayhart deleted the stainless/release branch July 26, 2026 21:50
@jflayhart jflayhart mentioned this pull request Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant