Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"mcp-hooks": {
"args": [
"-y",
"pnpm"
],
"command": "npx"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
A middleware layer for the Model Context Protocol (MCP) that enables monitoring, validation, and transformation of AI tool interactions.
Run this in your terminal to verify the server starts. Then let us know if it worked — your result helps other developers.
npx -y 'pnpm' 2>&1 | head -1 && echo "✓ Server started successfully"
After testing, let us know if it worked:
Five weighted categories — click any category to see the underlying evidence.
pnpm has Path Traversal via arbitrary file permission modification
### Summary When pnpm processes a package's `directories.bin` field, it uses `path.join()` without validating the result stays within the package root. A malicious npm package can specify `"directories": {"bin": "../../../../tmp"}` to escape the package directory, causing pnpm to chmod 755 files at arbitrary locations. **Note:** Only affects Unix/Linux/macOS. Windows is not affected (`fixBin` gated by `EXECUTABLE_SHEBANG_SUPPORTED`). ### Details Vulnerable code in `pkg-manager/package-bins/src
pnpm: Binary ZIP extraction allows arbitrary file write via path traversal (Zip Slip)
### Summary A path traversal vulnerability in pnpm's binary fetcher allows malicious packages to write files outside the intended extraction directory. The vulnerability has two attack vectors: (1) Malicious ZIP entries containing `../` or absolute paths that escape the extraction root via AdmZip's `extractAllTo`, and (2) The `BinaryResolution.prefix` field is concatenated into the extraction path without validation, allowing a crafted prefix like `../../evil` to redirect extracted files outsid
pnpm has Windows-specific tarball Path Traversal
### Summary A path traversal vulnerability in pnpm's tarball extraction allows malicious packages to write files outside the package directory on Windows. The path normalization only checks for `./` but not `.\`. On Windows, backslashes are directory separators, enabling path traversal. **This vulnerability is Windows-only.** ### Details **1. Incomplete Path Normalization (`store/cafs/src/parseTarball.ts:107-110`)** ```typescript if (fileName.includes('./')) { fileName = path.posix.join('/'
pnpm scoped bin name Path Traversal allows arbitrary file creation outside node_modules/.bin
### Summary A path traversal vulnerability in pnpm's bin linking allows malicious npm packages to create executable shims or symlinks outside of `node_modules/.bin`. Bin names starting with `@` bypass validation, and after scope normalization, path traversal sequences like `../../` remain intact. ### Details The vulnerability exists in the bin name validation and normalization logic: **1. Validation Bypass (`pkg-manager/package-bins/src/index.ts`)** The filter allows any bin name starting wit
pnpm has symlink traversal in file:/git dependencies
### Summary When pnpm installs a `file:` (directory) or `git:` dependency, it follows symlinks and reads their target contents without constraining them to the package root. A malicious package containing a symlink to an absolute path (e.g., `/etc/passwd`, `~/.ssh/id_rsa`) causes pnpm to copy that file's contents into `node_modules`, leaking local data. **Preconditions:** Only affects `file:` and `git:` dependencies. Registry packages (npm) have symlinks stripped during publish and are NOT affe
Click any tool to inspect its schema.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in developer-tools / security
A Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.
XcodeBuildMCP provides tools for Xcode project management, simulator management, and app utilities.
Asynchronous coordination layer for AI coding agents: identities, inboxes, searchable threads, and advisory file leases over FastMCP + Git + SQLite
MCP server for accessing Figma plugin console logs and screenshots via Cloudflare Workers or local mode
MCP Security Weekly
Get CVE alerts and security updates for Mcp Hooks and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
A middleware layer for the Model Context Protocol (MCP) that enables monitoring, validation, and transformation of AI tool interactions.
The Model Context Protocol (MCP) is a standard that allows AI assistants (like Claude) to interact with external tools and services. Think of it as a universal language that lets AI models:
When you use an AI assistant with MCP, it can perform real actions on your behalf, making it incredibly powerful for automation and productivity.
While MCP's power is exciting, it also raises important questions:
This is where hooks come in. Just like web applications use middleware to handle authentication, logging, and request processing, MCP can benefit from a similar pattern.
Our approach introduces a "passthrough server" that sits between the AI and the actual MCP tools:
AI Assistant ←→ Passthrough Server ←→ Target MCP Server
↓↑
[Hooks]
Here's what happens when the AI wants to use a tool:
1. Request: AI → Passthrough → Hook 1 → Hook 2 → ... → Target MCP Server
2. Response: AI ← Passthrough ← Hook 2 ← Hook 1 ← ... ← Target MCP Server
The passthrough server:
Each hook in the chain can:
Why do we need MCP-specific hooks? It's about separation of concerns and the unique challenges of LLM tool use.
The Core Problem: MCP servers are designed to do one thing well - provide tools. They shouldn't be cluttered with authentication logic, audit trails, or context-specific modifications. Additionally, OAuth (which MCP uses) lacks the granularity needed for LLM interactions - there's no way to express "allow file reads but only in the /docs folder" or "allow API calls but rate-limit based on content."
Example 1: LLM-Specific Guardrails
Your MCP file server provides simple file operations. But LLMs need different rules than human users:
Human user: Can precisely click on files they need
LLM: Might try to read entire directory trees to "be helpful"
Guardrail Hook: Limits directory traversal depth, prevents reading
binary files, and caps file sizes - rules that only make sense for LLMs
The MCP server stays simple, while the hook adds LLM-specific safety rails.
Example 2: Context-Dependent Tool Descriptions and Prompts
The same tool might need different descriptions for different use cases:
Standard fetch tool: "Retrieves web content"
In a research environment:
"Retrieves web content (academic sources preferred, checks Sci-Hub)"
In a corporate environment:
"Retrieves web content (internal wiki only, external sites blocked)"
The Custom Description Hook modifies tool descriptions based on your context - something the original MCP server can't and shouldn't handle.
Example 3: Forcing Transparency with Explain Hook
LLMs can use tools without explaining why. The Explain Hook adds a required "reason" parameter:
Without hook:
AI: execute_sql("DROP TABLE users")
With Explain Ho
... [View full README on GitHub](https://github.com/civicteam/mcp-hooks#readme)