Mcpkernel

security MCP Server

The Security Kernel for AI Agents — MCP/A2A gateway with policy enforcement, taint tracking, sandboxed execution, deterministic envelopes, and Sigstore audit. OWASP ASI 2026 compliant.

VerifiedInstall Ready
securitysecurity
2 views1 stars0 forksApache-2.0

Why This Matters

Discovered via github-topic:model-context-protocol and last synced 3mo ago.

VerifiedInstall Ready
Source
github-topic:model-context-protocol
Stars
1
Last synced
3mo ago
Install
Instructions detected

Install

1. Install the package

pip install mcpkernel
14
Tools
0
Resources
0
Prompts
Standard I/O
Transport

Available Tools (14)

pem

key

Threat

How It Works

Command

Description

mcpkernel_scan_skill

Audit an OpenClaw/ClawHub SKILL.md for dangerous patterns

mcpkernel_discover_configs

Find all MCP configurations on the system

mcpkernel_check_taint

Check text for leaked secrets, PII, and API keys

mcpkernel_doctor

Run health diagnostics on the MCPKernel installation

Step

What MCPKernel Does

Integration

What It Does

mcpkernel_scan_tool

Scan a tool's description for poisoning, shadowing, and prompt injection

firecracker

wasm

mcpkernel_validate_policy

Validate a YAML policy file for syntax and logic errors

light

off policy: default_action: deny # deny-by-default for production policy_paths: - policies/owasp_asi_2026_strict.yaml observability: log_level: INFO metrics_enabled: true otlp_endpoint: "" # Set for OpenTelemetry export # Third-party integrations langfuse: enabled: false public_key: "" # Set via MCPKERNEL_LANGFUSE__PUBLIC_KEY secret_key: "" # Set via MCPKERNEL_LANGFUSE__SECRET_KEY guardrails_ai: enabled: false pii_validator: true secrets_validator: true toxic_content: false registry: enabled: true registry_url: https://registry.modelcontextprotocol.io agent_scan: enabled: true binary_name: agent-scan auto_generate_policy: true ``` Environment variable override: `MCPKERNEL_SANDBOX__BACKEND=wasm` --- ## Docker Deployment ```bash # Build and run docker compose up -d # With Prometheus monitoring docker compose --profile monitoring up -d ``` --- ## Development ```bash # Clone and install git clone https://github.com/piyushptiwari1/mcpkernel.git cd mcpkernel pip install -e ".[dev]" # Run tests (718 tests, ~86% coverage) pytest tests/ -v --cov=mcpkernel # Lint ruff check src/ tests/ ruff format src/ tests/ ``` --- ## Examples Integration examples for popular AI agent frameworks: - [LangChain](examples/langchain/) — route LangChain tool calls through MCPKernel - [CrewAI](examples/crewai/) — secure CrewAI agent tool usage - [AutoGen](examples/autogen/) — protect AutoGen multi-agent conversations - [Copilot Guard](examples/copilot_guard/) — intercept Copilot/Cursor tool calls - [mcp-agent](examples/mcp_agent/) — route mcp-agent framework through MCPKernel --- ## Planned — The Road to Agent Sovereignty ### 1. Inter-Agent Proof of Intent (Zero-Knowledge Tooling) Today agents trust the gateway. Tomorrow, **Agent A (Company X)** will call a tool on **Agent B (Company Y)** — across organizational boundaries. - **Problem:** How does Agent B verify that Agent A's call was authorized by a specific policy without revealing the underlying data? - **Plan:** Add a **ZK-Policy module** to MCPKernel. Agents will produce zero-knowledge proofs of policy compliance, enabling cross-org tool calls with cryptographic "sovereignty" — no private code or data is ever exposed. ### 2. Physical-World Safety Layer (Robotic MCP) As MCP expands into IoT and Robotics (Digital Twins), the "sandbox" isn't just a VM — it's a **physical constraint**. - **Problem:** If an agent calls `move_arm()`, the gateway must simulate the physics impact before allowing the tainted command to reach the actuator. - **Plan:** Deterministic execution for hardware — a **physics-aware sandbox** that models real-world consequences (collision, force limits, safety envelopes) before any command reaches a physical device. ### 3. Automated Red-Teaming ("Immune System" Mode) Instead of being a passive gatekeeper, the gateway should **attack itself**. - **Problem:** New prompt injection techniques and policy bypasses appear daily. Static rules can't keep up. - **Plan:** A **Shadow LLM module** that continuously attempts prompt injections against MCPKernel's own policies in real-time, discovering 0-day vulnerabilities in agent logic before adversaries do. ### 4. Parallel Taint Analysis (Cold-Start Latency < 50 ms) In 2026, latency is everything. If the gateway adds more than 50 ms to a tool call, developers will disable it. - **Plan:** Run taint sink checking **concurrently** with code execution rather than sequentially — analyze while the sandbox is running, abort only if a violation is detected, keeping the hot path near zero additional latency. ### 5. Context Minimization as a Cost Weapon Security matters, but **saving money sells faster**. The `context/` module already prunes tokens via TF-IDF + AST analysis. - **Plan:** Productize context minimization to deliver **≥ 30 % token reduction** while maintaining safety guarantees. When the gateway pays for itself in reduced LLM costs, adoption becomes a no-brainer. --- ## Competitive Landscape MCPKernel is a **runtime security gateway + agent-callable security toolkit** — it sits in the live request path intercepting every tool call AND exposes security tools that agents can call directly. This is fundamentally different from the scanners, config auditors, and personal AI assistants in the ecosystem:

What

How