mcp-slim-guard

作者 lennney

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

122
Stars
0
Forks
TypeScript
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/lennney/mcp-slim-guard

快速入门

使用 mcp-slim-guard 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

MCP Slim Guard

MCP Slim Guard gives a host one deliberate way to reach authorized upstream tools. It keeps input schemas intact, validates calls before the upstream is invoked, and can recover an oversized result exactly without repeating that invocation.

Choose a mode

ModeWhat the host seesBest fit
NativeAuthorized original tool names and full schemas, plus read_resultHosts that work well with a normal MCP catalog, including Codex
Compactfind_tool, call_tool, and read_result; discovery returns each match's full original schemaA small, predictable host surface
ExtremeThe Compact tool surface and schemas; only sufficiently large results receive a shorter recoverable first deliveryContext-sensitive hosts where a smaller first result is valuable

Compact is the default for start. Native is the default installation plan for Codex. Compact is the default for Claude Code; Claude Code supports Compact and Extreme installation plans, not Native.

All modes apply the same allow/deny authorization. Compact and Extreme return at most three discovery matches, each with the original required fields, enums, and nested schema. A call is validated against that original schema before the upstream server is contacted.

find_tool rejects unknown fields and queries longer than 256 Unicode code points locally. It searches only the current authorized catalog and never falls back to an unauthorized entry.

Quick start

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

Host entries

For Codex, use Native when you want the normal authorized MCP catalog:

[mcp_servers.slim_guard]
command = "mcp-slim-guard"
args = ["start", "--mode", "native"]
cwd = "/absolute/path/to/project"

For Claude Code, use Compact by default:

{
  "mcpServers": {
    "slim-guard": {
      "command": "mcp-slim-guard",
      "args": ["start", "--mode", "compact"],
      "cwd": "/absolute/path/to/project"
    }
  }
}

See host setup for the full configuration and verification steps.

Configuration

version: 2
tools:
  allow:
    - "upstream_*"
  deny:
    - "*_delete_*"
ssrf:
  mode: block
  block_private_ips: true
  allow_domains: []
  block_domains: []
rate_limit:
  default: "60/min"
injection_detection:
  enabled: true
  sensitivity: medium
  mode: block
audit:
  output: file
  filePath: mcp-slim-guard-audit.log
servers:
  upstream:
    command: npx
    args: ["-y", "@your/mcp-server"]

Version 1 configuration is intentionally unsupported. The removed compressor section is rejected rather than migrated automatically.

Repair an invalid call

If arguments do not match an authorized tool's original schema, Slim Guard returns a normal MCP tool error with structuredContent that identifies the schema failure and confirms that the upstream tool was not invoked. Correct the arguments and retry; submitted argument values are not echoed in that error.

Result recovery

When a response needs recoverable delivery, the first response includes a result_ref. Use read_result with query to locate up to three bounded local fragments, or omit query and follow next_cursor to recover the exact snapshot. Both paths use the same immutable capture and never invoke the upstream tool again. Do not combine query with cursor. Native and Compact use the standard delivery boundary. Extreme uses a smaller boundary only when the initial delivered response is at least half the size of the exact response; otherwise it passes the exact response through unchanged.

Evidence and checks

The repository includes a 24-task mode comparison, result-recovery fixtures, and a 100-tool / 8,000-row stress fixture. Run the current artifacts with:

npm run build
npm run bench:task
npm run bench:compression
npm run bench:stress
npm run bench:compression:verify

Their reports are mode-specific and are generated locally; do not treat older alpha benchmark figures as claims for this product line.

Development

npm run build
npm run typecheck
npm run lint
npm test
npm run verify:package-boundary
npm run smoke:package

This project is an alpha. Review authorization patterns and upstream settings before using it with privileged tools.

常见问题

What is mcp-slim-guard?

mcp-slim-guard is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by lennney. Context compression for MCP. Same upstream call, exact results recoverable. It has 122 GitHub stars.

Is mcp-slim-guard safe to use?

mcp-slim-guard returned warnings in SkillsLLM's automated security scan. It has no critical vulnerabilities, but review the flagged issues in the Security Report section before adding it to your workflow.

How do I install mcp-slim-guard?

Clone the repository with "git clone https://github.com/lennney/mcp-slim-guard" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is mcp-slim-guard written in?

mcp-slim-guard is primarily written in TypeScript. It is open-source under lennney on GitHub, so you can review or fork the full source.

Are there alternatives to mcp-slim-guard?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh mcp-slim-guard against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI 智能体
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情