Get the FREE Ultimate OpenClaw Setup Guide →

tripwire

Context injection for AI agents, triggered by the codebase itself

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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
  1. 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", "."]
    }
  }
}
  1. 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", "."]
    }
  }
}
  1. Alternative: global install
npm install -g @tripwire-mcp/tripwire
  1. 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

Sponsor this space

Reach thousands of developers