Skip to content

artubss/SKILLS-CLAUDE-CODE / claude-skills-main/claude-skills-main/plugins/integrations/skills/mcp-builder

mcp-builder

Verified

Build MCP servers in Python with FastMCP. Define tools / resources / prompts, build the server, test locally, deploy to FastMCP Cloud or Docker. Use whenever the user mentions building an MCP server, exposing tools to LLMs, FastMCP, building a Claude integration, or troubleshooting FastMCP module-level server, storage, lifespan, middleware, OAuth, or deployment errors.

assets/script-template.ts

View on GitHub
#!/usr/bin/env npx tsx
/**
 * {Tool Name} - {Brief description}
 *
 * Usage:
 *   npx tsx scripts/{tool-name}.ts <args>
 *   npx tsx scripts/{tool-name}.ts --help
 *
 * Examples:
 *   npx tsx scripts/{tool-name}.ts {example}
 */

import * as fs from 'fs';
import * as path from 'path';

// ============================================================================
// Configuration
// ============================================================================

interface Config {
  // Add config options
}

function loadConfig(): Config {
  // Load from env, config file, etc.
  return {};
}

// ============================================================================
// Argument Parsing
// ============================================================================

interface Args {
  // Define expected arguments
  input?: string;
  output?: string;
  format: 'json' | 'csv' | 'table';
  verbose: boolean;
  help: boolean;
}

function parseArgs(): Args {
  const args = process.argv.slice(2);
  const parsed: Args = {
    format: 'json',
    verbose: false,
    help: false,
  };

  for (let i = 0; i < args.length; i++) {
    switch (args[i]) {
      case '--input':
        parsed.input = args[++i];
        break;
      case '--output':
        parsed.output = args[++i];
        break;
      case '--format':
        parsed.format = args[++i] as Args['format'];
        break;
      case '--verbose':
        parsed.verbose = true;
        break;
      case '--help':
      case '-h':
        parsed.help = true;
        break;
    }
  }

  return parsed;
}

function showHelp(): void {
  console.log(`
{Tool Name} - {Description}

Usage:
  npx tsx scripts/{tool-name}.ts [options] <args>

Options:
  --input <file>     Read input from file
  --output <file>    Write output to file
  --format <type>    Output format: json, csv, table (default: json)
  --verbose          Show debug information
  --help, -h         Show this help

Examples:
  npx tsx scripts/{tool-name}.ts example-arg
  npx tsx scripts/{tool-name}.ts --input data.csv --output results.json
`);
}

// ============================================================================
// Core Logic
// ============================================================================

interface Result {
  success: boolean;
  data?: unknown;
  error?: string;
}

async function execute(/* params */): Promise<Result> {
  // Implement core logic here
  // This could also import from a shared module
  return { success: true, data: {} };
}

// ============================================================================
// Output Formatting
// ============================================================================

function formatOutput(result: Result, format: Args['format']): string {
  switch (format) {
    case 'json':
      return JSON.stringify(result, null, 2);
    case 'csv':
      // Implement CSV formatting
      return '';
    case 'table':
      // Implement table formatting
      return '';
  }
}

// ============================================================================
// Main
// ============================================================================

async function main(): Promise<void> {
  const args = parseArgs();

  if (args.help) {
    showHelp();
    process.exit(0);
  }

  try {
    const result = await execute(/* pass args */);
    const output = formatOutput(result, args.format);

    if (args.output) {
      fs.writeFileSync(args.output, output);
      if (args.verbose) {
        console.error(`Written to ${args.output}`);
      }
    } else {
      console.log(output);
    }

    process.exit(result.success ? 0 : 1);
  } catch (error: any) {
    console.error(JSON.stringify({ success: false, error: error.message }));
    process.exit(1);
  }
}

main();
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall