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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。