Get the FREE Ultimate OpenClaw Setup Guide →

AI-agent-security

A Model Context Protocol (MCP) server that provides security functionality for AI agents, focusing on detecting and redacting sensitive information in text content.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio kalinyorgov-ai-agent-security-mcp python mcpsecurity/mcp_server.py

How to use

The AI Agent Security MCP server provides local, privacy-conscious tools to analyze text for sensitive information. It offers detection of sensitive data patterns (like passwords, API keys, emails, and phone numbers), automatic redaction to mask or remove such data, and safety-validation checks to ensure content meets privacy and security requirements. The server is designed to run entirely on your machine, leveraging configurable regex patterns to tailor detection to your use case. You can integrate its capabilities into your agent pipelines to pre-screen content before sharing or processing further, and to assist with auditing and compliance tasks. To use it, run the MCP server locally and interact with its API surface through the MCP SDK where you can submit text for analysis, receive detection results, and apply redaction or validation actions as needed.

How to install

Prerequisites:

  • Python 3.10+
  • MCP Python SDK (install via pip: pip install mcp-sdk)

Installation steps:

  1. Clone the repository: git clone <repository-url> cd Agent-Security-MCP

  2. (Optional) Create and activate a virtual environment: python -m venv venv

    On Windows

    venv\Scripts\activate.bat

    On macOS/Linux

    source venv/bin/activate

  3. Install required Python dependencies (if a requirements file is provided): pip install -r requirements.txt # if present

    Or ensure the MCP SDK is installed

    pip install mcp-sdk

  4. Run the MCP server for testing: python mcpsecurity/test_server.py

  5. Run the actual server: python mcpsecurity/mcp_server.py

Notes:

  • Ensure Python 3.10+ is used as required by the project.
  • The project relies on the MCP Python SDK for client interactions and wiring with the MCP runtime.

Additional notes

Tips and considerations:

  • The server operates locally, preserving privacy by processing content on-device.
  • It supports configurable regex patterns for detection; customize patterns to fit your data governance policies.
  • If you encounter issues starting the server, verify Python version, virtual environment activation, and that MCP SDK is installed.
  • Typical environment variables are related to configuration tuning (for example, pattern sources, redaction rules, or log levels) – you can add these as needed in your runtime environment or a config file.
  • When integrating with Claude or other clients, follow the project’s README guidance for configuring Claude Desktop (refer to mcpsecurity/README.md) to ensure correct API surface usage.

Related MCP Servers

Sponsor this space

Reach thousands of developers