MCP Hub
Back to servers

PromptSmith

An MCP server that provides 'Reasoning as a Service' by analyzing tasks to select and generate meta-prompts from 40 distinct reasoning frameworks. It enables AI agents to optimize their execution strategy based on task complexity and category, featuring tools for strategy recommendation and performance tracking.

Updated
Feb 22, 2026

PromptSmith

Reasoning as a Service - A Capability-Level 0 MCP Server that provides intelligent reasoning framework selection and meta-prompt generation for AI agents.

Purpose

PromptSmith analyzes tasks, determines their complexity and category, and generates optimized "meta-prompts" using the most appropriate reasoning framework.

Features

  • 🧠 40 Reasoning Frameworks: Chain of Thought, Tree of Thoughts, ReAct, Reflexion, Graph of Thoughts, Program of Thoughts, and more
  • 📊 Intelligent Task Analysis: Automatic category detection (code, math, logic, creative, research, data, planning) and complexity scoring (0–10)
  • 🎯 Framework Selection: Heuristic-based selection of the optimal reasoning strategy
  • 💾 Persistence: SQLite storage for reasoning traces and analytics
  • 📈 Usage Statistics: Track framework usage and effectiveness

Installation

git clone https://github.com/your-org/promptsmith
cd promptsmith
uv sync

MCP Tools

ToolDescription
recommend_strategyAnalyze a task and recommend the optimal reasoning framework
generate_meta_promptGenerate an optimized meta-prompt for a task
log_execution_feedbackRecord feedback about prompt effectiveness
list_available_frameworksList all available reasoning frameworks
get_usage_statsGet usage statistics and analytics

Usage

As MCP Server

Add to your MCP client configuration (e.g. .mcp.json in your project root):

{
  "mcpServers": {
    "promptsmith": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/promptsmith", "python", "-m", "promptsmith.main"],
      "env": {
        "PYTHONPATH": "/path/to/promptsmith/src",
        "UV_LINK_MODE": "copy",
        "FASTMCP_SHOW_STARTUP_BANNER": "false"
      }
    }
  }
}

Programmatic Usage

from promptsmith.domain import FrameworkSelector, PromptBuilder

# Analyze a task
selector = FrameworkSelector()
analysis = selector.analyze("Write a recursive function to calculate fibonacci numbers")

print(f"Category: {analysis.category}")               # code
print(f"Complexity: {analysis.complexity_score}")     # ~3.3
print(f"Framework: {analysis.recommended_framework}") # program_of_thoughts

# Generate a meta-prompt
builder = PromptBuilder()
result = builder.build(analysis.task, analysis=analysis)
print(result.meta_prompt)

Reasoning Frameworks

40 frameworks across 8 categories, selected automatically based on task type and complexity.

FrameworkBest ForComplexity Threshold
Role PromptingCreative, General, Research1.0
Emotion PromptingCreative, General1.0
Rephrase and RespondGeneral, Research2.0
Chain of ThoughtMath, Logic, Code2.0
System 2 AttentionLogic, Research, General3.0
Thread of ThoughtResearch, Data, General3.0
Tab-CoTData, Math, Logic3.0
Directional StimulusCreative, General3.0
Skeleton of ThoughtCreative, General, Planning3.0
Self-CalibrationMath, Logic, General3.0
Chain of DensityResearch, Data, General3.0
Prompt ParaphrasingGeneral, Logic3.0
Sim-to-MLogic, General4.0
Self-AskResearch, Logic, General4.0
Step BackResearch, Logic, General4.0
AnalogicalGeneral, Creative, Code4.0
Program of ThoughtsMath, Code, Data4.0
Plan and SolvePlanning, Code, Math4.0
Self-ConsistencyMath, Logic4.0
Self-RefineCreative, Code, General4.0
Chain of TableData4.0
Least to MostCode, Math, Planning5.0
Contrastive CoTMath, Logic, Code5.0
Active PromptingGeneral, Research, Logic5.0
Faithful CoTMath, Logic, Code5.0
Demonstration EnsemblingGeneral, Data, Logic5.0
MaieuticResearch, Logic, General5.0
Chain of VerificationResearch, General, Data5.0
Reverse CoTMath, Logic, Code5.0
Buffer of ThoughtsGeneral, Math, Code5.0
Complexity-BasedMath, Logic6.0
Tree of ThoughtsCreative, Planning, Research6.0
Mixture of ReasoningGeneral, Research, Logic6.0
Meta-CoTLogic, Math, Research6.0
Cumulative ReasoningLogic, Math, Research6.0
Recursion of ThoughtMath, Code, Logic7.0
ReActResearch, Code, Data7.0
ReflexionCode, Math, Logic8.0
Graph of ThoughtsPlanning, Research, Logic8.0
Reasoning via PlanningPlanning, Logic, Code8.0

Architecture

src/promptsmith/
├── main.py              # MCP Server entry point
├── domain/
│   ├── frameworks.py    # 40 reasoning framework implementations
│   ├── selector.py      # Task analysis and framework selection
│   └── builder.py       # Meta-prompt assembly
├── persistence/
│   ├── models.py        # SQLAlchemy/Pydantic models
│   └── storage.py       # SQLite operations
└── utils/
    └── complexity.py    # Text complexity analysis

Integration with Other Agents

PromptSmith is designed to be called by other MCP-enabled agents.

result = mcp_call("promptsmith", "generate_meta_prompt", {
    "task": user_query,
    "context": relevant_context,
})
enhanced_response = llm.generate(result["meta_prompt"])

License

MIT

Reviews

No reviews yet

Sign in to write a review