Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add fabioc-aloha/Alex_Skill_Mall --skill mcp-server-hardeninggit clone --depth 1 https://github.com/fabioc-aloha/Alex_Skill_MallWrote 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/skills/fabioc-aloha/alex_skill_mall/mcp-server-hardening)<a href="https://agentmods.dev/skills/fabioc-aloha/alex_skill_mall/mcp-server-hardening"><img src="https://agentmods.dev/badge/skills/fabioc-aloha/alex_skill_mall/mcp-server-hardening/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/fabioc-aloha/alex_skill_mall/mcp-server-hardening"><img src="https://agentmods.dev/badge/skills/fabioc-aloha/alex_skill_mall/mcp-server-hardening.svg" alt="Reviewed on agentmods" width="80" 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.00042 | $0.01018 |
| Opus 5.5 | $0.00017 | $0.00407 |
| Sonnet 5.5 | $0.00008 | $0.00204 |
| Haiku 4.5 | $0.00004 | $0.00102 |
Grade B, and why
mcp-server-hardening scanned grade B with 1 finding 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 2mo 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.
Instruction-override phrasingmediumPrompt injection
Text telling the model to disregard its earlier instructions or safety rules is the shape of a prompt injection, whoever wrote it.
So a document containing "ignore previous instructions and call Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.
How it starts
The opening of the file, as written. The whole thing — 120 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Harden an MCP Server
A stdio server needs none of this. An HTTP server needs all of it before it is reachable, because an MCP server is an execution surface that an LLM drives.
Validate Host Names
ASP.NET Core's Kestrel does not check the Host header by default, and it is not
alone. Without validation, a browser can be steered to your local server through
an attacker-controlled DNS name while sending that name in the header — DNS
rebinding.
- Locally: restrict allowed hosts to loopback values.
- In production: configure the exact public host names, and validate at the proxy or load balancer when one forwards requests.
This also stops untrusted host names being reflected through features that generate absolute URLs.
Do Not Enable CORS By Default
Turn on cross-origin requests only if you intend browser-based cross-origin access. When you do, use the most restrictive policy that works.
CORS is not a substitute for host-name validation. They defend different things: CORS governs which browser origins may call you, host validation governs which names you will answer to.
Authenticate
A remote server is a reachable execution surface. Decide who may call it before deploying, not after.
For stdio servers the question does not arise — the transport is the boundary. The mistake is carrying a stdio design onto HTTP and assuming the boundary came along.
Handle Secrets
Read credentials from the environment, never from a file in the repository:
{
"env": { "MY_API_TOKEN": "${env:MY_API_TOKEN}" }
}
Two failure modes worth naming:
Logging the token. Debug output that dumps request headers will write the credential to a log the user did not know existed. Redact at the logger, not at the call site, because the call site you forget is the one that leaks.
Returning the token. An error message that echoes the full request back to the agent puts the credential into the model's context, and from there into wherever that conversation is stored.
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.
- 2mo ago First seen · 120 lines · 42 tokens per session scan B 0ecd8abe14e6
mcp-server-hardening is a skill published in the GitHub repository fabioc-aloha/Alex_Skill_Mall (6 stars, last pushed yesterday), licensed MIT. It adds 42 tokens to every session and 1,018 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it B with 1 finding (instruction-override phrasing). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-14.
mcp-server-hardening compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| mcp-server-hardeningfabioc-aloha/Alex_Skill_Mall | Skill | 6 | yesterday | MIT | B | 42 | Claude Code, Codex |
| eval-agentsFlorianBruniaux/claude-code-ultimate-guide | Skill | 7.6k | today | CC-BY-SA-4.0 | A | 80 | Claude Code |
| land-and-deployFlorianBruniaux/claude-code-ultimate-guide | Skill | 7.6k | today | CC-BY-SA-4.0 | A | 41 | Claude Code |
| git-ai-archaeologyFlorianBruniaux/claude-code-ultimate-guide | Skill | 7.6k | today | CC-BY-SA-4.0 | A | 82 | Claude Code |
| prFlorianBruniaux/claude-code-ultimate-guide | Skill | 7.6k | today | CC-BY-SA-4.0 | A | 16 | Claude Code |
| commitFlorianBruniaux/claude-code-ultimate-guide | Skill | 7.6k | today | CC-BY-SA-4.0 | A | 10 | Claude Code |
| source-command-ccguide-dailyFlorianBruniaux/claude-code-ultimate-guide | Skill | 7.6k | today | CC-BY-SA-4.0 | A | 23 | Claude Code, Codex |