Tech Debt Mcp

io.github.PierreJanineh由 GitHub 帳號 PierreJanineh 發布v2.1.0更新於 Nov 10, 2026

MCP Server for analyzing technical debt across multiple programming languages

發布方自己的服務:Tech.eu Funding Explorer

已驗證STDIO僅桌面開發者工具安全與監控

概覽

AI 產生的概覽

本機 MCP 伺服器,可掃描 14 種語言的程式碼庫技術債,回傳健康分、SQALE 評級與依優先順序排列的修正建議。

可以做什麼
  • 分析整個專案或單一檔案,找出程式碼品質、安全性與可維護性問題,並依語言、類別與嚴重程度篩選。
  • 取得健康分、問題數量,以及包含修復工時與債務比的 SQALE 評級。
  • 取得依優先順序排列的修正建議,依嚴重程度或債務類別篩選問題,並列出支援的語言。
  • 在目前工作階段中新增、移除、測試並執行以正規表示式為基礎的自訂規則。
  • 掃描 10 個相依性生態系的套件清單並產生離線相依性清冊供 CVE 審查,同時驗證 .techdebtrc.json 設定。
  • 透過兩個以專案路徑定址的唯讀資源讀取摘要與問題資料。
適用情境
適合讓助理審查程式碼庫品質、估算修復工作量,或在不把程式碼送出本機的前提下檢查相依性清單。適用於希望在 Copilot、Claude、Cursor 等用戶端取得可重複技術債報告的團隊。
執行需求
以 stdio 在本機執行,通常透過 npm 套件 tech-debt-mcp 的 npx 啟動,因此需要 Node.js 與 npm;另有打包版本可在執行時不需連網。未宣告任何帳號、API 金鑰或環境變數。工具需要傳入待分析專案或檔案的絕對路徑。
安裝前請注意
它會讀取所給絕對路徑下的檔案,請只指向願意讓助理存取的專案。兩個自訂規則工具會變更工作階段狀態,但僅限目前工作階段。分析在本機完成且伺服器不發出外部網路請求,但透過 npx 安裝會連線至 npm 儲存庫。檢查結果為啟發式樣式比對,不能取代完整的安全稽核。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Tech Debt Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[Tech Debt MCP]

Tech Debt MCP Server

[npm version] [Add to MCP] [SQALE Rating] [CodeQL] [Documentation]

16 Tools · 2 Resources · 14 Languages · 10 Dependency Ecosystems

A Model Context Protocol (MCP) server for analyzing technical debt across multiple programming languages. Designed to integrate with GitHub Copilot, Claude, Cursor, and other MCP-compatible tools.

Features

  • Multi-language support: JavaScript, TypeScript, Python, Java, Swift, Kotlin, Objective-C, C++, C, C#, Go, Rust, Ruby, PHP
  • Comprehensive analysis: Detects various types of tech debt including code quality issues, security vulnerabilities, and maintainability problems
  • SQALE Metrics: Calculate technical debt with SQALE rating system (A-E scale)
  • SwiftUI Analysis: Specialized checks for SwiftUI patterns, state management, memory leaks, view nesting, and concurrency issues
  • Custom Rules: Define your own pattern-based checks with regex support
  • Dependency Analysis: Parse package manifests across 10 ecosystems (npm, pip, Maven/Gradle, Cargo, Go Modules, Composer, Bundler, NuGet, C/C++, Swift)
  • Inline Suppression: Suppress false positives with // techdebt-ignore-next-line or block comments
  • Config Validation: Validate .techdebtrc.json configuration files for schema correctness
  • Actionable recommendations: Provides prioritized suggestions for addressing technical debt
  • Flexible filtering: Filter results by severity, category, or language
  • Security hardened (v2.0.2): Path traversal prevention on all tool and resource path inputs, ReDoS-safe custom-rule regex validation, regex-injection escaping in SwiftUI checks, absolute-path sanitization in all error messages, and CodeQL SAST scanning on every push/PR

Supported Languages

