tripwire
Context injection for AI agents, triggered by the codebase itself
claude mcp add --transport stdio simonrueba-tripwire npx -y @tripwire-mcp/tripwire serve --project .
How to use
Tripwire is a local MCP server that injects relevant context when an agent reads files in your project. You define tripwires as YAML files placed under .tripwires/ in your repository, and the MCP server handles file read tool calls by glob-matching against those tripwire triggers. When a match is found, contextual information is prepended to the content the agent reads, enabling safer and more informed automation. The system operates deterministically and is repo-native; context can be inspected with tripwire explain, and agents can author new tripwires to improve behavior over time.
Tripwire speaks standard MCP over stdio, so you can integrate it with any MCP client. Start the server via npm/npx as described in the installation guide, then run your MCP client against the tripwire service. You can run in a local development setup or wire it into CI pipelines as part of your developer workflow. The documented setup includes both a quick try (using npx to serve from the project) and a team-oriented approach (pinning an install and sharing scripts) to ensure consistent versions across your team.
How to install
Prerequisites:
- Node.js >= 18
- NPM or PNPM/Yarn as preferred
- Quick start (no install):
- In your MCP config, reference the server with npx as shown in the Quick Try example:
{
"mcpServers": {
"tripwire": {
"command": "npx",
"args": ["-y", "@tripwire-mcp/tripwire", "serve", "--project", "."]
}
}
}
- Team setup (recommended):
- Install as a dev dependency so everyone uses the same version:
npm install --save-dev @tripwire-mcp/tripwire
- Add MCP scripts to package.json:
{
"scripts": {
"tripwire": "tripwire",
"tripwire:lint": "tripwire lint --strict",
"tripwire:doctor": "tripwire doctor"
}
}
- Point your local MCP config to the installed package (no -y needed):
{
"mcpServers": {
"tripwire": {
"command": "npx",
"args": ["tripwire", "serve", "--project", "."]
}
}
}
- Alternative: global install
npm install -g @tripwire-mcp/tripwire
- MCP client compatibility
- Tripwire communicates via standard MCP over stdio. For a complete working setup, see the examples directory provided in the repository (examples/hello-tripwire/).
Additional notes
Tips and gotchas:
- Prerequisites: Node.js >= 18 is required to run Tripwire.
- Tripwire relies on a local repository layout; place your .tripwires/ YAML files there to define triggers and contexts.
- The security section in the repository highlights the threat model: tripwires are a privileged instruction channel and should be protected with proper code review (e.g., CODEOWNERS) and CI checks. Avoid agent-authored or unreviewed tripwires with high sensitivity (e.g., CRITICAL).
- Path matching is performed against relative repo paths with micromatch; you can tune match_case in the configuration if you see casing mismatches on certain file systems.
- You can initialize a starter tripwire set with tripwire init and customize triggers, context, and severity to suit your policy.
- Use tripwire explain to review what context was injected for a given file read to ensure transparency and debuggability.
Related MCP Servers
Pare
Dev tools, optimized for agents. Structured, token-efficient MCP servers for git, test runners, npm, Docker, and more.
mcp-dock
A cross-platform MCP Server manager for Cursor, Claude, Windsurf, Zed & TRAE. Features one-click installation, multi-client sync, and a curated registry of Official & Smithery servers.
codebase-context
Local-first Second brain for AI agents working on your codebase - detects your team coding conventions and patterns, brings in persistent memory, code-generation checks, and hybrid search with evidence scoring. Exposed through CLI and MCP server.
shodan
Shodan MCP server for Claude, Cursor & VS Code. 20 tools for passive reconnaissance, CVE/CPE intelligence, DNS analysis, and device search. 4 tools work free without an API key. OSINT and vulnerability research from your IDE.
mongo
MCP server that provide tools to LLMs such as claude in cursor to interact with MongoDB
attio
Model Context Protocol server for Attio CRM - enables Claude Desktop and Cursor to interact with your Attio workspace