Skip to main content
Glama
mcp-metsuke-crunchtools

mcp-metsuke-crunchtools

Official
by crunchtools

mcp-metsuke-crunchtools

Stateful reports catalog MCP server. Metsuke (目付 — the Sengoku intelligence officer who gathered field reports and compiled them for the daimyō) is the durable, cross-agent home for report definitions and their gathered outputs.

An autonomous gatherer reads a definition, sweeps the configured sources, and writes findings — each carrying its own source URL. A compiler later reads the freshest output to draft a fully cited report. This replaces ad-hoc, run-scoped research caches with a real, queryable store.

Features

  • Definitions + outputs — separate what-to-gather from what-was-gathered

  • Built-in scheduler — Metsuke fires each definition's gather when its cron schedule comes due, or on demand via trigger_report — no external timer

  • Run lifecycle — every fire opens a durable run with a second-granularity run_id: a provisional row is recorded before the callback (a fire is never lost), and a per-report concurrency lock keeps two gathers from racing

  • Cited findings — payloads carry per-finding source URLs for one-click checking

  • Re-homeable gathering — owner_agent makes the gatherer identity data, not code

  • Local-first — plain SQLite (WAL), no external services, no per-seat fees

  • Three transports — stdio, SSE, streamable-http

Related MCP server: Argon Memory

Install

uvx mcp-metsuke-crunchtools

pip

pip install mcp-metsuke-crunchtools

Container

podman run --rm -v ~/.local/share/mcp-metsuke:/data:Z \
  quay.io/crunchtools/mcp-metsuke \
  --transport streamable-http --host 0.0.0.0 --port 8009

Claude Code Integration

claude mcp add mcp-metsuke-crunchtools -- uvx mcp-metsuke-crunchtools

Tools (10)

Definitions (4)

Tool

Description

list_reports

List all report definitions in the catalog, each with its next scheduled fire time.

get_spec

Return the gather prompt + source config for one definition.

upsert_definition

Create or update a definition (name, prompt, owner, cron schedule, timezone, sources).

trigger_report

Fire a report gather right now, without waiting for its schedule. For a swept definition it returns at once with dispatched: "after_sweep"; the sweep and the callback follow in the background.

Outputs (6)

Tool

Description

save_output

Complete a run by persisting its gathered findings (pass the run_id from the fire callback; each finding ideally carrying a source URL).

get_output

Read the freshest output (or a specific day's) for compiling a report.

list_outputs

Browse the run history — metadata + finding_count per saved gather, no payloads.

delete_output

Delete one saved output by id.

prune_outputs

Bulk-prune a report's outputs — keep the N newest, or drop those before a date.

get_sweep

Read a swept run's pre-gathered records: the index, or one page of one section.

Environment Variables

Variable

Default

Description

METSUKE_DB

~/.local/share/mcp-metsuke/metsuke.db

SQLite database path

METSUKE_DB_FILE

(none)

Path whose contents override METSUKE_DB (container secret-file convention)

TRENTINA_ALERT_URL

(none)

Base URL of the Trentina gateway; the scheduler POSTs gather callbacks to <url>/alert with the token as Authorization: Bearer

METSUKE_ALERT_TOKEN

(none)

Alert token identifying the reports profile; enables the scheduler when set with TRENTINA_ALERT_URL

METSUKE_ALERT_TOKEN_FILE

(none)

Path whose contents override METSUKE_ALERT_TOKEN (container secret-file convention)

METSUKE_PULL_OWNERS

(none)

Comma-separated owners that collect their own runs: their reports are opened and swept on schedule but get no callback. Also enables the scheduler

TRENTINA_GATEWAY_URL

(none)

Trentina gateway MCP endpoint for the sweep profile, e.g. http://mcp-trentina:8019/gateway/metsuke-sweep/mcp. Plain HTTP is accepted only for internal hosts (single-label service names, localhost, private IPs); anything else must be HTTPS

METSUKE_SWEEP_TOKEN

(none)

Bearer token for that profile; METSUKE_SWEEP_TOKEN_FILE overrides it

METSUKE_SWEEP_TIMEOUT_SECONDS

1200

Upper bound on one run's sweep

METSUKE_SCHEDULER_POLL_SECONDS

60

How often the scheduler checks for due reports

METSUKE_SCHEDULER_ENABLED

(auto)

Force the scheduler on/off; defaults to on when the callback is configured

METSUKE_RUN_LOCK_TTL_SECONDS

1800

How long an in-flight run holds the per-report lock before it is expired (self-heals a dead gatherer)

The scheduler runs only under the sse and streamable-http transports (the long-lived production processes), never under stdio.

Data Model

  • report_definitions — name (PK), gather_prompt, owner_agent, schedule (cron), timezone (IANA), source_config (JSON), last_fired_at, updated_at

  • report_outputs (one row per run) — id, report_name (FK), run_id (second-granularity identity), trigger (scheduled/manual/direct), gathered_at, finished_at, window_start/window_end, payload (JSON findings with source URLs), status (gathering/ready/compiled/failed), gatherer_run_ref, detail. A partial unique index on (report_name) WHERE status='gathering' is the per-report concurrency lock.

MCP Registry

io.github.crunchtools/metsuke

License

AGPL-3.0-or-later

Sweeps

A definition can opt into a deterministic pre-gather by adding sweep to its source_config:

{"sweep": {"timezone": "America/New_York", "window_hour": 6, "steps": [
  {"section": "slack", "collector": "slack_waiting",
   "options": {"user_id": "U9VN3S1ST", "handle": "smccarty"}},
  {"section": "work_email", "collector": "gmail_waiting",
   "options": {"backend": "gw-work", "account": "smccarty@redhat.com"}},
  {"section": "calendar", "collector": "calendar_day",
   "options": {"backend": "gw-work", "account": "smccarty@redhat.com"}},
  {"section": "rss", "collector": "feed_entries",
   "options": {"categories": {"1": 20, "5": 20}}}]}}

On fire, Metsuke runs each step in order through the Trentina gateway (as its own read-only profile), stores the results on the run, then dispatches the callback with sweep_status. The gatherer reads records with get_sweep instead of calling the sources, so the gathering LLM only selects, phrases and delivers. A failing step is recorded and the sweep continues. Results Trentina flags are stored as metadata only, with their text withheld.

Collector

What it produces

slack_waiting

Direct asks over a lookback: an @-mention, or a DM message that reads as a question or request (DM chatter and Slack system notices are not asks). Threads are read as threads; DMs and top-level channel mentions are read from channel history (one conversation per channel). Each is read for up to three pages (longer or partly unreadable ones are marked unverified). An ask the user replied to or reacted to is answered and dropped; the rest are waiting, with in_window separating new asks from still-open ones

gmail_waiting

Inbox threads in the window (or lookback_days) where the backend's ownership analysis says the ball is in the user's court; automated mail, bare calendar notices and threads newer than min_age_hours dropped, invitations kept, priority_senders marked priority

calendar_day

The report day's meetings, pending invites over a lookahead, and hard overlaps

feed_entries

Recent entries per feed category (read or unread), with a longer window after a weekend

jira_issues

Issues matching each named JQL query, with {since} substituted by the window start. Each record carries the key, browse link, status, components and age; where the description is a web intake form, its Field: value pairs are parsed into contact and a capped detail line. A failing query is recorded and the rest still run. probe_key first fetches a known issue; if the backend cannot return it the section is error, not "0 new"

gmail_search

Every thread a Gmail query matches (in:sent after:{window_start}), no ownership or noise filtering; subject and body withheld when flagged

slack_search

Every Slack message a search query matches (from:me after:{date}), paged 20 at a time, authors resolved to names, permalink as link

docs_search

Google Docs modified since the window start (workspace-mcp search_drive_files, newest first), with a docs.google.com/document/d/{id}/edit link

workboard_objectives

The user's WorkBoard objectives, each followed by its key results: name, progress, status, owner

Collector options

Every step is {"section": "<name>", "collector": "<collector>", "options": {...}}. Section names are [a-z0-9_-], unique, up to 12 steps. Top-level timezone (IANA, default America/New_York) and window_hour (0-23, default 6) set the window: from that hour on the previous weekday until the run.

Collector

Option

Required

Default

Bounds

slack_waiting

user_id

yes

2-32 chars

handle

yes

1-64 chars

backend

slack

≤64 chars

self_label

you

≤64 chars

first_name

none

1-64 chars; in group DMs and channels, a question or request that addresses the user by this name is an ask

lookback_days

7

1-30

max_conversations

40

1-100

workspace_url

https://redhat-internal.slack.com

≤200 chars

gmail_waiting

backend

yes

e.g. gw-work, gw-personal

account

yes

the mailbox address

query_extra

""

≤500 chars, appended to in:inbox after:<window>

max_threads

60

1-200

body_chars

1200

0-4000 (0 = no body)

link_template

Gmail #all/{thread_id}

≤200 chars, or null

lookback_days

report window

1-30, search the last N days instead

min_age_hours

0

0-168, drop threads active more recently

priority_senders

[]

≤20 From-header substrings (1-100 chars, case-insensitive)

calendar_day

backend

yes

account

yes

timezone

America/New_York

IANA zone

lookahead_days

3

0-14 (pending invites)

lookback_days

0

0-30, also read N days before the report day (past_meeting / past_all_day)

responses

all but declined

1-3 of accepted, tentative, needsAction

feed_entries

categories

yes

1-12 entries of "<id>": <limit>, id ≤9 digits, limit 1-100

backend

feeds

since_days

1

1-30

since_days_after_weekend

3

1-30 (Mondays and weekend runs)

jira_issues

queries

yes

1-6 of {"label", "jql", "limit"}: label [a-z0-9_-] ≤32, jql ≤600 chars ({since} → window start as YYYY-MM-DD HH:mm), limit 1-50

backend

jira

≤64 chars; needs jira_search allowed

browse_url

https://redhat.atlassian.net/browse/

≤200 chars, prefixed to the issue key

detail_chars

800

0-2000 (0 = no form detail line)

probe_key

none

a Jira key known to exist, e.g. RHELBU-4132

gmail_search

backend, account

yes

as gmail_waiting

query

yes

≤500 chars, {window_start} → read start as YYYY/MM/DD

lookback_days

report window

1-30

max_threads / body_chars / link_template

60 / 1200 / Gmail

as gmail_waiting

slack_search

query

yes

≤500 chars, {date} → day before the read start (Slack after: is exclusive)

backend

slack

lookback_days

report window

1-30

max_messages

60

1-100

text_chars

700

0-2000

resolve_names

true

workspace_url

https://redhat-internal.slack.com

permalink fallback

docs_search

account

yes

backend

gw-work

needs search_drive_files allowed

query_extra

""

≤500 chars Drive query, ANDed on (e.g. 'me' in owners)

lookback_days

report window

1-30

max_docs

50

1-100

link_template

https://docs.google.com/document/d/{id}/edit

≤200 chars

workboard_objectives

backend

workboard

needs workboard_get_my_objectives_tool allowed

objective_ids

auto-discovered

1-25 positive ids

Collectors are code in sweep/collectors.py, not configuration: a definition can only pick and parameterize them. A bad spec is rejected at upsert_definition time.

Available Tools

10 tools
delete_output_toolDelete Output ToolA

Delete one saved report output by id.

Returns the deleted output's metadata (with deleted=True). Find ids with list_outputs_tool. Raises if no output carries that id.

Inputs: output_id (required). Returns: object

get_output_toolGet Output ToolA
Read-only

Read a gathered report output for compiling a report.

Returns the most recent output by default, or the latest output gathered on a specific date when gathered_date is given.

Inputs: name (required), gathered_date. Returns: object

get_spec_toolGet Spec ToolA
Read-only

Return the gather spec (prompt + source config) for a report definition.

This is what the autonomous gatherer calls on callback to learn what to collect for the named report.

Inputs: name (required). Returns: object

get_sweep_toolGet Sweep ToolA
Read-only

Read the pre-gathered sweep for a run.

Swept reports are gathered by Metsuke before the gatherer is called: fixed source calls, reply-state checks and noise filters run in code, and the results are stored on the run as sections of compact records. Call with no section for the index (window, overall status, per-section record counts and errors), then page through each section you need.

Inputs: page, run_id, section, page_size, +1 more. Returns: object

list_outputs_toolList Outputs ToolA
Read-only

List saved report outputs (the run history), newest first.

Returns one lightweight row per saved gather — id, report_name, gathered_at, reporting window, status, and a finding_count — but NOT the payloads, so the full history stays cheap to browse. Use get_output_tool to pull one run's findings, and delete_output_tool / prune_outputs_tool to prune.

Inputs: limit, report_name. Returns: result

list_reports_toolList Reports ToolA
Read-only

List all report definitions in the catalog.

Returns each definition with its gather prompt, owner agent, schedule, source config, and last-updated time.

Inputs: no named parameters. Returns: result

prune_outputs_toolPrune Outputs ToolA

Bulk-prune a report's saved outputs. Returns the count and ids deleted.

Give exactly one criterion: keep_last retains the N most recent outputs and deletes the rest (keep_last=0 deletes them all); before_date deletes every output gathered strictly before that date.

Inputs: report_name (required), keep_last, before_date. Returns: object

save_output_toolSave Output ToolA

Persist a gathered report output, completing the run that opened it.

The gatherer writes findings here after sweeping the sources. Each finding in payload should carry its own source URL so the compiler can cite it. Pass the run_id Metsuke handed you in the fire callback so this completes that exact in-flight run (one row per fire). Omit run_id for an ad-hoc direct save; Metsuke stamps a fresh run identity either way.

Inputs: payload (required), report_name (required), run_id, status, +3 more. Returns: object

trigger_report_toolTrigger Report ToolA

Fire a report gather right now, without waiting for its schedule.

Dispatches the same callback the scheduler uses: Metsuke POSTs the trigger to the Trentina alert endpoint, which forwards it to the owning gatherer. Requires the callback to be configured (TRENTINA_ALERT_URL + METSUKE_ALERT_TOKEN), unless the owner is a pull owner (METSUKE_PULL_OWNERS): then the run is opened and left for the owner.

Inputs: name (required). Returns: object

upsert_definition_toolUpsert Definition ToolB

Create or update a report definition.

The owner_agent field makes the gatherer identity data, not code, so gathering can be re-homed to another agent without a rebuild. The schedule is a live cron expression: Metsuke's built-in scheduler fires the report when it comes due, in the given timezone.

Inputs: name (required), gather_prompt (required), schedule, timezone, +2 more. Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 10 tools

    Disambiguation4/5

    Most tools target clearly distinct resources (definitions, outputs, runs, sweeps) with a clean verb split (list/get/save/delete/prune). The only mild overlap is get_output_tool vs get_sweep_tool, since both retrieve gathered data, but the descriptions distinguish compiled findings from pre-gathered sweep sections well.

    Naming Consistency5/5

    Every tool follows the same verb_noun_tool pattern (list_reports_tool, get_output_tool, upsert_definition_tool, prune_outputs_tool), with consistent snake_case and singular/plural conventions (list uses plural, get/upsert use singular). No mixed styles.

    Tool Count5/5

    Ten tools is well-scoped for a report-gathering management server, covering the full lifecycle of definitions, outputs, triggering, and sweeps without redundancy. Each tool earns its place with a distinct role.

    Completeness4/5

    Outputs have full lifecycle coverage (save, get, list, delete, prune) and definitions support list/get_spec/upsert, but there is no delete_definition_tool, leaving a gap in definition management. Agents can work around it, but the surface is not fully closed.

    Maintenance

    ActivityActive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables ChatGPT agents to store and retrieve reports in MongoDB Atlas, acting as a bridge between ChatGPT scheduled agents and a persistent database.
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP agents to maintain durable, evidence-aware project knowledge, retrieve precise excerpts on demand, and track decisions, conflicts, and revisions across sessions.
      1
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides persistent, searchable memory across coding projects and machines, letting agents record and retrieve projects, reusable assets, sessions, decisions, commits, and handoffs via MCP.
      3
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI clients to locally store and share tasks, work activities, long-term memory, knowledge, and people information, while allowing users to review saved content and generate briefings or reports through a web UI.
      MIT