Skip to main content
Glama

Sentinel MCP

CI/CD License Python MCP

Production Incident Investigation & AI Software Engineering Evaluation Platform

Sentinel MCP is a distributed e-commerce backend and benchmarking platform designed to evaluate human software engineers and autonomous AI coding agents on realistic distributed system incidents using standard Model Context Protocol (MCP) diagnostic tools.


Architecture Overview

flowchart TB
    subgraph Clients
        Agent[AI Agent / Engineer]
        User[End User / Load Gen]
    end

    subgraph "MCP Engineering Gateway"
        MCP_Repo[Repository MCP]
        MCP_Logs[Logs MCP]
        MCP_Metrics[Metrics MCP]
        MCP_Traces[Traces MCP]
        MCP_DB[Database MCP]
        MCP_Deploy[Deployment MCP]
    end

    subgraph "Application Services"
        GW[API Gateway :8000]
        Orders[Order Service :8001]
        Inventory[Inventory Service :8002]
        Payment[Payment Service :8003]
        Notifications[Notification Worker :8004]
        OutboxWorker[Outbox Worker]
        IncidentCP[Incident Control Plane :8005]
    end

    subgraph "Infrastructure & Storage"
        DB[(PostgreSQL 16)]
        Redis[(Redis 7)]
        Kafka[(Redpanda / Kafka)]
        OTel[OpenTelemetry Collector]
        Prom[Prometheus]
        Grafana[Grafana]
    end

    Agent <-->|Official MCP Protocol| MCP_Repo & MCP_Logs & MCP_Metrics & MCP_Traces & MCP_DB & MCP_Deploy
    User --> GW
    GW --> Orders
    Orders --> Inventory
    Orders --> Payment
    Orders -->|Atomic Tx| DB
    Orders -->|Outbox Table| DB
    OutboxWorker -->|Poll SKIP LOCKED| DB
    OutboxWorker -->|Publish| Kafka
    Kafka --> Notifications
    IncidentCP -->|Fault Injection| Orders & Inventory & Payment & GW
    Orders & Inventory & Payment -.->|Metrics/Traces| OTel
    OTel --> Prom
    Prom --> Grafana

Related MCP server: AIOps MCP

Core Engineering Features

  1. Explicit Domain State Machine:

    • Order lifecycle strictly governed by legal transitions (PENDING -> INVENTORY_RESERVED -> PAYMENT_PENDING -> PAID -> PROCESSING -> COMPLETED).

    • Domain invariants encapsulated within aggregate methods, raising InvalidStateTransitionError on illegal mutations.

  2. Concurrency & Zero Oversell Guarantee:

    • Multi-item inventory reservations acquire row locks in deterministic sorted order (product_id) to eliminate database deadlocks.

    • High-concurrency verified: 50 concurrent checkouts competing for 10 units of inventory yield exactly 10 successes and 40 conflict rejections.

  3. Deterministic Payment Simulator & Idempotency:

    • Zero real card exposure; uses SHA-256 body fingerprinting to enforce distributed idempotency.

    • Supports configurable simulated faults: timeouts, bank declines, 502/500 gateway errors, and network jitter.

  4. Transactional Outbox & Exactly-Once Semantics:

    • Orders and events written atomically inside single database transactions.

    • Background OutboxWorker manages leases, retries with exponential backoff and jitter, and dead-letter queues (DLQ).

    • Event consumers utilize an atomic processed_events store to ensure at-least-once deliveries produce exactly-once business side effects.

  5. Observability Stack:

    • Structured JSON logging with W3C traceparent and correlation IDs.

    • OpenTelemetry distributed tracing across HTTP, Kafka, and database layers.

    • Prometheus metrics and pre-built Grafana dashboards (sentinel_overview.json, kafka_outbox_pipeline.json, incident_investigation.json).

  6. Model Context Protocol (MCP) Diagnostic Gateway:

    • Implements official MCP specification (mcp 1.26.0).

    • 6 tool categories: Repository, Logs, Metrics, Traces, Database, and Deployment.

    • Secure sandboxing: blocks path traversal (../), credentials, .env, golden.patch, and arbitrary shell execution.


Quickstart

1. Local Environment Setup

