unstuck-mcp
Prevents coding agents from repeatedly attempting the same failed fix by tracking attempts and blocking further fixes until the agent uses its own web search tool.
README
unstuck-mcp
Stops coding agents from looping on the same failed fix. Tracks failed attempts per-problem, and once the same error has been "fixed" a couple of times without success, it blocks further fixes until the agent actually uses its own web search tool — instead of guessing again from stale memory.
Works with GitHub Copilot CLI, OpenAI Codex CLI, and OpenCode, because
all three speak MCP, all three read AGENTS.md, and all three already ship a
web search tool of their own. This server doesn't duplicate that search — it
just gates on whether it happened.
How it works
- The agent calls
report_attempt(error_signature, fix_summary)after any failed fix. - The server normalizes the error text (strips line numbers, file paths, quoted values) and hashes it, so near-identical failures are recognized as "the same problem" even if the wording drifts slightly.
- On the 3rd attempt at the same normalized problem (configurable), the tool response tells the agent it's blocked: it must use its own web search tool before trying anything else.
- Once it has searched, the agent calls
confirm_search(error_signature, findings_summary). This clears the block and resets the attempt count for that problem, informed by what it just found. - If the agent tries another fix while still blocked (i.e. it skipped the
search),
report_attemptcalls it out explicitly instead of quietly logging it.
This is enforced through instructions, not a hard runtime block — MCP servers
can't intercept an agent's other tool calls the way an editor plugin can. It
works because the tool descriptions and the bundled AGENTS.md rule make
calling it the obvious, expected thing to do, the same pattern that made
docs-lookup MCP servers like Context7 stick. confirm_search closes the loop:
the agent can't just claim it's unblocked without a tool call that says so.
Install
cd unstuck-mcp
npm install
Then wire it into whichever CLI(s) you use:
GitHub Copilot CLI
copilot mcp add
# Command: node
# Args: /absolute/path/to/unstuck-mcp/index.js
or edit ~/.copilot/mcp-config.json directly:
{
"mcpServers": {
"unstuck": {
"command": "node",
"args": ["/absolute/path/to/unstuck-mcp/index.js"]
}
}
}
OpenAI Codex CLI
Add to your Codex config (~/.codex/config.toml):
[mcp_servers.unstuck]
command = "node"
args = ["/absolute/path/to/unstuck-mcp/index.js"]
OpenCode
Add to opencode.json (project or global):
{
"mcp": {
"unstuck": {
"type": "local",
"command": ["node", "/absolute/path/to/unstuck-mcp/index.js"],
"enabled": true
}
}
}
Enable the enforcement rule
Copy the contents of AGENTS.snippet.md into your project's AGENTS.md
(all three tools read this file). Without it, the agent still can call these
tools, but won't reliably choose to on its own.
Configuration
Environment variables (set them in the MCP server config's env block):
| Variable | Default | Purpose |
|---|---|---|
UNSTUCK_THRESHOLD |
2 |
How many failed attempts before blocking (3rd attempt = 1st time blocked) |
UNSTUCK_DIR |
<cwd>/.unstuck |
Where attempt history is stored |
Tools exposed
report_attempt(error_signature, fix_summary)— log a failed attempt, get back whether you're blockedconfirm_search(error_signature, findings_summary)— clear a block after actually searchingloop_status()— see everything currently tracked as stuck, for debuggingreset_loop(error_signature?, clear_all?)— clear history manually
Known limitation
This relies on the agent following its instructions honestly — calling
report_attempt after failures, and not calling confirm_search without
actually searching. It's not a hard sandbox-level block like an OpenCode
plugin hook could be. In exchange, it works identically across every
MCP-compatible agent instead of being locked to one tool's plugin architecture,
and it doesn't duplicate a search tool the agent already has.
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.