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 1mo 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.
- 1mo 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 (5 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.
Other skills, from other repositories
apply-change-leadership
Use when a manager's team is experiencing a significant organizational change — restructuring, strategy shift, leadership change, layoffs, or major process transition — and needs leadership that maintains team stability, preserves trust, and converts uncertainty into direction.
apply-cross-functional-leadership
Use when a manager needs to lead a project or initiative that depends on team members or stakeholders they do not formally manage — to build voluntary cooperation, alignment, and momentum across organizational boundaries through influence rather than authority.
apply-distributed-team-practices
Use when managing a team where members work in different locations, time zones, or on hybrid schedules — to adapt management practices so remote members have equal access to information, relationships, and advancement opportunities as in-office members.
apply-grow-coaching
Use when a manager wants to help a direct report solve a problem, develop a skill, or reach a goal through structured questioning rather than advice-giving — because telling people answers builds dependency while coaching builds self-sufficiency.
apply-high-performer-retention
Use when a manager wants to proactively retain top-performing direct reports — because high performers have the most options to leave and require active, differentiated management attention to stay engaged and challenged.
apply-upward-influence
Use when a manager needs to build an effective working relationship with their own manager, secure resources or decisions for their team, or influence organizational priorities without formal authority over the outcome.