Pisama MCP Server
Enables analysis of AI agent traces to detect and fix failures using heuristic detectors, with no LLM calls required.
README
Pisama
Find and fix failures in AI agent systems. No LLM calls required.
Pisama ships 32 core heuristic detectors plus framework-specific detectors for n8n, LangGraph, Dify, and OpenClaw. They run locally with zero LLM cost on the heuristic tier. An archived run on the TRAIL benchmark reports 59.9% joint accuracy (span and category), compared with 11.9% for the best general-purpose LLM judge tested. The public confusion counts reproduce the reported macro-F1 and micro-F1. See the benchmark evidence and its reproducibility boundary.
Install
pip install pisama
Usage
from pisama import analyze
result = analyze("trace.json") # also accepts dicts and JSON strings
for issue in result.issues:
print(f"[{issue.type}] {issue.summary} (severity: {issue.severity})")
print(f" Fix: {issue.recommendation}")
CLI
pisama analyze trace.json # Analyze a trace
pisama watch python my_agent.py # Watch a live agent (pip install pisama[auto])
pisama replay <trace-id> # Re-run detection on stored traces
pisama smoke-test --last 50 # Batch test recent traces
pisama detectors # List all 32 core detectors
pisama mcp-server # Start MCP server (pip install pisama[mcp])
MCP Server
Works in Cursor, Claude Desktop, and Windsurf. No API key is needed:
{
"mcpServers": {
"pisama": { "command": "pisama", "args": ["mcp-server"] }
}
}
Detectors
32 core detectors plus framework-specific detectors for n8n, LangGraph, Dify, and OpenClaw. A representative selection:
| Detector | What It Catches |
|---|---|
loop |
Infinite loops, retry storms, stuck patterns |
coordination |
Deadlocked handoffs, message storms |
hallucination |
Factual errors, fabricated tool results |
injection |
Prompt injection, jailbreak attempts |
corruption |
State corruption, type drift |
persona_drift |
Persona drift, role confusion |
derailment |
Task deviation, goal drift |
context |
Context neglect, ignored instructions |
specification |
Output vs. requirement mismatch |
communication |
Inter-agent message breakdown |
decomposition |
Poor task breakdown, circular dependencies |
workflow |
Unreachable nodes, missing error handling |
completion |
Premature completion, unfinished work |
withholding |
Suppressed findings, hidden errors |
convergence |
Metric plateau, regression, thrashing |
overflow |
Context window exhaustion |
delegation |
Delegation quality and task handoff failures |
grounding |
Claims not supported by source documents |
retrieval_quality |
Poor retrieval relevance or coverage |
compaction_quality |
Information loss during context compaction |
Benchmark Results
TRAIL (trace-level failure detection, 148 traces):
| Method | Joint Accuracy |
|---|---|
| GPT-5.4 | 11.9% |
| Gemini 3.1 Pro | 6.8% |
| Pisama archived run | 59.9% |
Who&When (ICML 2025, multi-agent attribution, 58 hand-crafted cases):
| Method | Agent Accuracy | Step Accuracy |
|---|---|---|
| GPT-5.4 Mini | 60.3% | 22.4% |
| Pisama + Sonnet 4 | 60.3% | 24.1% |
Links
License
MIT
Source boundary
This repository is the public source for the MIT-licensed pisama Python
package. It does not contain the Pisama Cloud backend, dashboard, calibration
data, managed detection tiers, or paid automation.
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.