Skip to main content
guidesSource-backedReview first Safety Privacy

Pinning MCP Server Packages Before Installation

Pin MCP server package versions before adding them to Claude Code: registry verification, lockfile discipline, npx package pins, supply-chain review, and rollback steps aligned to MCP quickstart and registry documentation.

by kiannidev·added 2026-06-16·
HarnessClaude Code
Review first review before installing

Open the source and read safety notes before installing.

Safety notes

  • Unpinned npx -y installs can pull new semver-compatible releases without review.
  • Registry listings describe intent but do not replace maintainer security review.
  • Do not pipe curl-to-shell install scripts without reading the pinned release artifact.

Privacy notes

  • Pinned versions should be documented in git; avoid embedding API keys in the same commit.
  • Test profiles prevent accidental production credential use during pin validation.
  • Registry metadata may link to vendor privacy policies—review before enterprise rollout.

Prerequisites

  • Target MCP server name, registry listing, or repository URL identified.
  • Package manager access (npm, uv, pip, etc.) matching the server install method.
  • Ability to run Claude Code in a test project before production rollout.
  • Team policy for third-party package updates and rollback.

Schema details

Install type
copy
Reading time
8 min
Difficulty score
54
Troubleshooting
Yes
Breaking changes
No
Full copyable content
Before claude mcp add, record the registry entry, pin npm or uv package versions, store the pin in .mcp.json or team docs, and test in an isolated profile first.

About this resource

TL;DR

Treat MCP servers like production dependencies: verify registry entries, pin package versions in install commands, document pins in .mcp.json, test in isolation, and plan rollback before enabling in shared projects.

Prerequisites & Requirements

  • {"task": "Server identified", "description": "Registry entry or repo URL recorded"}
  • {"task": "Install method known", "description": "stdio command, HTTP URL, or plugin path documented"}
  • {"task": "Test project ready", "description": "Non-production Claude Code profile available"}
  • {"task": "Rollback owner", "description": "Maintainer can revert .mcp.json pin"}

Core Concepts Explained

Registry vs local install

The MCP registry catalogs servers and install hints; Claude Code quickstart docs show adding servers via CLI and .mcp.json. Pinning happens at the package or commit level you pass to those commands.

Floating installs drift

Commands like npx -y server-name resolve latest matching semver on each cold start unless you append @1.2.3 or use a lockfile workflow.

Project-scoped .mcp.json

Project servers sync through version control—pins should be explicit so every teammate runs the same server build.

Step-by-Step Implementation Guide

  1. Find the canonical package. Use registry metadata or upstream README for npm, uv, or binary coordinates.

  2. Choose a pin strategy:

    • npm: package@1.2.3 in npx args
    • uv/pip: exact version in tool config
    • git: commit SHA in install docs
  3. Add with Claude Code CLI using pinned args after --:

claude mcp add --transport stdio myserver -- \
  npx -y my-mcp-server@1.2.3
  1. Copy resulting .mcp.json entry into the repo with the pin visible in command/args.

  2. Test in isolated profile with non-production credentials.

  3. Document upgrade process in CONTRIBUTING: who bumps pins and how CI validates.

  4. Rollback plan: revert .mcp.json pin and restart Claude Code sessions.

Review Checklist Before Merge

Check Pass criteria
Registry match Package name matches listing publisher
Version pin No bare @latest in shared config
Changelog Notable security fixes reviewed
Scope OAuth/env vars documented separately
Test Server starts under MCP_TIMEOUT budget

Troubleshooting

Server fails after pin bump

Diff changelog; restore previous pin in .mcp.json and re-auth OAuth if needed.

npx still resolves unexpectedly

Confirm args after -- include @version; clear npx cache if testing locally.

Teammate runs different build

Ensure .mcp.json is committed and local-only overrides aren't masking pins.

Source Verification Notes

Verified against Claude Code MCP quickstart and MCP registry about documentation on 2026-06-16: CLI add patterns, project .mcp.json sharing, and registry role as discovery—not a substitute for maintainer review.

Duplicate Check

Complements threat-model-mcp-servers-before-installation (trust review) and claude-mcp-server-setup-guide (first-time setup). No guide focuses on version pinning discipline before shared installation.

References

Source citations

Add this badge to your README

Show that Pinning MCP Server Packages Before Installation is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.