LanguageExtensionsKey Checks
JavaScript.js, .mjs, .cjs, .jsxconsole.log, debugger, eslint-disable, usage of dynamic code execution, var usage
TypeScript.ts, .tsx, .mts, .ctsany type, @ts-ignore, non-null assertions, type assertions
Python.py, .pyw, .pyibare except, print statements, global usage, dynamic code execution
Java.javaSystem.out, printStackTrace, empty catch, @SuppressWarnings
Swift.swiftforce unwrap (!), force cast (as!), force try, retain cycles, SwiftUI patterns
Kotlin.kt, .kts!!, lateinit abuse, @Suppress, unchecked casts
Objective-C.m, .mm, .hNSLog, retain cycles, deprecated methods, massive view controllers
C++.cpp, .cc, .hpp, .hraw pointers, C-style casts, goto, using namespace std
C.c, .hmalloc without free, goto, unsafe functions, null checks
C#.csConsole.WriteLine, async void, empty catch, dispose pattern
Go.goignored errors, blank imports, fmt.Print, panic, global variables
Rust.rsunwrap, expect, unsafe, allow attributes, panic, println
Ruby.rbputs, binding.pry, rubocop disable, dynamic code execution, global variables
PHP.phpvar_dump, print_r, die/exit, dynamic code execution, error suppression

Installation

[VS Code: Install Server]

One-Click Install

VS Code (via Terminal):

sh
code --add-mcp '{"name":"tech-debt-mcp","command":"npx","args":["-y","tech-debt-mcp@latest"]}'
[Cursor: Install Server]

One-Click Install

Cursor (via Terminal):

sh
cursor --add-mcp '{"name":"tech-debt-mcp","command":"npx -y tech-debt-mcp@latest"}'
[Claude: Install Server]

Claude Code (via Terminal):

sh
claude mcp add tech-debt-mcp -- npx -y tech-debt-mcp@latest

Claude Desktop — add to your claude_desktop_config.json:

json
{  "mcpServers": {    "tech-debt-mcp": {      "command": "npx",      "args": ["-y", "tech-debt-mcp@latest"]    }  }}
[Claude Code: Install as Plugin]

Claude Code plugin — add this repo's marketplace, then install the plugin:

sh
/plugin marketplace add PierreJanineh/TechDebtMCP/plugin install tech-debt-mcp@techdebtmcp

The plugin runs npx -y tech-debt-mcp@latest under the hood — no source bundling, always tracks the published npm release. See plugin/README.md for plugin-user-facing docs (install flow, example transcripts, security posture).

[Claude Desktop: Install MCPB Bundle]

Claude Desktop MCPB bundle — single-click install with bundled node_modules (no npx, no internet required at runtime).

Download tech-debt-mcp-<version>.mcpb from the latest GitHub Release and open it with Claude for macOS or Windows.

To build the bundle locally:

sh
npm install --include=dev --ignore-scriptsnpm run mcpb:pack# -> mcpb/tech-debt-mcp-<version>.mcpb
[Windsurf: Install Server]

Add to your Windsurf MCP configuration (~/.codeium/windsurf/mcp_config.json):

json
{  "mcpServers": {    "tech-debt-mcp": {      "command": "npx",      "args": ["-y", "tech-debt-mcp@latest"]    }  }}
[JetBrains: Install Server]

Via AI Assistant — open Settings > Tools > AI Assistant > Model Context Protocol (MCP), click +, select As JSON, and paste:

json
{  "mcpServers": {    "tech-debt-mcp": {      "command": "npx",      "args": ["-y", "tech-debt-mcp@latest"]    }  }}
[Xcode: Install Server]

Via GitHub Copilot for Xcode — open Settings > MCP tab > Edit Config (mcp.json):

json
{  "servers": {    "tech-debt-mcp": {      "command": "npx",      "args": ["-y", "tech-debt-mcp@latest"]    }  }}

Manual Setup

Add to your MCP client config:

json
{  "mcpServers": {    "tech-debt-mcp": {      "command": "npx",      "args": ["-y", "tech-debt-mcp@latest"]    }  }}

For development: npm run dev

Tools

Every tool declares a tool annotation — Read tools are side-effect-free (readOnlyHint: true); Write tools mutate server session state (destructiveHint: true).

CategoryToolTypeDescription
Analysisanalyze_projectReadAnalyze entire project — filter by language, category, severity, maxFiles
analyze_fileReadAnalyze a single file
get_debt_summaryReadQuick summary with health score and issue counts
get_sqale_metricsReadSQALE rating, remediation time, debt ratio, breakdowns
Filteringget_recommendationsReadPrioritized fix suggestions (configurable limit)
get_issues_by_severityReadIssues filtered by severity level
get_issues_by_categoryReadIssues filtered by debt category
list_supported_languagesReadAll languages with their checks
Custom Rulesadd_custom_ruleWriteAdd regex-based tech debt rule
remove_custom_ruleWriteRemove a custom rule by ID
list_session_custom_rulesReadList rules added via add_custom_rule this session (does not include .techdebtrc.json customPatterns)
execute_custom_rulesReadRun custom rules against code or file
validate_custom_patternReadTest a pattern before adding it
Dependenciescheck_dependenciesReadScan package manifests across 10 ecosystems
get_vulnerability_reportReadOffline dependency inventory for CVE review
validate_configReadValidate .techdebtrc.json schema