# Clone the repository
git clone https://github.com/sentinel-mcp/sentinel-mcp.git
cd sentinel-mcp

# Install dependencies
pip install -e ".[dev,db,kafka]"

# Run full test suite
pytest tests/ -v

2. Docker Compose Environment

# Start all microservices, Redpanda, PostgreSQL, Prometheus, Grafana
docker-compose up -d

# Inspect health endpoints
curl http://localhost:8000/health
curl http://localhost:8005/incidents

15 Reproducible Incident Scenarios

Incident

Category

Title & Root Cause

01_payment_timeout_regression

Performance

Deployment reduced payment timeout from 2.0s to 0.05s while provider takes 0.12s

02_db_connection_leak

Resource Leak

Async DB session in checkout audit path acquired without release; pool exhausted

03_n_plus_one_query

Database

Order listing query executes individual child queries in a loop

04_cache_stampede

Caching

Hot cache key expires without request coalescing or mutex lock

05_duplicate_kafka_event

Messaging

Consumer missing deduplication table executes duplicate notifications

06_poison_event

Messaging

Malformed message payload causes consumer crash loop without DLQ

07_retry_storm

Resilience

Gateway and services retry immediately without backoff/jitter

08_dead_worker

Worker

Worker claims outbox job and crashes before completion; missing lease expiry

09_db_deadlock

Concurrency

Concurrent reservations lock inventory items in opposite order

10_inventory_race

Concurrency

Unsynchronized stock check oversells inventory below zero

11_memory_leak

Resource Leak

Consumer appends all message payloads to unbounded global list

12_missing_db_index

Database

Orders query on (customer_id, created_at) lacks composite index

13_cache_invalidation_failure

Caching

Stock confirmation updates database but omits Redis cache eviction

14_event_schema_incompatibility

Messaging

Producer introduces breaking schema field renaming without backwards compatibility

15_deployment_config_regression

Deployment

Corrupted environment variable PAYMENT_SERVICE_URL injected in release


Deterministic Evaluation Engine

The evaluation platform assesses candidate solutions with zero LLM judge bias:

# Run deterministic evaluator for a scenario
python sentinel_eval.py --scenario 01_payment_timeout_regression --candidate my_agent

Scoring Matrix

Functional Correctness      45%
Hidden Tests & Invariants   20%
Regression Protection       10%
Performance SLA             10%
Security & Sandbox Checks   10%
Required MCP Discovery       5%
--------------------------------
Total:                     100%

The evaluator produces a detailed machine-readable report in evaluation_report.json.


Investigating Incidents with MCP Tools

When an incident is active, agents can inspect the system using safe diagnostic tools:

# 1. Check service error rates
get_error_rate(service="orders")

# 2. Inspect recent errors
get_service_errors(service="orders", limit=10)

# 3. Locate slow distributed transactions
search_slow_traces(min_duration_ms=100.0)

# 4. Compare deployment configurations
compare_configuration(deployment_id_a="dep-v2.4.1", deployment_id_b="dep-v2.4.2")

# 5. Check database query execution plan
explain_query("SELECT * FROM orders WHERE customer_id = 'cust_123'")

Architecture Decision Records (ADRs)

Detailed architectural justifications are located in docs/adr/:


License

Apache-2.0 License. See LICENSE for details.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

No tool schema history has been recorded yet.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    A toolkit of 256 MCP servers for SRE incident diagnosis with Claude. One agent per tech (Postgres, Kafka, Istio, Kubernetes, Prometheus, MongoDB, Redis, Cassandra, ...) with failure modes, key metrics, and runbooks baked in. Plus telemetry MCPs (PromQL/LogQL/Elasticsearch), SSH-via-bastion executor, and 33 discovery adapters across 9 clouds. Apache 2.0, runs locally. Reproducible 5/5 scenari
    Apache 2.0
  • A
    license
    B
    quality
    C
    maintenance
    Enables deterministic security testing of AI agents that use tools by serving synthetic MCP environments with poisoned data, fake secrets, and privileged actions. Records agent tool calls and evaluates security invariants (e.g., canary leaks, forbidden access, approval binding) without an LLM judge or real systems.
    8
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/abdulhadi111511-ship-it/Sentinel-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server