Skip to main content
Glama
mettamatt

Code Reasoning MCP Server

Code Reasoning MCP-Server

Ein Model Context Protocol (MCP)-Server, der Claudes Fähigkeit verbessert, komplexe Programmieraufgaben durch strukturiertes, schrittweises Denken zu lösen.

npm-Version Lizenz: MIT CI

Schnelle Installation

  1. Konfigurieren Sie Claude Desktop durch Bearbeiten von:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

    • Windows: %APPDATA%\Claude\claude_desktop_config.json

    • Linux: ~/.config/Claude/claude_desktop_config.json

    {
      "mcpServers": {
        "code-reasoning": {
          "command": "npx",
          "args": ["-y", "@mettamatt/code-reasoning"]
        }
      }
    }
  2. VS Code konfigurieren:

{
  "mcp": {
    "servers": {
      "code-reasoning": {
        "command": "npx",
        "args": ["-y", "@mettamatt/code-reasoning"]
      }
    }
  }
}

Related MCP server: Sequential Thinking MCP Server

Verwendung

  1. Um dieses MCP auszulösen, hängen Sie Folgendes an Ihre Chat-Nachrichten an:

    Use sequential thinking to reason about this.
  2. Verwenden Sie sofort einsatzbereite Eingabeaufforderungen, die Code-Reasoning auslösen:

Eingabeaufforderungen zur Codebegründung

  • Klicken Sie im Chatfenster von Claude Desktop auf das Symbol „+“ oder geben Sie in Claude Code /help , um die spezifischen Befehle anzuzeigen.

  • Wählen Sie aus den verfügbaren Tools „Aus Code Reasoning hinzufügen“

  • Wählen Sie eine Eingabeaufforderungsvorlage und geben Sie die erforderlichen Informationen ein

  • Senden Sie das Formular, um die Eingabeaufforderung zu Ihrer Chat-Nachricht hinzuzufügen, und drücken Sie die Eingabetaste

Einzelheiten zur Verwendung der Eingabeaufforderungsvorlagen finden Sie im Eingabeaufforderungshandbuch .

Befehlszeilenoptionen

  • --debug : Detaillierte Protokollierung aktivieren

  • --help oder -h : Hilfeinformationen anzeigen

Hauptmerkmale

  • Programmierfokus : Optimiert für Codierungsaufgaben und Problemlösung

  • Strukturiertes Denken : Zerlegen Sie komplexe Probleme in überschaubare Schritte

  • Gedankenverzweigung : Erkunden Sie mehrere Lösungspfade parallel

  • Gedankenrevision : Verfeinern Sie frühere Überlegungen, wenn sich das Verständnis verbessert

  • Sicherheitsgrenzen : Stoppt automatisch nach 20 Denkschritten, um Schleifen zu vermeiden

  • Gebrauchsfertige Eingabeaufforderungen : Vordefinierte Vorlagen für gängige Entwicklungsaufgaben

Dokumentation

Ausführliche Dokumentation im Verzeichnis „docs“ verfügbar:

Projektstruktur

├── index.ts                  # Entry point
├── src/                      # Implementation source files
└── test/                     # Testing framework

Schnelle Auswertung

Der Code Reasoning MCP Server verfügt über ein Bewertungssystem, das Claudes Fähigkeit bewertet, den Code Reasoning-Eingabeaufforderungen zu folgen. Dieses System ermöglicht:

  • Testen verschiedener Eingabeaufforderungsvarianten anhand von Szenarioproblemen

  • Überprüfen der Einhaltung des Parameterformats

  • Bewertung der Lösungsqualität

Um das System zur sofortigen Auswertung zu verwenden, führen Sie Folgendes aus:

npm run eval

Schneller Vergleich und Entwicklung

Es wurde erheblicher Aufwand betrieben, die optimale Eingabeaufforderung für den Code Reasoning-Server zu entwickeln. Die aktuelle Implementierung verwendet die Eingabeaufforderung HYBRID_DESIGN, die aus unserem Evaluierungsprozess als Sieger hervorging.

Wir haben vier verschiedene Prompt-Designs verglichen:

Schnelles Design

Beschreibung

SEQUENTIELL

Das ursprüngliche Design der sequenziellen Denkaufforderung

STANDARD

Die zuvor im Server verwendete Basiseingabeaufforderung

CODE_REASONING_0_30

Eine experimentelle Variante mit Fokus auf codespezifischem Denken

HYBRID_DESIGN

Ein verfeinertes Design, das die besten Elemente anderer Ansätze vereint

Unsere Auswertung anhand von sieben verschiedenen Programmierszenarien zeigte, dass HYBRID_DESIGN andere Eingabeaufforderungen übertraf:

Szenario

HYBRID_DESIGN

CODE_REASONING_0_30

STANDARD

SEQUENTIELL

Algorithmusauswahl

87 %

82 %

88 %

82 %

Fehleridentifizierung

87 %

91 %

88 %

92 %

Mehrstufige Implementierung

83 %

67 %

79 %

82 %

Systemdesignanalyse

82 %

87 %

78 %

82 %

Code-Debugging-Aufgabe

92 %

87 %

92 %

92 %

Compileroptimierung

83 %

78 %

67 %

73 %

Cache-Strategie

86 %

88 %

82 %

87 %

Durchschnitt

86 %

83 %

82 %

84 %

Der HYBRID_DESIGN-Prompt zeigte sowohl die höchste durchschnittliche Lösungsqualität (86 %) als auch die konstanteste Leistung über alle Szenarien hinweg, wobei keines der Ergebnisse unter 80 % lag. Er erzeugte auch die meisten Gedanken. Die Datei src/server.ts wurde aktualisiert, um dieses optimale Prompt-Design zu verwenden.

Persönlich denke ich, dass die größte Verbesserung darin bestand, Folgendes am Ende der Eingabeaufforderung hinzuzufügen: „✍️ Beenden Sie jeden Gedanken mit der Frage: „Was übersehe ich oder muss ich noch einmal überdenken?“

Weitere Einzelheiten zum System zur prompten Bewertung finden Sie im Test-Framework .

Lizenz

Dieses Projekt ist unter der MIT-Lizenz lizenziert. Weitere Informationen finden Sie in der Datei LICENSE.

Available Tools

1 tool
code-reasoningA

🧠 Code Reasoning Tool (using sequential thinking)

Purpose → break complex problems into self-auditing, exploratory thought steps that can branch, revise, or back-track until a single, well-supported answer emerges.


WHEN TO CALL

• Multi-step planning, design, debugging, or open-ended analysis
• Whenever further private reasoning or hypothesis testing is required before replying to the user


ENCOURAGED PRACTICES

🔍 Question aggressively – ask "What am I missing?" after each step
🔄 Revise freely – mark is_revision=true even late in the chain
🌿 Branch often – explore plausible alternatives in parallel; you can merge or discard branches later
↩️ Back-track – if a path looks wrong, start a new branch from an earlier thought
❓ Admit uncertainty – explicitly note unknowns and schedule extra thoughts to resolve them


MUST DO

✅ Put every private reasoning step in thought
✅ Keep thought_number correct; update total_thoughts when scope changes
✅ Use is_revision & branch_from_thought/branch_id precisely
✅ Set next_thought_needed=false only when all open questions are resolved
✅ Abort and summarise if thought_number > 20


DO NOT

⛔️ Reveal the content of thought to the end-user
⛔️ Continue thinking once next_thought_needed=false
⛔️ Assume thoughts must proceed strictly linearly – branching is first-class


PARAMETER CHEAT-SHEET

• thought (string) – current reasoning step
• next_thought_needed (boolean) – request further thinking?
• thought_number (int ≥ 1) – 1-based counter
• total_thoughts (int ≥ 1) – mutable estimate
• is_revision, revises_thought (int) – mark corrections
• branch_from_thought, branch_id – manage alternative paths
• needs_more_thoughts (boolean) – optional hint that more thoughts may follow

All JSON keys must use lower_snake_case.


EXAMPLE ✔️