Debt categories used throughout: dependency · code-quality · architecture · documentation · testing · security · performance · maintainability

Analysis — parameter reference
ToolParameterTypeRequiredConstraints / defaultDescription
analyze_projectpathstring✓absolute filesystem pathProject root directory
languagesstring[]Filter to specific languages
categoriesstring[]see categories aboveFilter by debt categories
severityenumlow / medium / high / criticalMinimum severity level
maxFilesintegermin: 1Cap on files analyzed
analyze_filepathstring✓absolute filesystem pathFile to analyze
get_debt_summarypathstring✓absolute filesystem pathProject root directory
get_sqale_metricspathstring✓absolute filesystem pathProject root directory
developmentTimenumberhoursEstimated dev time for debt-ratio calc

get_sqale_metrics returns a SQALE rating (A-E) with star visualization, total remediation time, debt ratio, and breakdowns by severity and category.

Filtering — parameter reference
ToolParameterTypeRequiredConstraints / defaultDescription
get_recommendationspathstring✓absolute filesystem pathProject root directory
limitintegerdefault: 5, min: 1Max recommendations to return
get_issues_by_severitypathstring✓absolute filesystem pathProject root directory
severityenum✓low / medium / high / criticalSeverity to filter by
get_issues_by_categorypathstring✓absolute filesystem pathProject root directory
categoryenum✓see categories aboveDebt category to filter by
list_supported_languages————No parameters
Custom Rules — parameter reference
ToolParameterTypeRequiredConstraints / defaultDescription
add_custom_ruleidstring✓Unique rule identifier
patternstring✓max 1,000 charsRegex pattern to match
messagestring✓Issue title/message
severityenum✓low / medium / high / criticalSeverity level
categoryenum✓see categories aboveDebt category
suggestionstringHow to fix the issue
languagesstring[]Restrict to specific languages
flagsstringallowed: d g i m s u v y; u / v mutually exclusiveRegex flags
remove_custom_ruleidstring✓Rule ID to remove
list_session_custom_rules————No parameters. Renamed from list_custom_rules (TEC-51) to clarify scope: only session-registered rules.
execute_custom_rulespathstring◐absolute path, max 500,000 bytesFile to analyze
codestring◐1-500,000 charsSource code to analyze directly
languagestringmust be a supported language ID (same set as list_supported_languages)Filter rules by language
validate_custom_patternidstring✓Unique rule identifier
patternstring✓max 1,000 charsRegex to validate
messagestring✓Issue title/message
severityenum✓low / medium / high / criticalSeverity level
categoryenum✓see categories aboveDebt category

◐ execute_custom_rules requires either path or code, not both required. An empty string "" for path is treated the same as omitting the field.

Dependencies — parameter reference
ToolParameterTypeRequiredConstraints / defaultDescription
check_dependenciespathstring✓absolute filesystem pathProject root directory
includeDevbooleandefault: trueInclude dev/test dependencies
get_vulnerability_reportpathstring✓absolute filesystem pathProject root directory
includeDevbooleandefault: falseInclude dev dependencies
validate_configpathstring✓absolute filesystem pathProject root directory or direct path to .techdebtrc.json

check_dependencies detects manifests for npm, pip, Maven/Gradle, Cargo, Go Modules, Composer, Bundler, NuGet, C/C++ (CMakeLists.txt, conanfile.txt/py, vcpkg.json), and Swift Package Manager. get_vulnerability_report produces an offline dependency inventory — see ROADMAP.md for planned online CVE lookup.

Resources

Two MCP resources expose read-only tech debt data as JSON. Both use RFC 6570 URI templates: the {+projectPath} syntax is reserved expansion, which allows the variable to contain the / characters of an absolute filesystem path without percent-encoding.

URI templateDescription
debt://summary/{+projectPath}Health score, debt score, issue counts, and SQALE metrics
debt://issues/{+projectPath}Filterable list of all tech debt issues; supports severity, category, and limit query params

Concrete examples — substitute {+projectPath} with an absolute path. Note the double slash: the template's trailing / plus the path's leading / produce //, which is valid URI syntax.

debt://summary//Users/you/projects/myappdebt://issues//Users/you/projects/myappdebt://issues//Users/you/projects/myapp?severity=high&limit=50debt://issues//Users/you/projects/myapp?category=security

Testing interactively — the easiest way to exercise tools and resources is the MCP Inspector:

bash
npm run buildnpx @modelcontextprotocol/inspector node dist/index.js

Open the URL it prints, switch to the Resources tab, and read a template URI with your absolute project path.

Configuration

Create a .techdebtrc.json file in your project root:

json
{  "include": ["src/**", "lib/**"],  "ignore": ["vendor/**", "generated/**"],  "rules": {    "maxFileLines": 500,    "maxFunctionLines": 50,    "maxComplexity": 10,    "maxNestingDepth": 4  },  "severity": {    "todo-comment": "low",    "console-log": "medium"  },  "ruleExclusions": {    "debugger": ["**/src/analyzers/**"],    "ts-ignore": ["**/src/analyzers/**"]  },  "customPatterns": [    {      "id": "no-console-log",      "pattern": "console\\.log",      "severity": "low",      "category": "code-quality",      "message": "Remove console.log() statements",      "suggestion": "Use proper logging library instead",      "languages": ["javascript", "typescript"]    }  ]}

Language Overrides

Override rules, severity, or file extensions on a per-language basis using languageOverrides. Keys must be valid supported language identifiers.

json
{  "languageOverrides": {    "typescript": {      "rules": {        "maxFileLines": 800,        "maxFunctionLines": 80      },      "severity": {        "todo-comment": "high"      }    },    "python": {      "extensions": [".pyx"],      "rules": {        "maxComplexity": 15      }    }  }}
  • rules — per-language thresholds (override the top-level rules for matching files).
  • severity — per-language rule severity overrides.
  • extensions — additional file extensions (beyond the defaults) to attribute to this language.

Rule Exclusions

