hardened-mcp-server
Provides an example identity provider setup and deployment configuration for a Keycloak-issued OAuth 2.1 access token: the server acts as a resource server, validating JWT access tokens (signature, pinned issuer, audience bound to the server, required claims) so tools can be called with tokens minted by a Keycloak realm.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
hardened-mcp-server
A small Model Context Protocol server in Python that exists to show what a secure MCP server looks like in practice: every security control is a behavior with a test, mapped to the authorization specification, and the tests themselves are checked by deliberately breaking each control.
The domain is a read-mostly "security findings" service (list, get, search, and add a triage note), with fictional data. The point is not the findings; it is the controls around them.
Personal project. Not official guidance from, or the position of, any employer or vendor. The identity provider example is just an example.
What it demonstrates
Area | What is implemented | Where |
Authentication | OAuth 2.1 resource server: JWT validation with algorithm allow-list, pinned issuer, required claims, audience bound to this server (RFC 8707), key confusion and |
|
Discovery | RFC 9728 protected resource metadata, correct |
|
Authorization | Per-tool scopes, step-up for the write scope, scope hierarchy, deny by default for unknown methods and tools, handlers re-check (defense in depth), object-level team isolation with no existence oracle |
|
Transport hygiene | Host and Origin checks (DNS rebinding), POST only, content type, declared and streamed body caps, strict JSON-RPC shape, routing headers must match the body and are never trusted |
|
Untrusted data | Free text from findings is treated as hostile: invisible and bidi characters stripped, markup defanged, per-response random boundary and notice |
|
Tool integrity | Tool descriptions are static, linted, hashed and pinned; the server will not start if a tool lacks an access policy |
|
Accountability | Hash-chained audit log that never records tokens or note contents; per-principal rate limit |
|
Verification | 268 tests, a spec-conformance map, and a mutation check that breaks 45 controls and requires the suite to notice |
|
Related MCP server: Code Mender Triage MCP Server
Start here
docs/THREAT-MODEL.md: what it defends against, and, just as important, what it does not.docs/SPEC-CONFORMANCE.md: each requirement of MCP revision 2026-07-28 mapped to code and tests.docs/VALIDATION.md: what was run, what was found, and what was not validated (no live client, no live identity provider).docs/DEPLOYMENT.mdanddeploy/keycloak: configuration and an example identity provider setup.
Run the tests
python -m venv .venv && . .venv/bin/activate
pip install -r requirements-dev.txt
pytest
python tools/mutation_check.py # about a minute on two coresPython 3.11 and 3.13 are covered in CI. Requires Python 3.10 or newer (the SDK's minimum).
Run the server
The server is configured through HMCP_* environment variables (see docs/DEPLOYMENT.md) and refuses to start with an unsafe configuration. It listens on loopback and expects a TLS-terminating proxy in front for anything else.
Related
Part of a small set of vendor-neutral security projects: agent-security-evals (testing agents against attacks) and claude-code-governance (managed-settings policy for coding agents, with a linter and tests).
MIT licensed. Built with the help of an AI coding assistant; reviewed, tested and owned by the author.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Search security findings and contribute versioned, evidence-backed reproduction reports.
Read-only vulnerability intelligence: CVEs, exploitation evidence, fixes and product matches.
Read-only MCP security data: check catalogue, public scan status and your own scan reports.
Read-only access to your Auditon vulnerability scans: findings, endpoints, reports and changes.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables triage of SAST findings by exposing a read-only MCP server with tools to access hash-verified source-to-sink code slices, unguarded sinks, and layered enrichment for local LLM analysis.10MIT
- FlicenseNot gradedqualityBmaintenanceEnables MCP clients to query and triage security findings published to BigQuery and correlate them with execution, sandbox, and diagnostic traces in Cloud Logging. Exposes tools, resources, and prompts for filtering issues by severity, status, repository, or CWE, retrieving patch diffs and verification results, and diagnosing why a remediation or verification run failed.-
- AlicenseNot gradedqualityBmaintenanceEnables MCP clients to carry out a compliant, non-destructive, auditable authorized security-testing workflow — project intake, scope reading, asset discovery, non-destructive verification, evidence collection, and report-draft generation with manual submission tracking — where every outbound action is gated by scope checks, one-time human confirmation tokens, rate limits, and append-only audit logging.MIT
- AlicenseBqualityBmaintenanceA read-only Model Context Protocol server that exposes DefectDojo API v2 findings to AI agents, enabling vulnerability triage across products and drafting of self-contained tracker issues. It provides tools to list products, filter findings by severity, group critical findings by unique vulnerability, and fetch full finding details.7Apache 2.0