{
  "thought": "List solution candidates and pick the most promising",
  "thought_number": 1,
  "total_thoughts": 4,
  "next_thought_needed": true
}

EXAMPLE ✔️ (branching late)

{
  "thought": "Alternative approach: treat it as a graph-search problem",
  "thought_number": 6,
  "total_thoughts": 8,
  "branch_from_thought": 3,
  "branch_id": "B1",
  "next_thought_needed": true
}
ParametersJSON Schema
NameRequiredDescriptionDefault
branch_from_thoughtNoBranching point thought number
branch_idNoIdentifier for the current branch
is_revisionNoWhether this is a revision of a previous thought
needs_more_thoughtsNoOptional hint that more thoughts may follow
next_thought_neededYesWhether another thought step is needed
revises_thoughtNoWhich thought is being revised
thoughtYesYour current reasoning step
thought_numberYesCurrent thought number (1-based)
total_thoughtsYesEstimated total thoughts needed (can be adjusted)

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure and excels at this. It provides extensive behavioral guidance including 'ENCOURAGED PRACTICES' (questioning, revising, branching, backtracking, admitting uncertainty), 'MUST DO' rules (put every step in thought, keep counters correct, use branching/revision flags precisely, set next_thought_needed=false only when resolved, abort after 20 thoughts), and 'DO NOT' prohibitions (don't reveal thoughts to user, don't continue after next_thought_needed=false, don't assume linear thinking). This comprehensively describes how the tool should be used.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (Purpose, WHEN TO CALL, ENCOURAGED PRACTICES, MUST DO, DO NOT, PARAMETER CHEAT-SHEET, EXAMPLES) that make it easy to navigate. While comprehensive, it maintains focus with each section serving a clear purpose. Some sections could be slightly more concise, but overall the structure enhances readability and information retrieval.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (9 parameters, no annotations, no output schema), the description provides exceptional contextual completeness. It covers purpose, usage guidelines, behavioral patterns, parameter semantics, and practical examples. The description fully compensates for the lack of annotations and output schema by providing comprehensive guidance on how to use this complex reasoning tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds significant value through the 'PARAMETER CHEAT-SHEET' section that provides practical guidance on parameter usage beyond the schema's basic descriptions. It explains the relationships between parameters (e.g., how is_revision and revises_thought work together, how branching parameters relate) and includes important implementation notes like 'All JSON keys must use lower_snake_case.' The examples further illustrate parameter usage in context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as 'break complex problems into self-auditing, exploratory thought steps that can branch, revise, or back-track until a single, well-supported answer emerges.' This is specific (verb+resource+methodology) and distinguishes it from any potential alternatives. The 'Purpose →' section provides a concise, accurate summary of what the tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'WHEN TO CALL' section explicitly lists scenarios for using this tool: 'Multi-step planning, design, debugging, or open-ended analysis' and 'Whenever further private reasoning or hypothesis testing is required before replying to the user.' It provides clear guidance on when this tool should be invoked versus when to respond directly to the user.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 1 tool updatev1.0.0
    • First observedcode-reasoning

TDQS

A4.4/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no possibility of confusion or overlap between tools. The single tool has a clearly defined purpose for code reasoning and problem-solving, so agents cannot misselect between multiple options.

Naming Consistency5/5

Since there is only one tool named 'code-reasoning', naming consistency is inherently perfect. There are no other tools to compare against, so no inconsistencies can exist in the tool set.

Tool Count2/5

A single tool for a 'Code Reasoning MCP Server' feels too minimal for the apparent scope. While the tool is feature-rich internally, the server's purpose suggests it should offer multiple specialized reasoning tools (e.g., for debugging, design, analysis) rather than one monolithic tool, making the count inappropriate.

Completeness2/5

The server claims to handle 'code reasoning' but provides only one general-purpose tool. This creates significant gaps: there are no specialized tools for different reasoning tasks (e.g., debugging vs. design), no tools for input/output handling, and no way to manage reasoning sessions independently, leading to potential agent failures in complex workflows.

Maintenance

ActivityInactive
ResponsivenessUnresponsive

Related MCP Connectors

Related MCP Servers