Agent Reflexion
FreeNot checkedAgent self-improvement and reflection MCP server — decision logging, pattern analysis, performance tracking
About
Agent self-improvement and reflection MCP server — decision logging, pattern analysis, performance tracking
README
MCP server for agent self-improvement and reflection. Agents call this server to log decisions and outcomes, analyze performance patterns, get actionable improvement suggestions, track metrics, set goals, and build a continuous learning loop.
Installation
npx agent-reflexion-mcp
Or install globally:
npm install -g agent-reflexion-mcp
Claude Desktop / Cline / Cursor
Add to your MCP settings:
{
"mcpServers": {
"agent-reflexion": {
"command": "npx",
"args": ["agent-reflexion-mcp"],
"env": {
"REFLEXION_DATA_DIR": "/path/to/data"
}
}
}
}
Smithery
npx @smithery/cli install agent-reflexion-mcp
Configuration
| Environment Variable | Default | Description |
|---|---|---|
REFLEXION_DATA_DIR |
~/.agent-reflexion/ |
Directory for JSON file persistence |
Tools
log_decision
Record a decision with context, reasoning, and expected outcome.
Input:
agent_id(string) — Unique identifier for the agenttask_type(string) — Category of task (e.g. "code_review", "research", "deployment")decision(string) — What was decidedreasoning(string) — Why this decision was madeexpected_outcome(string) — What the agent expects to happenconfidence(number 0-1) — Agent confidence in this decisiontags(string[], optional) — Tags for categorization
Output: { decision_id, timestamp }
log_outcome
Record the actual outcome of a previous decision.
Input:
decision_id(string) — ID fromlog_decisionactual_outcome(string) — What actually happenedstatus("success" | "failure" | "partial") — Outcome statusquality_score(number 0-10, optional) — Quality ratinglessons_learned(string, optional) — What was learned
Output: Updated decision record
analyze_patterns
Analyze decision patterns over time with statistical analysis.
Input:
agent_id(string) — Agent to analyzetask_type(string, optional) — Filter by task typetime_range_days(number, default 30) — How far back to lookmin_samples(number, default 5) — Minimum data points required
Output:
success_rate— Overall success ratefailure_modes— Ranked list of failure categories with examplesconfidence_calibration— Average confidence vs actual success rate, overconfident/underconfident flagstrend— First-half vs second-half success rate comparisonimproving_areas/declining_areas— Task types trending up or down
get_suggestions
Get specific, actionable improvement suggestions based on historical patterns.
Input:
agent_id(string) — Agent to advisetask_type(string) — Task type to focus oncurrent_context(string, optional) — Current situation for context
Output: Array of suggestions, each with:
suggestion— Specific actionable advicebased_on— What analysis produced this (confidence_calibration, failure_pattern_analysis, historical_lessons, cross_task_comparison, etc.)confidence— How confident the suggestion isevidence_count— How many data points support it
Example suggestion: "Your average confidence for 'code_review' tasks is 90% but actual success rate is 60%. Consider more conservative estimates and additional verification steps."
track_metric
Track a named metric over time with automatic trend detection.
Input:
agent_id(string) — Agent tracking this metricmetric_name(string) — Metric name (e.g. "accuracy", "response_time_ms")value(number) — Current valuecontext(string, optional) — Context for this data point
Output: { metric_id, trend ("up"/"down"/"stable"), rolling_average, data_points }
get_performance_report
Generate a comprehensive performance summary.
Input:
agent_id(string) — Agent to report ontime_range_days(number, default 7) — Report period
Output:
total_decisions,success_ratetop_failure_modes— Ranked failure categoriesimprovement_trend— "improving", "declining", "stable", or "insufficient_data"metrics_summary— All tracked metrics with trendsgoals_progress— Active goals with progress
set_goal
Set an improvement goal for a specific metric.
Input:
agent_id(string) — Agent setting the goalgoal_name(string) — Human-readable goal namemetric_name(string) — Metric to track (must matchtrack_metriccalls)target_value(number) — Target to reachdeadline_days(number) — Days to achieve
Output: { goal_id, baseline_value, required_improvement }
check_goals
Check progress against active improvement goals.
Input:
agent_id(string) — Agent to check
Output: Array of goals with:
goal_name,target,current,progress_percenton_track— Whether pace is sufficient to meet deadlinedays_remaining,status
Goals auto-complete when the target is reached.
How It Works
- Log decisions before executing them — capture your reasoning and confidence
- Log outcomes after execution — record what actually happened
- Analyze patterns periodically — find failure modes and calibration issues
- Get suggestions before similar tasks — learn from your history
- Track metrics continuously — monitor trends in key performance indicators
- Set goals for improvement — create accountability with deadlines
- Check goals regularly — stay on track
Data Persistence
All data is stored as JSON files in REFLEXION_DATA_DIR:
decisions.json— Decision and outcome recordsmetrics.json— Metric time seriesgoals.json— Improvement goals
Data loads from disk on startup and saves after every write operation.
Development
npm test # Run tests
npm run dev # Watch mode
npm start # Start server
License
MIT
Installing Agent Reflexion
This server has no published package — it is built from source. Open the repository and follow its README.
▸ github.com/mdfifty50-boop/agent-reflexion-mcpFAQ
Is Agent Reflexion MCP free?
Yes, Agent Reflexion MCP is free — one-click install via Unyly at no cost.
Does Agent Reflexion need an API key?
No, Agent Reflexion runs without API keys or environment variables.
Is Agent Reflexion hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Agent Reflexion in Claude Desktop, Claude Code or Cursor?
Open Agent Reflexion on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
Fetch
Web content fetching and conversion for efficient LLM usage.
AWS KB Retrieval
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
by modelcontextprotocolSpring AI MCP Server
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
llm-analysis-assistant
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
by xuzexin-hzCompare Agent Reflexion with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All ai MCPs
