Model Context Protocol (MCP) · v2.x Ready

The AI Systems Engineering Harness for Claude & Cursor

Stop blaming the model when agents break in staging. Equip Claude Desktop with deterministic tool architecture audits, real BPE token accounting, and vetted Layer 1–7 production blueprints.

Video Walkthrough & Testing Guide · 2:51 Masterclass

How to Install & Test the Agent Junky MCP Server in Claude Desktop

1080p Full HD · H.264 · 48 kHz Stereo
0:00 / 2:51
Chapter Navigation (Click to Jump): Parts 1 to 3 Breakdown
✕

Vanilla Claude Blindspot

LLMs cannot count their own tokens or check for whitespace waste. They hallucinate argument combinations on tools with >6 flat parameters.

⚡

The Agent Junky Harness

Your local Python MCP server executes real mathematical tokenizers (`tiktoken`), AST static schema analysis, and grounded positive-constraint rewriting.

✓

Deterministic Reliability

Eliminates prompt drift, loop traps, and unexpected production bills. Seamlessly links Claude directly to tested 7-Layer blueprints.

Fast Track Installation

Get Connected in 30 Seconds

Local stdio & Remote SSE Live
Zero-Friction Terminal Auto-Installer Auto-Detects Claude & Cursor

Run this single command in your terminal. It automatically detects your Claude Desktop and Cursor configuration, creates a timestamped safety backup, and injects the 4 deterministic tools with zero manual JSON editing.

Windows (PowerShell)
irm https://agentjunky.com/install.ps1 | iex
macOS & Linux (Terminal)
curl -fsSL https://agentjunky.com/install.sh | bash
3

Restart Claude Desktop & Test Your First Tool

Reopen Claude Desktop. Look under Settings → Connectors (you will see agentjunky ✓). Paste this prompt:

"Use the agentjunky tool retrieve_system_blueprint to fetch the LangGraph multi-agent supervisor blueprint."
Capabilities

What The 4 Tools Actually Do

Every tool is designed around the 7 Layers of AI Systems Engineering to solve specific architectural bottlenecks.

Layer 1 & 2 · Tool Reliability audit_tool_architecture

Automated Tool Schema Audit

Scans agent function signatures and OpenAPI schemas. Detects flat parameter bloat (>6 args), ambiguous labels (data, query), missing enums, and absent error-recovery payloads. Computes a 0–100 reliability score.

Example Prompt:

"Use agentjunky audit_tool_architecture to audit this function: def fetch_user_records(data: str, query: str, mode: str, filter_by: str = None)"

Layer 2 · Prompt Boundaries check_prompt_boundaries

Prompt Boundary & Negative Constraint Check

Identifies ungrounded "Never do X" rules that induce attention bias. Inspects JSON/XML schema bounding, persona drift resilience, and automatically synthesizes a production-hardened prompt rewrite.

Example Prompt:

"Use agentjunky check_prompt_boundaries on this prompt: 'You are a customer service bot. Never say sorry. Do not offer refunds. Avoid guessing.'"

Layers 3, 4, 5, 7 · Blueprints retrieve_system_blueprint

7-Layer Production Blueprint Vault

Instantly retrieves battle-tested, copy-pasteable architectural code: LangGraph Multi-Agent Supervisors with loop guards, SQLite memory checkpoint harnesses, Hybrid RAG with RRF, and deterministic eval suites.

Example Prompt:

"Use the agentjunky tool retrieve_system_blueprint to fetch the LangGraph multi-agent supervisor blueprint."

Layer 6 · Context Economics benchmark_context_bloat

Token & Signal-to-Noise Benchmarker

Runs mathematical BPE token calculation via tiktoken. Computes exact dollar cost per call and at 10k scale across Claude 3.7 Sonnet, GPT-4o, and Gemini 2.0 Flash. Identifies syntax whitespace bloat.

Example Prompt:

"Benchmark this payload using agentjunky benchmark_context_bloat for Claude 3.7 Sonnet: {'users': [{'id': 1}], 'system': 'agentjunky'}"

Production Reference Blueprints

Hardened Schema Envelopes & Patterns

Stop relying on probabilistic model goodwill. Use these copy-pasteable deterministic envelopes to enforce autonomous LLM error recovery across Claude, Cursor, and LangGraph.

The Self-Healing Tool Return Envelope

Guarantees that tool exceptions guide the agent back on track rather than causing cascading failure loops.

{
  "name": "execute_database_mutation",
  "description": "Mutates user or billing records with strict parameter validation and self-healing error envelope.",
  "parameters": {
    "type": "object",
    "properties": {
      "target_id": {
        "type": "string",
        "description": "UUID of the targeted record"
      },
      "action": {
        "type": "string",
        "enum": ["create", "update", "archive", "suspend"],
        "description": "Strictly validated operation type"
      },
      "payload": {
        "type": "object",
        "description": "Encapsulated operational attributes (prevents flat parameter explosion)",
        "properties": {
          "status": { "type": "string" },
          "metadata": { "type": "object" }
        }
      }
    },
    "required": ["target_id", "action"]
  },
  "returns": {
    "type": "object",
    "properties": {
      "success": {
        "type": "boolean",
        "description": "True if operation executed without runtime failure"
      },
      "result": {
        "type": "object",
        "description": "Structured operation output or state delta"
      },
      "recovery_hint": {
        "type": "string",
        "description": "Deterministic instruction guiding autonomous LLM self-correction if success is false"
      }
    },
    "required": ["success", "result"]
  }
}
Layer 2 Defense

Negative Constraint Fixation ("Pink Elephant" Trap)

Why telling an LLM "Never do X" causes hallucinations, and how positive fallback routing eliminates drift.

Probabilistic Trap: Raw Negative Instructions
"You are a customer support agent.
Never offer refunds.
Do not apologize.
Avoid mentioning competitor pricing."

Why it fails: Transformer attention mechanisms increase semantic activation on negated tokens ("refunds", "apologize"). Under adversarial user pressure or multi-turn context drift, the model fixates on the negative rule and violates it.

Deterministic Solution: Positive Fallback Routing
"You are a tier-1 customer support agent.
When a user asks for a refund or competitor comparison:
1. Acknowledge inquiry politely.
2. Route inquiry to: 'support-escalations@company.com'
3. Execute standard tool: escalate_ticket(reason='billing')"

Why it succeeds: Provides an explicit, executable affirmative pathway with zero ambiguity. The model has an immediate destination state instead of trying to suppress a concept.

Want To Learn the Architecture Behind These Tools?

Read our in-depth engineering breakdowns on the 7 Layers of AI Systems Engineering and why multi-agent systems require deterministic harnesses.

Newsletter Edition #1

Subscribe to The AgentJunky AI Brief

Get practical thinking on agentic AI, enterprise architecture, RAG, and production governance delivered straight to your LinkedIn feed.

Subscribe on LinkedIn ↗

Discuss an AI Opportunity

Need an architectural review, help transitioning an agent prototype to production, or designing governed tool gateways? Let's connect.