Use ruleExclusions to suppress specific rules for files matching glob patterns. Patterns use forward slashes (/) on all platforms. Use **/ prefixed patterns (e.g., **/src/analyzers/**) for reliable matching regardless of path format.

Inline Suppression

Suppress specific issues directly in source code. Both // and # comment prefixes are supported across all languages.

Single-line — suppresses the next line:

typescript
// techdebt-ignore-next-line debuggerdebugger; // only the 'debugger' rule is suppressed
python
# techdebt-ignore-next-line print-statementprint("debug output")  # will not be reported

Block — suppresses all lines between start and end:

typescript
// techdebt-ignore-start ts-ignoreissues.push(...this.checkPattern(filePath, content, /@ts-ignore/g, { ... }));// techdebt-ignore-end ts-ignore

Without a rule name, all rules are suppressed. Blocks can be nested. Suppression comments must appear on their own line.

Example Custom Rules

Scope note: customPatterns defined in .techdebtrc.json are applied only by analyze_project, which loads the project config before scanning. analyze_file invokes the language analyzer directly without loading .techdebtrc.json, so config-defined patterns are not applied on that path. Use add_custom_rule at runtime (or call execute_custom_rules directly) to run custom patterns against a single file.

Define patterns in .techdebtrc.json under customPatterns, or register them at runtime via the add_custom_rule MCP tool:

json
{  "customPatterns": [    {      "id": "no-magic-numbers",      "pattern": "=\\s*\\d{3,}",      "severity": "medium",      "category": "maintainability",      "message": "Magic number detected",      "suggestion": "Extract to named constant"    },    {      "id": "forbidden-library",      "pattern": "import.*moment.*from",      "severity": "medium",      "category": "dependency",      "message": "moment.js is deprecated",      "suggestion": "Use native Date or date-fns instead",      "languages": ["javascript", "typescript"]    }  ]}

SQALE Metrics

Tech Debt MCP uses SQALE methodology to quantify technical debt:

RatingDebt RatioQuality
A≤5%Excellent
B6-10%Good
C11-20%Fair
D21-50%Poor
E>50%Critical

Effort-to-time mapping: trivial (≤5m) · small (5-30m) · medium (30m-2h) · large (2-4h) · xlarge (4h+)

SwiftUI Analysis

14 specialized checks for SwiftUI apps covering state management (excessive @State, @ObservedObject misuse, environment value safety), memory & lifecycle (Combine retain cycles, timer cleanup, task cancellation, closure retain cycles), performance (missing .id() modifiers, expensive body calculations, deep nesting, GeometryReader misuse), and best practices (AnyView type erasure, deprecated NavigationLink, main thread safety).

View all SwiftUI checks with examples

State Management Issues

  • Excessive @State Variables - Detects views with >5 @State variables that should use a ViewModel
  • @ObservedObject Misuse - Flags @ObservedObject with initialization (should use @StateObject)
  • Environment Value Safety - Detects force unwrapping of @Environment values

Memory & Lifecycle

  • Combine Circular References - Finds missing [weak self] in Combine sinks
  • Missing Timer Cleanup - Detects Timers without cleanup in onDisappear
  • Missing Task Cancellation - Flags async Tasks without cancellation handling
  • Retain Cycles in Closures - Detects self captures in onChange/onReceive without [weak self]

Performance & View Hierarchy

  • Missing .id() Modifiers - Detects ForEach without stable identifiers
  • Expensive View Body Calculations - Flags reduce/sort/filter in view bodies
  • Deep View Nesting - Warns when nesting depth exceeds 6 levels
  • GeometryReader Misuse - Detects GeometryReader at view root

SwiftUI Best Practices

  • AnyView Type Erasure - Suggests using generics or @ViewBuilder instead
  • Deprecated NavigationLink - Flags old-style NavigationLink patterns
  • Main Thread Safety - Ensures UI updates happen on main thread

Example Issues Detected

swift
// Excessive @State - should use ViewModelstruct UserView: View {  @State private var firstName = ""  @State private var lastName = ""  @State private var email = ""  @State private var phone = ""  @State private var address = ""  @State private var city = ""  // 6+ @State variables!}
// @ObservedObject with initializationstruct ContentView: View {  @ObservedObject var viewModel = UserViewModel()  // Should be @StateObject!}
// Missing Timer cleanupstruct TimerView: View {  var body: some View {    Text("Hello")      .onAppear {        Timer.scheduledTimer(...)  // Missing .onDisappear cleanup!      }  }}
// Retain cycle in Combinepublisher  .sink { value in    self.updateUI(value)  // Missing [weak self]!  }

Example Output

# Tech Debt Analysis Report
## Health Score: 72/100
### Issues by Severity| Severity | Count ||----------|-------|| Critical | 2 || High | 15 || Medium | 45 || Low | 120 |
## Top Recommendations
1. **Address Critical Issues Immediately**   Fix 2 critical security issues.
2. **Clean Up TODO/FIXME Comments**   Found 45 TODO comments - consider creating tracked issues.

Code Quality

Tech Debt MCP practices what it preaches — built with AI-assisted vibe coding, it maintains an A rating by regularly scanning itself. Internal refactors (e.g., nesting reduction in customRulesEngine.validatePattern via extracted helper — #146) are driven by self-scan findings.

Self-Scan Results (v2.0.2, April 2026)

  • SQALE Rating: A (Excellent)
  • Debt Score: 5/100 (Target: ≤5/100)
  • Total Issues: 13 (0 critical, 0 high, 6 medium, 7 low)
  • Remediation Time: 14 hours
  • Health Score: 95/100

Down from 118 issues / 42.4 health in the v2.0.1 baseline after the v2.0.2 security hardening, ruleExclusions config, nesting refactors (#113, #118, #131, #146), and custom-rules handler extraction (#145). Remaining debt: 5 nesting hotspots (4 in server / core modules + 1 in eslint.config.mjs), 7 type-assertion usages at system boundaries, and 1 non-null assertion. See TECH_DEBT_SCAN.md for per-issue detail.

Development

bash
npm install --include=dev --ignore-scripts  # Install dependencies (incl. devDependencies)npm run typecheck  # Type-check without emitting outputnpm run lint       # Lint source filesnpm run build      # Compile TypeScriptnpm run dev        # Run with ts-nodenpm run watch      # Watch modenpm test           # Run tests

Documentation

Privacy

Tech Debt MCP runs entirely on your machine. Once installed, it reads files you pass it, returns issues to your MCP client over the local stdio transport, and does nothing else — the server itself makes no outbound network calls, has no telemetry, no analytics, and uses no third-party services. Installation via npm/npx does contact the npm registry as standard package-manager behavior; the MCPB bundle ships pre-installed and needs no further network access. See PRIVACY.md or the hosted policy at https://pierrejanineh.github.io/TechDebtMCP/privacy for details.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines and CODE_OF_CONDUCT.md for our community standards.

Releases

  • Latest: [npm version]
  • Releases: GitHub Releases
  • Roadmap: See ROADMAP.md for planned features
  • Security: escapeRegExp() (src/utils/regexUtils.ts) must be used when interpolating captured strings into new RegExp() — see issue #128; handler output uses basename() / getRelativePath() to prevent absolute filesystem path leakage in intentional messages, and raw err.message strings from filesystem operations are sanitized before being returned to clients — see issue #129

License

MIT

來源:README.md,提交 33a9669

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v2.1.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Tech 整合