Skip to content
Back to search

mcp-slim-guard

Context compression for MCP. Same upstream call, exact results recoverable.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/lennney--mcp-slim-guard/badge.svg)](/listings/lennney--mcp-slim-guard)

HTML

<a href="/listings/lennney--mcp-slim-guard"><img src="/api/listings/lennney--mcp-slim-guard/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

`0.1.1-alpha.2` is a source candidate and is not published to npm yet. From a reviewed checkout of this candidate:

npm ci
npm run build
npm link
cd /path/to/project-with-mcp-config
mcp-slim-guard init
mcp-slim-guard validate

# Run the default Compact mode.
mcp-slim-guard start

`init` writes `mcp-slim-guard.yml` with version `2`. The file contains upstream and security settings only. Select a mode in the host command, not in YAML.

# Inspect a host-specific plan without changing host files.
mcp-slim-guard plan --host codex
mcp-slim-guard plan --host claude-code --mode extreme

# Verify the configured runtime without changing Host configuration or calling a business Tool.
mcp-slim-guard verify --host codex

# Apply a reviewed plan.
mcp-slim-guard install --host codex --mode native

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 167 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # MCP Slim Guard
  2. MCP Slim Guard gives a host one deliberate way to reach authorized upstream
  3. tools. It keeps input schemas intact, validates calls before the upstream is
  4. invoked, and can recover an oversized result exactly without repeating that
  5. invocation.
  6. ## Choose a mode
  7. | Mode | What the host sees | Best fit |
  8. | ------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------- |
  9. | Native | Authorized original tool names and full schemas, plus `read_result` | Hosts that work well with a normal MCP catalog, including Codex |
  10. | Compact | `find_tool`, `call_tool`, and `read_result`; discovery returns each match's full original schema | A small, predictable host surface |
  11. | Extreme | The Compact tool surface and schemas; only sufficiently large results receive a shorter recoverable first delivery | Context-sensitive hosts where a smaller first result is valuable |
  12. Compact is the default for `start`. Native is the default installation plan for
  13. Codex. Compact is the default for Claude Code; Claude Code supports Compact and
  14. Extreme installation plans, not Native.
  15. All modes apply the same allow/deny authorization. Compact and Extreme return at
  16. most three discovery matches, each with the original required fields, enums, and
  17. nested schema. A call is validated against that original schema before the
  18. upstream server is contacted.
  19. `find_tool` rejects unknown fields and queries longer than 256 Unicode code
  20. points locally. It searches only the current authorized catalog and never falls
  21. back to an unauthorized entry.
  22. ## Quick start
  23. `0.1.1-alpha.2` is a source candidate and is not published to npm yet. From a
  24. reviewed checkout of this candidate:
  25. ```bash
  26. npm ci
  27. npm run build
  28. npm link
  29. cd /path/to/project-with-mcp-config
  30. mcp-slim-guard init
  31. mcp-slim-guard validate
  32. # Run the default Compact mode.
  33. mcp-slim-guard start
  34. ```
  35. `init` writes `mcp-slim-guard.yml` with version `2`. The file contains upstream
  36. and security settings only. Select a mode in the host command, not in YAML.
  37. ```bash
  38. # Inspect a host-specific plan without changing host files.
  39. mcp-slim-guard plan --host codex
  40. mcp-slim-guard plan --host claude-code --mode extreme
  41. # Verify the configured runtime without changing Host configuration or calling a business Tool.
  42. mcp-slim-guard verify --host codex
  43. # Apply a reviewed plan.
  44. mcp-slim-guard install --host codex --mode native
  45. ```
  46. ## Host entries
  47. For Codex, use Native when you want the normal authorized MCP catalog:
  48. ```toml
  49. [mcp_servers.slim_guard]
  50. command = "mcp-slim-guard"
  51. args = ["start", "--mode", "native"]
  52. cwd = "/absolute/path/to/project"
  53. ```
  54. For Claude Code, use Compact by default:
  55. ```json
  56. {
  57. "mcpServers": {
  58. "slim-guard": {
  59. "command": "mcp-slim-guard",
  60. "args": ["start", "--mode", "compact"],
  61. "cwd": "/absolute/path/to/project"
  62. }
  63. }
  64. }
  65. ```
  66. See [host setup](docs/host-setup.md) for the full configuration and verification
  67. steps.
  68. ## Configuration
  69. ```yaml
  70. version: 2
  71. tools:
  72. allow:
  73. - "upstream_*"
  74. deny:
  75. - "*_delete_*"
  76. ssrf:
  77. mode: block
  78. block_private_ips: true
  79. allow_domains: []
  80. block_domains: []
  81. rate_limit:
  82. default: "60/min"
  83. injection_detection:
  84. enabled: true
  85. sensitivity: medium
  86. mode: block
  87. audit:
  88. output: file
  89. filePath: mcp-slim-guard-audit.log
  90. servers:
  91. upstream:
  92. command: npx
  93. args: ["-y", "@your/mcp-server"]
  94. ```
  95. Version 1 configuration is intentionally unsupported. The removed `compressor`
  96. section is rejected rather than migrated automatically.
  97. ## Repair an invalid call
  98. If arguments do not match an authorized tool's original schema, Slim Guard
  99. returns a normal MCP tool error with `structuredContent` that identifies the
  100. schema failure and confirms that the upstream tool was not invoked. Correct the
  101. arguments and retry; submitted argument values are not echoed in that error.
  102. ## Result recovery
  103. When a response needs recoverable delivery, the first response includes a
  104. `result_ref`. Use `read_result` with `query` to locate up to three bounded local
  105. fragments, or omit `query` and follow `next_cursor` to recover the exact snapshot.
  106. Both paths use the same immutable capture and never invoke the upstream tool again.
  107. Do not combine `query` with `cursor`. Native and Compact use the standard delivery
  108. boundary. Extreme uses a smaller boundary only when the initial delivered response
  109. is at least half the size of the exact response; otherwise it passes the exact
  110. response through unchanged.
  111. ## Evidence and checks
  112. The repository includes a 24-task mode comparison, result-recovery fixtures,
  113. and a 100-tool / 8,000-row stress fixture. Run the current artifacts with:
  114. ```bash
  115. npm run build
  116. npm run bench:task
  117. npm run bench:compression
  118. npm run bench:stress
  119. npm run bench:compression:verify
  120. ```
  121. Their reports are mode-specific and are generated locally; do not treat older
  122. alpha benchmark figures as claims for this product line.
  123. ## Development
  124. ```bash
  125. npm run build
  126. npm run typecheck
  127. npm run lint
  128. npm test
  129. npm run verify:package-boundary
  130. npm run smoke:package
  131. ```
  132. This project is an alpha. Review authorization patterns and upstream settings
  133. before using it with privileged tools.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.