kindlyguard
v0.9.5
Published
Security-focused MCP server protecting against unicode attacks, injection threats, and other AI vulnerabilities
Maintainers
Readme
KindlyGuard
Security-focused MCP (Model Context Protocol) server that protects AI systems against unicode attacks, injection threats, and other vulnerabilities.
Features
- Unicode Attack Detection: Identifies hidden characters, BiDi overrides, and homograph attacks
- Injection Protection: Detects SQL, command, and code injection attempts
- Real-time Monitoring: Live threat detection and statistics
- MCP Integration: Works seamlessly with Claude Desktop and other MCP clients
- Cross-platform: Supports Linux, macOS (Intel & Apple Silicon), and Windows
Installation
npm install -g @kindlyguard/kindlyguardOr use directly with npx (no installation required):
npx @kindlyguard/kindlyguard --stdioQuick Start
As an MCP Server with Claude Desktop
- Add to your Claude Desktop configuration:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
- macOS:
{
"mcpServers": {
"kindlyguard": {
"command": "npx",
"args": ["@kindlyguard/kindlyguard", "--stdio"],
"env": {
"RUST_LOG": "info"
}
}
}
}- Restart Claude Desktop
- KindlyGuard will automatically protect your AI interactions
As an MCP Server with VS Code
Add to your VS Code settings:
{
"mcp.servers": {
"kindlyguard": {
"command": "npx",
"args": ["@kindlyguard/kindlyguard", "--stdio"],
"env": {
"RUST_LOG": "debug"
}
}
}
}Command Line Interface
# Start as MCP server (for Claude Desktop integration)
npx @kindlyguard/kindlyguard --stdio
# Scan a file for threats
npx @kindlyguard/kindlyguard scan suspicious.txt
# Scan text directly
npx @kindlyguard/kindlyguard scan "Hello\u202Eworld"
# Get JSON output
npx @kindlyguard/kindlyguard scan --format json data.json
# Check server status
npx @kindlyguard/kindlyguard status
# View help
npx @kindlyguard/kindlyguard --helpProgrammatic API
const kindlyguard = require('@kindlyguard/kindlyguard');
// Example 1: Start MCP server
const server = kindlyguard.create({ stdio: true });
const mcp = server.start();
// Send MCP messages
mcp.send({
jsonrpc: "2.0",
method: "initialize",
params: { protocolVersion: "0.1.0" },
id: 1
});
// Handle responses
mcp.onMessage((message) => {
console.log('Received:', message);
});
// Example 2: Quick threat scanning
const threats = await kindlyguard.scan('Hello\u202Eworld', {
format: 'json'
});
console.log('Threats found:', threats);
// Example 3: Custom server with events
const customServer = kindlyguard.create({
stdio: false,
shield: true,
onError: (error) => console.error('Server error:', error),
onExit: (code) => console.log(`Server exited: ${code}`)
});Configuration
KindlyGuard can be configured using a TOML file. Pass the config path with --config:
npx @kindlyguard/kindlyguard --stdio --config ./my-config.tomlExample kindly-guard.toml:
[server]
host = "127.0.0.1"
port = 3000
[security]
unicode_checks = true
injection_checks = true
max_input_size = "10MB"
rate_limit = 100 # requests per minute
[shield]
enabled = true
update_interval = "1s"
[resilience]
enhanced_mode = false # Enable advanced resilience featuresPlatform Support
KindlyGuard provides pre-built binaries for:
- Linux x64
- macOS x64 (Intel)
- macOS arm64 (Apple Silicon)
- Windows x64
The correct binary is automatically installed based on your platform.
Examples
See the examples/ directory for more usage examples:
claude_desktop_config.json- Claude Desktop configurationvscode_mcp_config.json- VS Code MCP configurationnodejs_usage.js- Node.js integration examples
Troubleshooting
KindlyGuard not starting
Check if the binary is installed:
npx @kindlyguard/kindlyguard statusEnable debug logging:
RUST_LOG=debug npx @kindlyguard/kindlyguard --stdioVerify your configuration file syntax
Claude Desktop not detecting KindlyGuard
- Ensure the config file is in the correct location
- Restart Claude Desktop after configuration changes
- Check Claude Desktop logs for errors
Building from Source
If you need to build from source:
git clone https://github.com/samduchaine/kindly-guard
cd kindly-guard
cargo build --releaseSecurity Features
Unicode Attack Detection
- Invisible characters (U+200B, U+200C, U+200D)
- Right-to-Left overrides (U+202E)
- Homograph attacks using similar-looking characters
- Zero-width characters and joiners
- Bidirectional text manipulation
Injection Prevention
- SQL injection patterns
- Command injection (shell commands)
- Code injection (JavaScript, Python)
- Path traversal attempts
- LDAP injection
- XSS patterns
Protection Mechanisms
- Real-time threat scanning
- Rate limiting and DoS prevention
- Request size limits
- Pattern-based detection
- Context-aware analysis
Performance
KindlyGuard is built with Rust for maximum performance:
- Near-zero overhead threat detection
- Lock-free statistics collection
- SIMD-optimized pattern matching
- Minimal memory footprint (<10MB)
- Sub-millisecond response times
License
Apache-2.0
