Steps for building, versioning, and publishing @takescake/1password-mcp.
Follow Semantic Versioning.
| Bump | When |
|---|---|
Patch (4.0.x) |
Bug fixes, docs, minor security hardening |
Minor (4.x.0) |
New tools, prompts, resources, or non-breaking features |
Major (x.0.0) |
Breaking MCP tool schemas, required Node upgrades, or core architecture changes |
Update the version in all of:
package.jsonpackage-lock.json(rootversionandpackages[""].version)server.json(top-levelversionandpackages[0].version)src/config.ts(SERVER_VERSION)CHANGELOG.md
The publish workflow fails if the package.json, server.json, and src/config.ts versions disagree (it does not check the lockfile or changelog), or if a GitHub Release tag is not v + package version.
Always run the full suite before publishing:
npm run clean
npm ci
npm run build
npm run lint
npm testRuntime requirement: Node.js ≥ 20.
- Merge version + changelog to
master. - Create a GitHub Release on
masterwith tagvX.Y.Z. publish.ymlruns two jobs (see CI/CD):buildinstalls, validates versions and the tag, builds, tests, and packs the tarball with no OIDC access;publishthen publishes that tarball via npm trusted publishing (OIDC, noNPM_TOKEN).
npm login
npm publish --access publicprepublishOnly runs clean, build, and test before a manual npm publish. The automated workflow publishes a prebuilt tarball (npm publish ./package.tgz --ignore-scripts), which skips lifecycle scripts, so its build job runs build and test instead.
| Variable | Notes |
|---|---|
OP_SERVICE_ACCOUNT_TOKEN |
Primary auth. Required unless macOS Keychain fallback is used. |
OP_KEYCHAIN_SERVICE |
macOS only: Keychain service name for the token. |
OP_KEYCHAIN_ACCOUNT |
macOS only: optional account for Keychain lookup. |
OP_MCP_ALLOWED_VAULTS |
Optional comma-separated vault names/IDs (case-insensitive). Enforced server-wide by every tool and resource that touches a vault; tools that take a vaultId need an ID. |
OP_INTEGRATION_NAME |
Optional; default 1password-mcp. |
OP_INTEGRATION_VERSION |
Optional; default SERVER_VERSION. |
MCP_LOG_LEVEL |
Optional: debug, info, warn, error (default info). |
MCP_DEBUG |
Optional; if set, forces debug logging. |
CLI equivalents: --service-account-token / --token, --log-level, --integration-name, --integration-version, --allowed-vaults. Avoid the token flags: argv is visible to other local processes, and the server logs a warning at startup.
When tools, prompts, or resources change, update README.md (npm’s face), CHANGELOG.md, and this file’s mental model:
- 15 tools:
vault_list,item_lookup,item_list,item_get,item_edit,item_delete,item_archive,note_create,password_create,password_read,password_update,password_generate,password_generate_memorable,op_run,op_check_ref - 4 prompts:
generate-secure-password,credential-rotation,vault-audit,secret-reference-helper - 3 resources:
onepassword://config,onepassword://vaults, and theResourceTemplateonepassword://vaults/{vaultId}/items. The SDK parses every read URI withnew URL(), so a scheme must start with a letter (never1password://), and parameterized URIs must be registered as aResourceTemplate.tests/resources.e2e.test.tsreads every advertised resource through a real client to catch both mistakes. - Protocol: MCP SDK v2, stdio negotiation for 2026-07-28 + legacy clients
- Prefer
op_run+op://overreveal: true. - Prefer
op_check_refover revealing just to validate a path. - Default create/update responses should not echo secrets (
returnSecret/revealopt-in). - The vault allow-list is server-wide: any new tool or resource that touches a vault must go through
src/vault-access.ts(assertVaultIdAllowed/filterAllowedVaults). op_runredaction is best effort, not a sandbox: don't run untrusted commands with injected secrets.item_getreturns notes as-is, so don't store secrets in notes.- Never commit tokens or MCP configs containing secrets.
ci.yml— build/test on push and PRs tomaster.publish.yml— npm publish on GitHub Release / manual dispatch, as two jobs:build(contents: read, no OIDC):npm ci --ignore-scripts(no dependency install scripts), version and tag validation, build, test, thennpm pack --ignore-scriptsintopackage.tgz, uploaded as thenpm-packageartifact.publish(needs: build): the only job withid-token: write. It never checks out the repo or installs dependencies; it downloads the tarball and runsnpm publish ./package.tgz --access public --ignore-scripts(skipped if that version is already on npm).- Keep it that way: dependency code must never run in a job that holds
id-token: write. npm's trusted-publisher config is bound to the file namepublish.yml, so don't rename it.
- Workflow hygiene: pass
${{ ... }}values to scripts throughenv:instead of interpolating them intorun:, check out withpersist-credentials: false, and don't addissue_comment-triggered or write-scoped one-off runner workflows (the leftovermcp-v2-migration.ymlwas removed in 5.0.0 for that reason). - Registry package name:
io.github.CakeRepository/1password(mcpName/server.json).