Skip to content

Conversation

batteryshark
Copy link

This pull request introduces secure credential storage for the Todoist AI MCP server by enabling users to store their Todoist API key in the system keychain, rather than relying solely on environment variables. It adds a new setup script, updates documentation to recommend the keychain approach, and modifies the server startup logic to prefer keychain credentials when available. The most important changes are grouped below:

Secure Credential Storage Implementation

  • Added a new keychain.ts utility module that provides functions to store, retrieve, check, and clear the Todoist API key using the system keychain via the @napi-rs/keyring library. (src/utils/keychain.ts)
  • Introduced a new setup script (setup-keychain.ts/setup-keychain.js) that securely prompts for the API key (with hidden input), stores it in the keychain, and handles overwrite confirmation. Both TypeScript and JavaScript entry points are provided for compatibility. (src/setup-keychain.ts, scripts/setup-keychain.js) [1] [2]
  • Updated package.json to register the new todoist-ai-setup-keychain CLI command and ensure the script is executable after build. Also, added the @napi-rs/keyring dependency. (package.json) [1] [2] [3]

Server Startup Logic

  • Modified the server's startup logic to check for the API key in the environment variable first, then fall back to the keychain if not set, and throw a descriptive error if neither is available. (src/main.ts)

Documentation Updates

  • Updated all relevant documentation files (README.md, docs/dev-setup.md, docs/mcp-server.md) to recommend the keychain method for storing credentials, provide setup instructions, and clarify configuration for both environment variable and keychain usage. (README.md, docs/dev-setup.md, docs/mcp-server.md) [1] [2] [3] [4] [5] [6]

These changes make credential management more secure and user-friendly, while maintaining backward compatibility with environment variable configuration.Added keyring support to store Todoist API key in the user keychain as an alternative to using environment variables.

Pull Request

Closes #...

Short description

PR Checklist

Feel free to leave unchecked or remove the lines that are not applicable.

  • Updated docs (README, etc.)

Added keyring support to store Todoist API key in the user keychain as an alternative to using environment variables.
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