Skip to main content
Glama
README.md
# mcp-agent-monitor

**Make your AI agents reliable — one log at a time.**

A production-ready MCP (Model Context Protocol) server that analyzes AI agent execution logs, calculates reliability scores, detects failure patterns, and suggests concrete improvements.

Perfect for entrepreneurs and teams building AI agents who want to stop guessing why agents fail and start fixing them with data.

## Why this exists

AI agents fail silently. You see a wrong answer but you don't know:
- Which tool call broke?
- Is it a timeout, bad parameter, or cascading error?
- Is the agent getting better or worse over time?

This MCP server turns raw agent traces into clear reliability insights — 100% local computation, zero paid API calls.

## Features (Tools)

| Tool | What it does |
|------|--------------|
| `analyze_agent_trace` | Full analysis: score + patterns + suggestions |
| `score_reliability` | Quick 0-100 reliability score |
| `detect_failure_patterns` | Only the failure patterns |
| `compare_traces` | Before vs After comparison |
| `generate_reliability_report` | Beautiful Markdown report for humans |

## Quick Start

### 1. Install

```bash
npm install
npm run build
```

### 2. Run (stdio)

```bash
node dist/index.js
```

### 3. Add to your MCP client (Claude Desktop / Cursor / etc.)

```json
{
  "mcpServers": {
    "agent-monitor": {
      "command": "node",
      "args": ["/path/to/mcp-agent-monitor/dist/index.js"]
    }
  }
}
```

## Example Usage

Give the agent a log like this:

```json
{
  "agent_id": "sales-outreach-v2",
  "steps": [
    { "tool": "search_leads", "success": true, "duration_ms": 340 },
    { "tool": "send_email", "success": false, "error": "rate limit exceeded", "duration_ms": 1200 },
    { "tool": "send_email", "success": false, "error": "rate limit exceeded", "duration_ms": 1100 }
  ]
}
```

Call `analyze_agent_trace` → get score, pattern ("Repeated failure on tool send_email"), and suggestions.

## Project Structure

```
mcp-agent-monitor/
├── src/
│   └── index.ts          # Full MCP server + all tools
├── tests/
│   └── reliability.test.ts
├── mcpize.yaml           # MCP metadata
├── package.json
├── tsconfig.json
├── .env.example
├── LAUNCH.md
└── README.md
```

## Pricing Suggestion (for marketplace)

- Free tier: 50 analyses / month
- Pro: $19/mo unlimited + team sharing
- Enterprise: custom (SSO, private deployment)

## Author

Built by **Prince Ruhul** ([@princeruhulofficial](https://github.com/princeruhulofficial))  
Founder of [Prevalid](https://www.princeruhul.com) — Making AI Accountable at infrastructure level.

## License

MIT