i18n/de/skills/analyze-codebase-for-mcp/SKILL.md
Analysieren an arbitrary codebase to identify functions, APIs, and Datenquelles suitable for exposure as MCP tools, producing a tool specification document. Verwenden wenn planning an MCP server for an existing project, auditing a codebase vor wrapping it as an AI-accessible tool surface, comparing what a codebase can do versus what is already exposed via MCP, or generating a tool spec to hand off to scaffold-mcp-server.
npx skillsauth add pjt222/agent-almanac analyze-codebase-for-mcpInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Scannen a codebase to discover functions, REST endpoints, CLI commands, and data access patterns that are good candidates for MCP tool exposure, then produce a structured tool specification document.
scaffold-mcp-server1.1. Use Glob to map das Verzeichnis tree, focusing on source directories:
src/**/*.{ts,js,py,R,go,rs} for Quelldateis**/routes/**, **/api/**, **/controllers/** for endpoint definitions**/cli/**, **/commands/** for CLI entry points**/package.json, **/setup.py, **/DESCRIPTION for Abhaengigkeit metadata1.2. Categorize files by role:
1.3. Zaehlen total files, lines of code, and exported symbols to gauge project size.
Erwartet: A categorized file inventory with role annotations.
Bei Fehler: If die Codebasis is too large (>10,000 files), narrow the scan to specific directories or modules using the domain focus input. If no Quelldateis are found, verify the root path and language parameters.
2.1. Use Grep to find exported functions and oeffentliche APIs:
export (async )?function, export default, module.exports_, @app.route, @router#' @export roxygen tags2.2. Fuer jede candidate function, extract:
2.3. For REST APIs, zusaetzlich extract:
2.4. Erstellen a candidate list sorted by potential utility (public, documented, well-typed functions first).
Erwartet: A list of 20-100 candidate functions/endpoints with extracted metadata.
Bei Fehler: If few candidates are found, broaden the search to include internal functions that could be made public. If documentation is sparse, flag this as a risk in die Ausgabe.
3.1. Fuer jede candidate, assess gegen MCP tool criteria:
3.2. Score each candidate on a 1-5 scale:
3.3. Filtern candidates to those scoring 3 or ueber. Flag score-2 items as "future candidates" requiring refactoring.
Erwartet: A scored and filtered candidate list with suitability rationale for each.
Bei Fehler: If most candidates score unter 3, die Codebasis may need refactoring vor MCP exposure. Dokumentieren the gaps and recommend specific improvements (add types, extract pure functions, wrap Seiteneffekts).
4.1. Fuer jede selected candidate (score >= 3), draft a tool specification:
- name: tool_name
description: >
One-line description of what the tool does.
source_function: module.function_name
source_file: src/path/to/file.ts:42
parameters:
param_name:
type: string | number | boolean | object | array
description: What this parameter controls
required: true | false
default: value_if_optional
returns:
type: string | object | array
description: What the tool returns
side_effects:
- description of any side effect
estimated_latency: fast | medium | slow
suitability_score: 5
4.2. Group tools into logical categories (e.g., "Data Queries", "File Operations", "Analysis", "Configuration").
4.3. Identifizieren Abhaengigkeiten zwischen tools (e.g., "list_datasets" sollte called vor "query_dataset").
4.4. Bestimmen if any tools need wrappers to:
Erwartet: A complete YAML tool specification with categories, Abhaengigkeiten, and wrapper notes.
Bei Fehler: If tool specifications are ambiguous, revisit Step 2 to extract more detail from Quellcode. If parameter types cannot be inferred, flag for manual review.
5.1. Schreiben the final specification document with these sections:
5.2. Speichern as mcp-tool-spec.yml (machine-readable) and optionally mcp-tool-spec.md (human-readable summary).
5.3. If an existing MCP server was provided, include a gap analysis section:
Erwartet: A complete tool specification document ready for consumption by scaffold-mcp-server.
Bei Fehler: If the document exceeds reasonable size (>200 tools), split into modules with cross-references. If die Codebasis has no suitable candidates, produce a "readiness assessment" document with refactoring recommendations stattdessen.
Grep for file writes, network calls, and database mutations.scaffold-mcp-server - use die Ausgabe spec to generate a working MCP serverbuild-custom-mcp-server - manual server implementation referenceconfigure-mcp-server - connect das Ergebnising server to Claude Code/Desktoptroubleshoot-mcp-connection - debug connectivity nach deploying der Serverreview-software-architecture - architecture review for tool surface designsecurity-audit-codebase - security audit vor exposing functions externallytesting
Launch all available agents in parallel waves for open-ended hypothesis generation on problems where the correct domain is unknown. Use when facing a cross-domain problem with no clear starting point, when single-agent approaches have stalled, or when diverse perspectives are more valuable than deep expertise. Produces a ranked hypothesis set with convergence analysis and adversarial refinement.
tools
Write integration tests for a Node.js CLI application using the built-in node:test module. Covers the exec helper pattern, output assertions, filesystem state verification, cleanup hooks, JSON output parsing, error case testing, and state restoration after destructive tests. Use when adding tests to an existing CLI, testing a new command, verifying adapter behavior across frameworks, or setting up CI for a CLI tool.
development
Screen a proposed trademark for conflicts and distinctiveness before filing. Covers trademark database searches (TMview, WIPO Global Brand Database, USPTO TESS), distinctiveness analysis using the Abercrombie spectrum, likelihood of confusion assessment using DuPont factors and EUIPO relative grounds, common law rights evaluation, and goods/services overlap analysis. Produces a conflict report with a risk matrix. Use before adopting a new brand name, logo, or slogan — distinct from patent prior art search, which uses different databases, legal frameworks, and analysis methods.
tools
Scaffold a new CLI command using Commander.js with options, action handler, three output modes (human-readable, quiet, JSON), and optional ceremony variant. Covers command naming, option design, shared context patterns, error handling, and integration testing. Use when adding a command to an existing Commander.js CLI, designing a new CLI tool from scratch, or standardizing command structure across a multi-command CLI.