Skip to main content
Glama

LoopSense MCP Server

LoopSense Demo

LoopSense is an open-source MCP server that closes the feedback loop for AI coding agents — giving them real-time visibility into CI results, deployments, test outcomes, and file system changes.

What it does

When an AI agent pushes code, runs tests, or triggers a deployment, LoopSense watches the downstream effects and surfaces them back to the agent. No more blind actions.

Supported sources:

  • GitHub Actions CI runs (polling)

  • Local processes (stdout/stderr capture, exit codes)

  • File system changes (via chokidar)

  • HTTP endpoints (polling, with status/body assertions)

  • Incoming webhooks (lightweight HTTP server)

Related MCP server: warmstart

Requirements

  • Node.js 18+

Installation

npm install -g @loopsense/mcp

Or run directly with npx:

npx @loopsense/mcp

MCP Configuration

Claude Code (one-liner):

claude mcp add loopsense -e GITHUB_TOKEN=ghp_yourtoken -- npx -y @loopsense/mcp

Or add manually to your claude_desktop_config.json (or equivalent MCP host config):

{
  "mcpServers": {
    "loopsense": {
      "command": "npx",
      "args": ["-y", "@loopsense/mcp"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token_here"
      }
    }
  }
}

Or if installed globally:

{
  "mcpServers": {
    "loopsense": {
      "command": "loopsense",
      "env": {
        "GITHUB_TOKEN": "ghp_your_token_here"
      }
    }
  }
}

Environment Variables

Variable

Description

GITHUB_TOKEN

GitHub personal access token for CI polling

Tools

watch_ci

Watch a GitHub Actions workflow run. Polls every 30 seconds and emits events on status changes.

{
  "owner": "acme",
  "repo": "api",
  "branch": "main",
  "action_id": "deploy-2024-01"
}

watch_process

Spawn a local process and capture its output and exit code.

{
  "command": "npm",
  "args": ["test"],
  "cwd": "/path/to/project",
  "action_id": "run-tests"
}

watch_file

Watch a file or directory for changes.

{
  "path": "/path/to/dir",
  "pattern": "**/*.ts",
  "action_id": "file-changes"
}

watch_url

Poll an HTTP endpoint and detect status or body changes.

{
  "url": "https://api.example.com/health",
  "interval": 15,
  "expect": {
    "status": 200,
    "body_contains": "\"status\":\"ok\""
  }
}

watch_webhook

Start a local HTTP server to receive webhook payloads.

{
  "source_type": "vercel",
  "port": 9876
}

Configure your webhook sender to POST to http://localhost:9876.

check_consequences

Get events for a specific action or all recent events.

{
  "action_id": "deploy-2024-01"
}

list_watches

List all active watchers.

cancel_watch

Stop a watcher by ID.

{
  "watch_id": "uuid-here"
}

poll_events

Get events since a timestamp (fallback for clients without notification support).

{
  "since": "2024-01-01T00:00:00.000Z"
}

Resources

LoopSense exposes two MCP resources that update reactively:

  • loopsense://timeline/recent — last 100 events across all watches

  • loopsense://watches/active — all currently active watches

  • loopsense://consequences/{action_id} — events for a specific action

Usage Example

An agent workflow might look like:

  1. Agent pushes code to a branch

  2. Agent calls watch_ci with action_id: "my-pr-123"

  3. LoopSense polls GitHub Actions every 30 seconds

  4. When CI completes, agent calls check_consequences with action_id: "my-pr-123"

  5. Agent sees the test failures and fixes them

Data Storage

Events and watch records are persisted to ~/.loopsense/events.db (SQLite). Active watches are resumed automatically on server restart.

Development

git clone https://github.com/jarvisassistantux/loopsense
cd loopsense
npm install
npm run dev       # run in dev mode (tsx)
npm run build     # compile with tsup
npm run typecheck # TypeScript check
npm test          # run tests

License

MIT

Available Tools

9 tools
cancel_watchC

Stop and remove a watcher

Inputs: watch_id (required).

check_consequencesB

Get events associated with an agent action, or all recent events

Inputs: action_id.

list_watchesB

List all active watchers

Inputs: no named parameters.

poll_eventsA

Get new events since a timestamp (push notification fallback)

Inputs: since.

watch_ciB

Watch a GitHub Actions workflow run and emit events on status changes

Inputs: owner (required), repo (required), branch, run_id, +1 more.

watch_fileC

Watch a file or directory for changes using chokidar

Inputs: path (required), pattern, action_id.

watch_processA

Spawn and monitor a local process, capturing stdout/stderr and exit code

Inputs: command (required), args, cwd, action_id.

watch_urlB

Poll an HTTP endpoint and emit events when status or body changes

Inputs: url (required), interval, expect, action_id.

watch_webhookC

Start an HTTP server to receive incoming webhooks

Inputs: source_type (required), port, filter, action_id.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 9 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: cancel_watch, list_watches, and poll_events manage watchers generically, while watch_ci, watch_file, watch_process, watch_url, and watch_webhook each target a specific resource type (GitHub Actions, files, processes, URLs, webhooks). check_consequences stands alone for event retrieval. No ambiguity exists between tools.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern with snake_case: cancel_watch, check_consequences, list_watches, poll_events, watch_ci, watch_file, watch_process, watch_url, watch_webhook. The naming is predictable and readable throughout the set.

    Tool Count5/5

    With 9 tools, the count is well-scoped for a monitoring/event-driven server. Each tool earns its place by covering distinct aspects of watching, managing watchers, and retrieving events, without being overly sparse or bloated.

    Completeness4/5

    The tool set provides comprehensive coverage for monitoring and event handling: it includes creation (watch_* tools), management (cancel_watch, list_watches), and event retrieval (check_consequences, poll_events). A minor gap is the lack of an update_watch tool for modifying existing watchers, but agents can work around this by canceling and recreating.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Local-first MCP server that gives any AI coding agent per-project memory, workflow intelligence, and always-on, lossless token & context optimization.
      37
      8 npm
      6
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      An MCP server that exposes a verified manifest of a repository's development commands, allowing AI coding agents to instantly learn the correct dev loop without trial-and-error.
      9 npm
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      MCP server providing structured continuity memory for AI coding agents, tracking decisions, open loops, and session state in local SQLite. Enables agents to resume work from verified state across sessions without replaying transcripts.
      17
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      A self-hosted MCP server that enables AI coding agents to read, edit, search, and run code in local projects with human review loops and policy controls.
      MIT