Install
$ agentstack add mcp-justvugg-agentmw ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
agentmw
Open-source middleware that catches mid-run failures, compresses stale context, and grows a private reasoning library across every agent run. Works with any model, any framework. Apache-2.0.
pip install -e '.[all]'
agentmw demo
What it does
| Layer | What it does | Default | |---|---|---| | LLM monitor | One call to your provider (Ollama / OpenAI / Anthropic / OpenRouter) classifies the latest turns for loop, redundant_tool_call, contradiction, abandonment, hallucination. | primary | | Heuristic monitor | Deterministic regex checks (same categories, conservative). Runs as prefilter and as fallback when the LLM is unreachable. | fallback | | Compression | Truncates stale tool_result blocks while keeping the most recent intact. | on | | Reasoning library | SQLite-backed memory of patterns from past runs. Semantic recall via fastembed (BGE-small ONNX, 30 MB, local). Keyword fallback if embeddings unavailable. | on | | Time-travel CLI | Walks a saved trace, names the point of no return, quantifies wasted tokens, and (with --counterfactual) asks the provider to simulate the divergent branch. | — | | Auto-record + auto-extract | Every wrapped session is saved to disk; on completion, a background extractor distills 1–3 reusable patterns and adds them to the reasoning library. The loop closes itself. | on | | Circuit breaker | Provider calls are short-circuited after 3 failures in 30s, cooldown 60s. Inner client is never slowed by a sick monitor. | on | | Telemetry | Counters persisted to ~/.agentmw/telemetry.json, flushed each call and at process exit. Inspect with agentmw stats. | on | | Async support | wrap_async() for AsyncAnthropic / AsyncOpenAI clients. | — |
Nothing is hardcoded. All knobs live in AgentmwConfig and resolve `defaults --counterfactual # full replay + ghost branch agentmw extract # mine reusable patterns from a session agentmw stats # telemetry counters agentmw serve # MCP server (stdio)
Provider flags (work on `timeline`, `replay`, `config show`):
```bash
--provider {auto,ollama,openai,anthropic,openrouter,none}
--model
--no-llm # heuristics only
Config
~/.agentmw/config.toml (any subset; env vars override):
[monitors]
loop_threshold = 3
[compression]
keep_recent = 2
[memory]
semantic_threshold = 0.55
embedding_model = "BAAI/bge-small-en-v1.5"
[provider]
name = "anthropic"
model = "claude-haiku-4-5-20251001"
api_key = "..." # or set AGENTMW_API_KEY
[pipeline]
use_llm = true
heuristics_prefilter = true
use_heuristics_fallback = true
Env vars: AGENTMW_PROVIDER, AGENTMW_MODEL, AGENTMW_API_KEY, AGENTMW_BASE_URL, AGENTMW_LOOP_THRESHOLD, AGENTMW_SEMANTIC_THRESHOLD, AGENTMW_USE_LLM, AGENTMW_DB_PATH, AGENTMW_HOME, …
Library usage
import anthropic
from agentmw import wrap
from agentmw.core.config import default_config
client = wrap(anthropic.Anthropic(), agentmw_config=default_config())
response = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=512,
messages=[{"role": "user", "content": "Find the auth bug."}],
)
trace = client.config.traces[-1]
print(trace.monitors.triggered)
print(trace.compression.ratio, trace.recalled_patterns)
# Async clients:
import anthropic
from agentmw import wrap_async
aclient = wrap_async(anthropic.AsyncAnthropic())
# await aclient.messages.create(...)
MCP
agentmw serve # stdio; add this to your Claude Desktop / Cursor mcp config
Tools exposed: agentmw_recall, agentmw_save, agentmw_check_trace, agentmw_stats.
License
Apache-2.0.
Source & license
This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: JustVugg
- Source: JustVugg/agentmw
- License: Apache-2.0
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.