Thank you for your interest in contributing! This guide will help you get started.
-
Clone the repository
git clone https://github.com/CakeRepository/1Password-MCP.git cd 1Password-MCP -
Install dependencies
npm install
-
Build
npm run build
-
Run tests
npm test
src/
├── index.ts # Server entrypoint
├── types.ts # Shared type definitions
├── logger.ts # Structured logging to stderr
├── config.ts # CLI args, env vars, constants
├── client.ts # 1Password SDK client singleton
├── utils.ts # Result helpers, password generation
├── tools/ # MCP tool handlers
│ ├── index.ts # Tool registration barrel
│ ├── vault-list.ts
│ ├── item-lookup.ts
│ ├── item-delete.ts
│ ├── password-create.ts
│ ├── password-read.ts
│ ├── password-update.ts
│ ├── password-generate.ts
│ └── password-generate-memorable.ts
├── prompts/ # MCP prompt definitions
│ └── index.ts
└── resources/ # MCP resource definitions
└── index.ts
tests/
├── utils.test.ts
├── config.test.ts
├── tools.test.ts
└── prompts.test.ts
- TypeScript — All code must be written in TypeScript with strict mode.
- No
any— Avoidanytypes. Useunknownand narrow with type guards. - Error handling — Always use
errorResult()fromutils.tsfor tool error responses. - Logging — Use the
log()andlogError()functions fromlogger.ts. Never write tostdout(reserved for MCP protocol). - Tests — Add tests for any new tool, prompt, or utility function.
- Commit messages — Use Conventional Commits (e.g.,
feat: add item_delete tool,fix: modulo bias in password_generate).
- Fork the repo and create a feature branch from
master. - Make your changes and add/update tests.
- Run
npm run build && npm testto ensure everything passes. - Open a pull request with a clear description of your changes.
The project uses automated CI/CD for NPM releases.
- Update the version in
package.json,server.json, andsrc/config.ts. - Update
CHANGELOG.mdwith the new version and changes. - Commit and push to the
masterbranch. - The GitHub Action will automatically:
- Run tests on Node.js 18, 20, and 22.
- Build the project.
- Publish the new version to NPM.
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.