npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@waldzellai/analogical-reasoning

v0.1.3

Published

MCP server for diagrammatic thinking and spatial representation

Downloads

16

Readme

Analogical Reasoning MCP Server

Motivation

Analogical thinking is a powerful cognitive tool that humans use to understand new concepts by relating them to familiar ones. While language models can use analogies, they often:

  1. Apply analogies inconsistently or abandon them partway through analysis
  2. Fail to explicitly map structural relationships between source and target domains
  3. Overextend analogies beyond their useful boundaries
  4. Miss opportunities to leverage analogical transfer for problem-solving
  5. Struggle to evaluate the quality and limitations of different analogies

The Analogical Reasoning Server addresses these limitations by providing a structured framework for constructing, mapping, and evaluating analogies. By externalizing analogical thinking, models can leverage this powerful cognitive tool more systematically and effectively.

Technical Specification

Tool Interface

interface DomainElement {
  id: string;
  name: string;
  type: "entity" | "attribute" | "relation" | "process";
  description: string;
}

interface AnalogicalMapping {
  sourceElement: string; // ID of source domain element
  targetElement: string; // ID of target domain element
  mappingStrength: number; // 0.0-1.0
  justification: string;
  limitations?: string[];
}

interface AnalogicalReasoningData {
  // Core analogy components
  sourceDoamin: {
    name: string;
    elements: DomainElement[];
  };
  targetDomain: {
    name: string;
    elements: DomainElement[];
  };
  mappings: AnalogicalMapping[];
  
  // Analogy metadata
  analogyId: string;
  purpose: "explanation" | "prediction" | "problem-solving" | "creative-generation";
  confidence: number; // 0.0-1.0
  iteration: number;
  
  // Evaluation
  strengths: string[];
  limitations: string[];
  inferences: Array<{
    statement: string;
    confidence: number;
    basedOnMappings: string[]; // IDs of mappings supporting this inference
  }>;
  
  // Next steps
  nextOperationNeeded: boolean;
  suggestedOperations?: Array<"add-mapping" | "revise-mapping" | "draw-inference" | "evaluate-limitation" | "try-new-source">;
}

Process Flow

sequenceDiagram
    participant Model
    participant AnServer as Analogical Reasoning Server
    participant State as Analogy State
    
    Model->>AnServer: Define source domain
    AnServer->>State: Store source domain structure
    AnServer-->>Model: Return analogy state
    
    Model->>AnServer: Define target domain
    AnServer->>State: Store target domain structure
    AnServer-->>Model: Return analogy state
    
    Model->>AnServer: Create structural mappings
    AnServer->>State: Store mappings between domains
    AnServer-->>Model: Return analogy state with visualization
    
    Model->>AnServer: Draw inferences
    AnServer->>State: Store inferences based on mappings
    AnServer-->>Model: Return updated analogy state
    
    Model->>AnServer: Evaluate limitations
    AnServer->>State: Update with analogy limitations
    AnServer-->>Model: Return final analogy state
    
    Model->>AnServer: Revise mappings (optional)
    AnServer->>State: Update mappings
    AnServer-->>Model: Return revised analogy state

Key Features

1. Explicit Domain Structuring

The server requires explicit structuring of both domains:

  • Entities: Objects or concepts in each domain
  • Attributes: Properties of those entities
  • Relations: How entities relate to each other
  • Processes: Dynamic interactions between entities

2. Structural Mapping

The server facilitates explicit mapping between domains:

  • Element-to-element: Which elements correspond to each other
  • Relation-to-relation: Preserving the structural relationships
  • Mapping strength: Rating how well each mapping works
  • Justification: Explanation for why the mapping is valid

3. Inference Generation

The server guides drawing inferences from the analogy:

  • Projection: Transferring knowledge from source to target
  • Prediction: Making predictions based on source domain patterns
  • Novel insights: Identifying new perspectives on the target domain

4. Analogy Evaluation

Each analogy is systematically evaluated:

  • Strengths: Where the analogy is particularly illuminating
  • Limitations: Where the analogy breaks down
  • Confidence: Overall assessment of analogy quality
  • Alternatives: Considering different source domains

5. Visual Representation

The server provides visualization of the analogical mapping:

  • Connection diagrams showing mappings between domains
  • Color-coding for mapping strength
  • Highlighting unmapped elements in both domains

Usage Examples

Complex Concept Explanation

When explaining complex technical concepts, the model can develop systematic analogies to more familiar domains, with explicit mappings and limitations.

Problem Solving by Analogy

For novel problems, the model can map them to familiar solved problems and transfer solution strategies.

Creative Ideation

When generating creative ideas, the model can systematically map concepts from distant domains to generate novel combinations.

Scientific Modeling

For scientific concepts, the model can evaluate the strengths and limitations of different analogical models.

Implementation

The server is implemented using TypeScript with:

  • A core AnalogicalReasoningServer class
  • Domain representation and visualization components
  • Mapping quality evaluation algorithms
  • Inference projection guidelines
  • Standard MCP server connection via stdin/stdout

This server enhances model capabilities in domains requiring creative problem-solving, explanation of complex concepts, and transfer of knowledge between different fields or contexts.