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.
README
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
| Tool | Description |
|---|---|
recommend_strategy |
Analyze a task and recommend the optimal reasoning framework |
generate_meta_prompt |
Generate an optimized meta-prompt for a task |
log_execution_feedback |
Record feedback about prompt effectiveness |
list_available_frameworks |
List all available reasoning frameworks |
get_usage_stats |
Get 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.
| Framework | Best For | Complexity Threshold |
|---|---|---|
| Role Prompting | Creative, General, Research | 1.0 |
| Emotion Prompting | Creative, General | 1.0 |
| Rephrase and Respond | General, Research | 2.0 |
| Chain of Thought | Math, Logic, Code | 2.0 |
| System 2 Attention | Logic, Research, General | 3.0 |
| Thread of Thought | Research, Data, General | 3.0 |
| Tab-CoT | Data, Math, Logic | 3.0 |
| Directional Stimulus | Creative, General | 3.0 |
| Skeleton of Thought | Creative, General, Planning | 3.0 |
| Self-Calibration | Math, Logic, General | 3.0 |
| Chain of Density | Research, Data, General | 3.0 |
| Prompt Paraphrasing | General, Logic | 3.0 |
| Sim-to-M | Logic, General | 4.0 |
| Self-Ask | Research, Logic, General | 4.0 |
| Step Back | Research, Logic, General | 4.0 |
| Analogical | General, Creative, Code | 4.0 |
| Program of Thoughts | Math, Code, Data | 4.0 |
| Plan and Solve | Planning, Code, Math | 4.0 |
| Self-Consistency | Math, Logic | 4.0 |
| Self-Refine | Creative, Code, General | 4.0 |
| Chain of Table | Data | 4.0 |
| Least to Most | Code, Math, Planning | 5.0 |
| Contrastive CoT | Math, Logic, Code | 5.0 |
| Active Prompting | General, Research, Logic | 5.0 |
| Faithful CoT | Math, Logic, Code | 5.0 |
| Demonstration Ensembling | General, Data, Logic | 5.0 |
| Maieutic | Research, Logic, General | 5.0 |
| Chain of Verification | Research, General, Data | 5.0 |
| Reverse CoT | Math, Logic, Code | 5.0 |
| Buffer of Thoughts | General, Math, Code | 5.0 |
| Complexity-Based | Math, Logic | 6.0 |
| Tree of Thoughts | Creative, Planning, Research | 6.0 |
| Mixture of Reasoning | General, Research, Logic | 6.0 |
| Meta-CoT | Logic, Math, Research | 6.0 |
| Cumulative Reasoning | Logic, Math, Research | 6.0 |
| Recursion of Thought | Math, Code, Logic | 7.0 |
| ReAct | Research, Code, Data | 7.0 |
| Reflexion | Code, Math, Logic | 8.0 |
| Graph of Thoughts | Planning, Research, Logic | 8.0 |
| Reasoning via Planning | Planning, Logic, Code | 8.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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.