Listed on HeyClaude
[![Listed on HeyClaude](https://heyclau.de/badge/guides/pinning-mcp-server-packages-before-installation.svg)](https://heyclau.de/entry/guides/pinning-mcp-server-packages-before-installation)

How it compares

Pinning MCP Server Packages Before Installation side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.

FieldPinning MCP Server Packages Before Installation

Pin MCP server package versions before adding them to Claude Code: registry verification, lockfile discipline, npx package pins, supply-chain review, and rollback steps aligned to MCP quickstart and registry documentation.

Open dossier
Package Provenance Checks Before Installing MCP Servers

Verify MCP server package provenance before Claude Code installation: registry publisher match, repository ownership, release artifact checksums, maintainer history, and rollback when supply-chain signals fail review.

Open dossier
Auditing MCP Client Configuration Before Team Rollout

Source-backed checklist for reviewing Claude Code MCP client configuration before a team rollout, covering scopes, transports, commands, secrets, allowlists, denylists, approvals, and rollback.

Open dossier
Remote MCP Server Security Review Checklist

Checklist for reviewing remote MCP servers before team rollout: OAuth scopes, transport security, tool surface, registry provenance, and rollback.

Open dossier
Trust
Install riskReview firstReview firstReview firstReview first
Notes Safety Privacy Safety Privacy Safety Privacy Safety Privacy
Categoryguidesguidesguidesguides
Sourcesource-backedsource-backedsource-backedsource-backed
AuthorkiannidevkiannidevYB0ykiannidev
Added2026-06-162026-06-162026-06-102026-06-14
Platforms
Claude Code
Claude Code
Claude Code
Claude Code
Source repo
Safety notesUnpinned npx -y installs can pull new semver-compatible releases without review. Registry listings describe intent but do not replace maintainer security review. Do not pipe curl-to-shell install scripts without reading the pinned release artifact.Unverified packages execute with user privileges in stdio mode—provenance review is not optional for production repos. Registry listings describe intent but do not replace maintainer security audit. Typosquat package names can mimic popular servers—verify exact publisher coordinates.Local stdio MCP servers execute commands with the user's privileges, so review the exact command, arguments, package runner, file paths, and network behavior before sharing a config. Remote MCP servers can expose model-controlled tools for production systems; require least-privilege scopes, explicit approval for write tools, and a rollback path before team rollout. Do not rely on server names alone for enforcement because names are user-assigned labels; use command or URL allowlist entries when policy must control what actually runs.Remote MCP servers expose model-callable tools over the network; treat write tools, shell proxies, and broad API scopes as production-risk actions until explicitly approved. Verify transport uses HTTPS with valid certificates and that OAuth tokens are scoped to the minimum tenant, project, or account needed for the workflow. Do not approve registry entries or remote URLs that cannot be tied to an identifiable maintainer, version history, and update channel.
Privacy notesPinned versions should be documented in git; avoid embedding API keys in the same commit. Test profiles prevent accidental production credential use during pin validation. Registry metadata may link to vendor privacy policies—review before enterprise rollout.Provenance notes may reference private registry URLs—keep internal hostnames out of public tickets. Checksum logs should not include OAuth tokens or .env contents. Vendor privacy policies apply when servers phone home—review before enterprise rollout.MCP client configuration can reveal server URLs, internal hostnames, command paths, environment-variable names, header names, OAuth client IDs, and tool availability. Do not store API keys, bearer tokens, client secrets, tenant IDs, or personal credentials in shared `.mcp.json`, managed-mcp.json, PR bodies, issue comments, logs, or screenshots. Tool arguments, tool results, resources, prompts, logs, traces, and OAuth metadata can expose private repositories, tickets, databases, user identities, and workspace data.Remote MCP traffic can include prompts, tool arguments, tool outputs, OAuth metadata, tenant IDs, and resource identifiers visible to the server operator. Review whether the remote server logs, caches, or forwards tool inputs to third-party observability or analytics systems. Revoke OAuth grants and delete local MCP configuration when uninstalling a remote server that accessed private repositories, tickets, or customer data.
Prerequisites
  • Target MCP server name, registry listing, or repository URL identified.
  • Package manager access (npm, uv, pip, etc.) matching the server install method.
  • Ability to run Claude Code in a test project before production rollout.
  • Team policy for third-party package updates and rollback.
  • Target MCP server registry entry or repository URL identified.
  • Access to npm, PyPI, or git release artifacts for checksum verification.
  • Isolated Claude Code test profile with non-production credentials.
  • Team policy defining acceptable third-party publishers.
  • A draft `.mcp.json`, `~/.claude.json` entry, plugin-provided MCP server, claude.ai connector plan, or managed-mcp.json deployment to review.
  • The server documentation, package or repository source, expected transport, command or URL, environment variables, headers, OAuth behavior, and tool list.
  • A test machine or disposable Claude Code profile where the configuration can be loaded with non-production data.
  • A named owner who can approve the rollout, publish the final configuration, and revoke credentials or block servers if the rollout fails.
  • The remote MCP server URL, registry listing or package source, documentation, and declared tool list.
  • The OAuth client configuration, redirect URIs, requested scopes, token storage behavior, and identity provider policy.
  • A test Claude Code profile where the remote server can be connected with non-production credentials.
  • A named approver who can block the server, revoke tokens, and publish managed MCP policy if the review fails.
Install
Config
Citations
ClaimUnclaimedUnclaimedUnclaimedUnclaimed

Signals

Loading live community signals…

More like this, weekly

A short, calm digest of reviewed Claude resources. Unsubscribe any time.