Thanks for helping make @takescake/1password-mcp better. This guide covers local setup, structure, and how we ship changes.
-
Clone
git clone https://github.com/CakeRepository/1Password-MCP.git cd 1Password-MCP -
Requirements — Node.js ≥ 20, npm.
-
Install & verify
npm ci npm run build npm test npm run lint -
Watch mode (optional)
npm run dev
You do not need a live service account token for unit tests. For manual MCP smoke tests, set OP_SERVICE_ACCOUNT_TOKEN (or macOS Keychain vars) against a dedicated automation vault.
src/
├── index.ts # Server entrypoint (stdio + MCP negotiation)
├── types.ts # Shared types
├── logger.ts # Structured logging to stderr
├── config.ts # CLI args, env vars, Keychain, allow-list
├── client.ts # 1Password SDK client singleton
├── secret-ref.ts # op:// parsing and vault allow-list
├── utils.ts # Result helpers, password generation
├── tools/ # MCP tool handlers (15)
│ ├── index.ts
│ ├── vault-list.ts
│ ├── item-lookup.ts
│ ├── item-list.ts
│ ├── item-get.ts
│ ├── item-edit.ts
│ ├── item-delete.ts
│ ├── item-archive.ts
│ ├── note-create.ts
│ ├── password-create.ts
│ ├── password-read.ts
│ ├── password-update.ts
│ ├── password-generate.ts
│ ├── password-generate-memorable.ts
│ ├── op-run.ts
│ └── op-check-ref.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
├── secret-ref.test.ts
├── op-run.test.ts
└── op-check-ref.test.ts
Version must stay aligned across package.json, server.json, and SERVER_VERSION in src/config.ts. See AGENTS.md.
- TypeScript — Strict mode; avoid
any(preferunknown+ narrowing). - Errors — Use
errorResult()fromutils.tsfor tool failures; set protocol-friendly error responses. - Logging — Use
log()/logError()fromlogger.ts. Never write tostdout(reserved for MCP). - Secrets — Default to metadata-only responses. New tools that can expose plaintext must opt in explicitly (e.g.
reveal/returnSecret). Prefer documentingop_runfor “use without reveal.” - Schemas — Tool/prompt inputs use Zod 4 and the MCP v2 registration APIs.
- Tests — Add or update Vitest coverage for new tools, prompts, and utilities.
- Commits — Conventional Commits (e.g.
feat: add item_archive tool,docs: refresh README for MCP 2026-07-28).
- Fork and branch from
master. - Make changes; update tests and docs when behavior or public surface changes.
- Run
npm run build && npm test && npm run lint. - Open a PR with a clear summary and test notes.
Automated publish runs from GitHub Releases via publish.yml (trusted publishing). Manual steps:
- Bump version in
package.json,server.json, andsrc/config.ts(SERVER_VERSION). - Update
CHANGELOG.md. - Merge to
master, then create a GitHub Release taggedvX.Y.Zmatching the package version. - Confirm the publish workflow succeeds on npm.
CI (ci.yml) builds and tests on push/PR to master. The published package requires Node ≥ 20.
For agent-oriented publish checklists, see AGENTS.md.
By contributing, you agree your contributions are licensed under the Apache License 2.0.