deploy

A command for deploying an MCP server to selected package registries, container registries, Claude Code, or GitHub. MCP servers provide tools that AI applications can call.

In plain words
What is it for?
Publishing to npm, pushing Docker images, registering with Claude Code, creating GitHub releases, choosing version tags, using custom registries, and performing dry runs.
Why use it?
It groups deployment steps and pre-deployment checks so publishing or registering a server does not require separate manual procedures.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/matt-dionis/claude-code-configs/deploy
Clone the repo
git clone --depth 1 https://github.com/Matt-Dionis/claude-code-configs

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,587 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.02587
Opus 5 $0.00000 $0.01293
Sonnet 5 $0.00000 $0.00517
Haiku 4.5 $0.00000 $0.00259

Measured 3d ago against content hash 1a636b9279d3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

deploy scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

import { exec } from 'child_process';
configurations/mcp-servers/simple-mcp-server/.claude/commands/deploy.md · 376 lines

How it starts

The opening of the file, as written. The whole thing — 376 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Deploy MCP Server

Deploys your MCP server to various platforms and registries.

Usage

/deploy [target] [options]

Targets

  • npm - Publish to npm registry
  • docker - Push to Docker registry
  • claude - Register with Claude Code
  • github - Create GitHub release

Options

  • --tag - Version tag (default: from package.json)
  • --registry - Custom registry URL
  • --dry-run - Test deployment without publishing

Implementation

import { exec } from 'child_process';
import { promisify } from 'util';
import * as fs from 'fs/promises';
import * as path from 'path';

const execAsync = promisify(exec);

async function deployServer(
  target: 'npm' | 'docker' | 'claude' | 'github',
  options: {
    tag?: string;
    registry?: string;
    dryRun?: boolean;
  } = {}
) {
  console.log('🚀 Deploying MCP Server');
  console.log('='.repeat(50));
  
  // Get version info
  const pkg = JSON.parse(await fs.readFile('package.json', 'utf-8'));
  const version = options.tag || pkg.version;
  
  // Pre-deployment checks
  await runPreDeploymentChecks(version);
  
  // Deploy based on target
  switch (target) {
    case 'npm':
      await deployToNpm(pkg, version, options);
      break;
    case 'docker':
      await deployToDocker(pkg, version, options);
      break;
    case 'claude':
      await deployToClaude(pkg, version, options);
      break;
    case 'github':
      await deployToGitHub(pkg, version, options);
      break;
  }
  
  console.log('\n✅ Deployment completed successfully!');
}

async function runPreDeploymentChecks(version: string) {
  console.log('\n🔍 Running pre-deployment checks...');
  
  // Check git status
  try {
    const { stdout: status } = await execAsync('git status --porcelain');
    if (status.trim()) {
      throw new Error('Working directory has uncommitted changes');
    }
    console.log('  ✅ Working directory clean');
  } catch (error) {
    if (error.message.includes('uncommitted')) {
      throw error;
    }
    console.warn('  ⚠️  Git not available');
  }
  
  // Check if version tag exists
  try {
    await execAsync(`git rev-parse v${version}`);
    console.log(`  ✅ Version tag v${version} exists`);
  } catch {
    console.warn(`  ⚠️  Version tag v${version} not found`);
    console.log('  Create with: git tag v' + version);
  }
  
  // Verify build exists
  const buildExists = await fs.access('dist').then(() => true).catch(() => false);
  if (!buildExists) {
    throw new Error('Build not found. Run /build first');
  }
  console.log('  ✅ Build found');
  
  // Run tests
  console.log('  Running tests...');
  try {
    await execAsync('npm test');
    console.log('  ✅ Tests passed');
  } catch {
    throw new Error('Tests must pass before deployment');
  }
}

async function deployToNpm(pkg: any, version: string, options: any) {
  console.log(`\n📦 Deploying to npm (v${version})...`);
  
  // Check npm authentication
  try {
    await execAsync('npm whoami');
    console.log('  ✅ npm authenticated');
  } catch {
    throw new Error('Not authenticated with npm. Run: npm login');
  }
  
  // Check if version already published
  try {
    const { stdout } = await execAsync(`npm view ${pkg.name}@${version}`);
    if (stdout) {
      throw new Error(`Version ${version} already published`);
    }
  } catch (error) {
    if (error.message.includes('already published')) {
      throw error;
    }
    // Version not published yet (good)
  }
  
  // Update version if different
  if (pkg.version !== version) {
    console.log(`  Updating version to ${version}...`);
    await execAsync(`npm version ${version} --no-git-tag-version`);
  }
  
  // Publish package
  const publishCmd = options.dryRun
    ? 'npm publish --dry-run'
    : `npm publish ${options.registry ? `--registry ${options.registry}` : ''}`;
  
  console.log('  Publishing to npm...');
  const { stdout } = await execAsync(publishCmd);
  
  if (options.dryRun) {
    console.log('  🧪 Dry run complete (not published)');

Read the full file on GitHub · 376 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 376 lines · 0 tokens per session scan A 1a636b9279d3

Subscribe to this mod's changes

deploy is a command published in the GitHub repository Matt-Dionis/claude-code-configs (625 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,587 tokens. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.