Skip to content
This repository was archived by the owner on Aug 7, 2026. It is now read-only.

feat: lazy API key loading for MCP server - #7

Merged
odfalik merged 1 commit into
mainfrom
feat/lazy-api-key
Jan 13, 2026
Merged

odfalik merged 1 commit into
mainfrom
feat/lazy-api-key

Conversation

@odfalik

@odfalik odfalik commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • MCP server now defaults to lazy API key loading - LAMBDA_API_KEY_COMMAND is deferred until first API request
  • Added --eager flag to MCP server for those who want startup-time loading
  • API key is cached in memory after first retrieval
  • CLI behavior unchanged (always loads at startup)

This improves Claude Code startup time when using slow API key commands (e.g., 1Password) since the command only runs when Lambda tools are actually used.

Test plan

  • Start MCP server with LAMBDA_API_KEY_COMMAND - verify no command execution at startup
  • Make first API request - verify command executes and works
  • Make second API request - verify cached key is used (no re-execution)
  • Test --eager flag - verify command runs at startup
  • Test CLI - verify unchanged behavior (loads at startup)

🤖 Generated with Claude Code

Add support for deferring API key command execution until first use:

- MCP server now defaults to lazy loading (defers LAMBDA_API_KEY_COMMAND
  execution until the first API request)
- Add --eager flag to MCP server for startup-time API key loading
- API key is cached in memory after first retrieval
- CLI continues to load API key at startup (unchanged behavior)

This improves Claude Code startup time when using slow API key commands
(e.g., 1Password) since the command only runs when Lambda tools are
actually used.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@odfalik
odfalik merged commit c6ba135 into main Jan 13, 2026
6 checks passed
@odfalik
odfalik deleted the feat/lazy-api-key branch January 13, 2026 22:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant