AgentStack
MCP verified MIT Self-run

Logslim

mcp-p156ham-logslim · by P156HAM

Structured CI failure summaries on PRs + compact test/build logs for AI agents. GitHub Action, CLI, MCP.

No reviews yet
0 installs
11 views
0.0% view→install

Install

$ agentstack add mcp-p156ham-logslim

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Logslim? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

logslim

CI failed? Get a 5-line PR summary — not a 400-line Actions log. Agent reading test output? Cut 80–95% of the tokens.

[](https://www.npmjs.com/package/logslim) [](./LICENSE) [](https://www.npmjs.com/package/logslim) [](https://glama.ai/mcp/servers/P156HAM/logslim)

When tests or builds fail, you scroll GitHub Actions logs. When Claude Code or Cursor runs npm test, the agent reads everything — progress bars, 120 identical warnings, 40 frames of node_modules. logslim fixes both:

  1. CI / humans — GitHub Action posts structured failures on your PR (file, line, fix hints)
  2. Agents / tokens — CLI + MCP compacts noisy output before an LLM reads it (~80–95% savings on failures)
npx logslim -- npm test

No account. No API key. MIT open source.


GitHub Action — PR failure summary

When CI fails, post a readable summary on the pull request instead of making reviewers dig through Actions logs.

permissions:
  contents: read
  pull-requests: write

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci

      - name: Run tests
        id: test
        run: npm test 2>&1 | tee test-output.log
        continue-on-error: true

      - name: Post failure summary
        if: steps.test.outcome == 'failure' && github.event_name == 'pull_request'
        uses: P156HAM/logslim/action@v0.4.0
        with:
          log-file: test-output.log
          exit-code: 1
          github-token: ${{ secrets.GITHUB_TOKEN }}

      - name: Fail job
        if: steps.test.outcome == 'failure'
        run: exit 1

What gets posted on the PR:

  • Structured failures with file:line and messages
  • Fix hints for known codes (TS2339, ERESOLVE, …)
  • Link to the full CI log
  • Token/log reduction stats (useful when agents also read the output)

The Action uses the same engine as the CLI — compaction, error extraction, and code cards. You get human-readable PR comments and agent-ready JSON from one tool.

| Input | Default | Purpose | | ----- | ------- | ------- | | log-file | (required) | Path to captured test/build log | | exit-code | 1 | Exit code of the failed command | | github-token | (required) | secrets.GITHUB_TOKEN with pull-requests: write | | logslim-version | 0.3.0 | npm version to run | | skip-on-success | true | Don't comment when no failure detected |


See it work (30 seconds)

git clone https://github.com/P156HAM/logslim.git
cd logslim && npm install && npm run build && npm run demo

Or without cloning:

npx logslim -- node -e "console.log('ok'); for(let i=0;i&1 | logslim
npm test; logslim --exit-code $? 2>&1 `
- Read the `compacted`, `errors`, and `codes` fields before debugging.
- If output was elided, re-run the raw command only if you need full logs.

Error code fix cards

When logs contain known codes, logslim attaches a short fix card (~30 tokens) instead of making the agent guess or search docs.

| Family | Examples | Source | | ---------- | ----------------------- | ------------------------ | | TypeScript | TS2339, TS2554, TS2307 | errors/typescript.json | | Node | ECONNREFUSED, ENOTFOUND | errors/node.json | | npm | ERESOLVE, ELIFECYCLE | errors/npm.json |

Hand-curated pocket references — not scraped docs. PRs welcome to add codes.


Measured savings

| Log type | Lines | Tokens | Saved | | ----------------------------------------- | --------- | --------------- | ------- | | Jest (warn spam + 1 failure) | 149 → 25 | ~3,300 → ~250 | 92% | | Webpack build (asset noise + 2 TS errors) | 548 → 55 | ~8,900 → ~1,000 | 88% | | Pytest (25 identical failures) | 356 → 153 | ~4,300 → ~1,500 | 64% |

Token counts are estimated (~4 chars/token). Good for relative savings, not billing.


Library API

import { compact, process } from "logslim";

const { text, stats } = compact(rawLog, { mode: "failure", exitCode: 1 });

const result = process(rawLog, {
  mode: "failure",
  exitCode: 1,
  attach: ["git", "ci"],
});
// result.text, result.errors, result.codes, result.stats

When to use logslim

| Use it | Skip it | | -------------------------------------------------------- | ---------------------------------------------- | | CI failed and you want a PR summary, not a 400-line log | Tests passed and output is already short | | AI agents running tests/builds locally or in CI | You already tee full logs to disk for audit | | Long repetitive failure output (jest, pytest, webpack) | Platform already truncates well enough for you | | MCP workflows where tool output hits context limits | You need full logs for compliance archive |

Keep full logs if you need them:

npm test 2>&1 | tee full.log | logslim

Development

npm install
npm test
npm run build
npm run demo

Contributing

logslim gets sharper every time it learns a new error code or a new log format — and both are easy first contributions:

  • Add an error fix card (TypeScript / Node / npm) — a ~5-minute, pure-JSON PR.
  • Share a log that compacts badly — paste real output from a tool logslim mangles.
  • Add support for a new runner — Playwright, pytest, vitest, cargo, gradle…

Start here: good first issues · [CONTRIBUTING.md](./CONTRIBUTING.md)

License

MIT — use freely, no account required.

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.