Added keyring support for secrets #77
Open
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.
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
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
)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]package.json
to register the newtodoist-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
src/main.ts
)Documentation Updates
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.