Borrowing it
Nothing to install: this file belongs to enkryptai/secure-mcp-gateway. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/enkryptai/secure-mcp-gateway/main/CLAUDE.mdgit clone --depth 1 https://github.com/enkryptai/secure-mcp-gatewayWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/enkryptai/secure-mcp-gateway/claude-md)<a href="https://agentmods.dev/instructions/enkryptai/secure-mcp-gateway/claude-md"><img src="https://agentmods.dev/badge/instructions/enkryptai/secure-mcp-gateway/claude-md.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.13326 | $0.13326 |
| Opus 5 | $0.06663 | $0.06663 |
| Sonnet 5 | $0.02665 | $0.02665 |
| Haiku 4.5 | $0.01333 | $0.01333 |
Grade A, and why
secure-mcp-gateway CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories β prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency β measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing β 1,580 lines β stays where its author put it; the contents beside it link to each section on GitHub.
Secure MCP Gateway - Complete Project Analysis
Version: 2.1.2 Last Updated: 2026-05-17 Project Type: Python Security Middleware for Model Context Protocol (MCP)
π Project Overview
Secure MCP Gateway is an Enkrypt AI-developed security middleware that sits between MCP clients (like Claude Desktop, Cursor) and MCP servers. It acts as both an MCP server (to clients) and an MCP client (to actual servers), providing:
- Authentication & Authorization
- OAuth 2.0/2.1 Support (Client credentials, mTLS, token management)
- Dynamic Tool Discovery
- Guardrails (Input/Output protection)
- Caching (Local & External Redis/KeyDB)
- Observability (OpenTelemetry, Prometheus, Grafana)
- RESTful API for management
ποΈ Project Structure
secure-mcp-gateway/
βββ src/secure_mcp_gateway/
β βββ __init__.py # Package initialization
β βββ version.py # Version: "2.1.2"
β βββ consts.py # Constants and defaults
β βββ utils.py # Utilities, lazy logger, masking
β βββ dependencies.py # Package dependencies list
β β
β βββ gateway.py # β Main MCP server (FastMCP)
β βββ client.py # β MCP client to actual servers
β βββ cli.py # β CLI interface (huge file)
β βββ api_server.py # FastAPI REST API server (port 8001)
β βββ api_routes.py # Additional API routes
β βββ api_cache_routes.py # REST cache flush endpoints (port 8001)
β βββ api_health_routes.py # REST health endpoints (port 8001)
β βββ gateway_cache_routes.py # MCP gateway cache flush endpoints (port 8000)
β β
β βββ error_handling.py # Standardized error handling
β βββ exceptions.py # Custom exception classes
β β
β βββ plugins/ # π Plugin system
β β βββ plugin_loader.py # Dynamic plugin discovery
β β βββ provider_loader.py # Provider loading utilities
β β β
β β βββ auth/ # Authentication plugins
β β β βββ base.py # AuthProvider abstract class
β β β βββ config_manager.py # Auth plugin manager
β β β βββ enkrypt_provider.py # Enkrypt remote auth
β β β βββ example_providers.py # Local API key provider
β β β
β β βββ guardrails/ # Guardrail plugins
β β β βββ base.py # GuardrailProvider abstract class
β β β βββ config_manager.py # Guardrail plugin manager
β β β βββ enkrypt_provider.py # Enkrypt guardrail API
β β β βββ example_providers.py # OpenAI, Custom keyword providers
β β β
β β βββ telemetry/ # Telemetry plugins
β β βββ base.py # TelemetryProvider abstract class
β β βββ config_manager.py # Telemetry plugin manager
β β βββ opentelemetry_provider.py # OpenTelemetry OTLP
β β βββ example_providers.py # Stdout provider
β β
β βββ services/ # π― Service layer
β β βββ cache/
β β β βββ cache_service.py # Core cache operations
β β β βββ cache_management_service.py # Clear cache
β β β βββ cache_status_service.py # Cache statistics
β β β
β β βββ discovery/
β β β βββ discovery_service.py # Tool discovery service
β β β
β β βββ execution/
β β β βββ secure_tool_execution_service.py # With guardrails
β β β βββ tool_execution_service.py # Basic execution
β β β βββ execution_utils.py # Utilities
β β β
β β βββ oauth/ # π OAuth 2.0/2.1 service
β β β βββ oauth_service.py # Core OAuth implementation
β β β βββ token_manager.py # Token caching & refresh
β β β βββ integration.py # Client integration
β β β βββ models.py # OAuth data models
β β β βββ validation.py # Scope & token validation
β β β βββ metrics.py # OAuth metrics tracking
β β β
β β βββ server/
β β β βββ server_listing_service.py # List all servers
β β β βββ server_info_service.py # Server details
β β β
β β βββ timeout/
β β βββ timeout_manager.py # Timeout management
β β
β βββ bad_mcps/ # π§ͺ Test MCP servers (security testing)
β β βββ echo_mcp.py # Simple echo server
β β βββ echo_oauth_mcp.py # OAuth header testing server
β β βββ bad_mcp.py # Multiple attack vectors
β β βββ bad_output_mcp.py # Malicious output testing
β β βββ command_injection_mcp.py # Command injection scenarios
β β βββ credential_theft_mcp.py # Credential theft attacks
β β βββ mpma_mcp.py # Multi-parameter manipulation
β β βββ path_traversal_mcp.py # Path traversal attacks
β β βββ prompt_injection_mcp.py # Prompt injection attacks
β β βββ rce_mcp.py # Remote code execution
β β βββ resource_exhaustion_mcp.py # DoS/resource exhaustion
β β βββ schema_poisoning_mcp.py # Schema manipulation
β β βββ session_management_mcp.py # Session attacks
β β βββ ssrf_mcp.py # Server-side request forgery
β β βββ tool_poisoning_mcp.py # Tool definition attacks
β β βββ unauthenticated_access_mcp.py # Auth bypass scenarios
β β
β βββ example_enkrypt_mcp_config.json # Example configuration
β
βββ observability/ # Observability stack -- TWO backends, run one
β βββ docker-compose.opensearch.yml # OpenSearch/Data Prepper stack (PRIMARY; OTLP host :4317/:4318)
β βββ docker-compose.grafana.yml # Grafana/Prometheus/Loki/Jaeger stack (legacy; OTLP host :4327/:4328)
β βββ .env.opensearch.example # env template -> copy to .env.opensearch
β βββ .env.grafana.example # env template -> copy to .env.grafana
β βββ README.opensearch.md # OpenSearch stack operator guide
β βββ README.md # Grafana stack operator guide
β βββ emit_dummy_telemetry.py # synthetic OTLP emitter (dashboard/monitor verification)
β βββ opensearch/ # bootstrap.sh + ISM policy / templates / monitors / channel
β β βββ bootstrap.sh # idempotent installer (policy, templates, data streams, monitors, local user)
β β βββ policies/ # gateway_telemetry_policy.json (7d hot->delete, prio 1000)
β β βββ templates/ # gateway-{metrics,traces,logs}-elastic-template.json (SS4O data streams)
β β βββ monitors/ # 01..09 bucket-level alerting monitors
β β βββ notification_channels/ # slack-mcpgw-alerts.json
β βββ opensearch_dashboards/ # saved-objects.ndjson + gateway-dashboards.ndjson (13 viz + 3 dashboards)
β βββ data_prepper/ # pipelines.yaml + render_pipelines.py (+ unit tests) + config
β βββ otel_collector/ # otel-collector-config.yaml (Grafana) + .opensearch.yaml (OpenSearch)
β βββ grafana/ # Grafana dashboards + alert provisioning
β βββ prometheus/ # Prometheus scrape config
β βββ loki/ # Loki log-aggregation config
β βββ promtail/ # Promtail config
β
β NOTE: the apiaas repo is canonical for the OpenSearch resources;
β observability/opensearch{,_dashboards}/ is a vendored mirror kept in
β sync by scripts/install/opensearch/sync-check.sh (see apiaas repo).
β
βββ docs/ # Documentation
β βββ claude/
β β βββ k8s-deployment-runbook.md # β EKS dev/prod deploy runbook (manual today)
β βββ secure-mcp-gateway-manifest.yaml # LIVE dev manifest (gitignored -- holds creds)
β βββ secure-mcp-gateway-manifest-example.yaml # tracked template for the above
βββ pyproject.toml # Python project config (PEP 621)
βββ requirements.txt # Pinned runtime deps
βββ Dockerfile / Dockerfile-Base # Container build
βββ README.md # Main documentation
βββ CHANGELOG.md # Version history
βββ CLI-Commands-Reference.md # CLI documentation
βββ API-Reference.md # API documentation
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen Β· 1,580 lines Β· 13,326 tokens per session scan A 0b96c60d0a04
secure-mcp-gateway CLAUDE.md is an instructions file published in the GitHub repository enkryptai/secure-mcp-gateway (57 stars, last pushed 14d ago), licensed Apache-2.0. It adds 13,326 tokens to every session, about $0.0666 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart β add a new integration in 5 steps, integration architecture and integrationmanifest β file tracking.