harden-tool-url-inputs

harden-tool-url-inputs is a skill for Claude Code from microsoft/mcp. It costs 77 tokens per session (5,786 once invoked), scanned A, original, MIT.

A security implementation guide for checking user-influenced URLs before tools connect to them. It focuses on MCP tool directories and uses endpoint allow-lists for Azure services; SSRF means tricking a server into making an unintended request.

In plain words
What is it for?
Use it to audit and harden tool code that builds URLs, hosts, or client endpoints from MCP inputs.
Why use it?
It helps prevent URL hijacking and SSRF by checking the final destination rather than trusting an earlier input. It also requires tests for the changes within the requested tool directories.

Skill for Claude Code ✓ vendor

Written for Claude Code: disable-model-invocation in frontmatter.

Good fit Use it to audit and harden tool code that builds URLs, hosts, or client endpoints from MCP inputs.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/microsoft/mcp/harden-tool-url-inputs
About the project

microsoft/mcp is a repository of Microsoft’s Model Context Protocol server implementations, which let AI applications connect to data sources and tools through a shared client-server interface. It supports Microsoft MCP server contributors and the catalogue entries are add-ons for working with these servers.

microsoft/mcp · 3,800 stars · on GitHub

Install

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.

Any agent
npx skills add microsoft/mcp --skill harden-tool-url-inputs
Clone the repo
git clone --depth 1 https://github.com/microsoft/mcp

Made for: Claude Code.

Wrote 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.

agentmods badge for harden-tool-url-inputs

README.md
[![agentmods](https://agentmods.dev/badge/skills/microsoft/mcp/harden-tool-url-inputs/github.svg)](https://agentmods.dev/skills/microsoft/mcp/harden-tool-url-inputs)
Your own site
<a href="https://agentmods.dev/skills/microsoft/mcp/harden-tool-url-inputs"><img src="https://agentmods.dev/badge/skills/microsoft/mcp/harden-tool-url-inputs/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.

agentmods 80×15 button for harden-tool-url-inputs

Your own site · 80×15
<a href="https://agentmods.dev/skills/microsoft/mcp/harden-tool-url-inputs"><img src="https://agentmods.dev/badge/skills/microsoft/mcp/harden-tool-url-inputs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,786 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00077 $0.05786
Opus 5.5 $0.00031 $0.02314
Sonnet 5.5 $0.00015 $0.01157
Haiku 4.5 $0.00008 $0.00579

Measured 12d ago against content hash 38e57d6ca8e1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

harden-tool-url-inputs 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 12d 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.

.github/skills/harden-tool-url-inputs/SKILL.md · 355 lines

How it starts

The opening of the file, as written. The whole thing — 355 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Harden Tool URL Inputs

Audit and update every requested directory so MCP-influenced values cannot hijack a URL, URI, host, or client endpoint. Use IAzureService forwarding methods or the host's injectable IEndpointValidator at the final URL boundary, with the configured Azure cloud and the narrowest appropriate allow-list.

This is a scoped implementation skill, not a report-only audit. Make the fixes and add tests unless the user explicitly requests analysis only.

Required Input and Scope

  1. Accept one or many repository-relative directories under tools/.
  2. Resolve every path and confirm it is inside the repository's tools/ directory. Reject files or directories outside that boundary.
  3. If no directory is supplied, ask the user for at least one. If a supplied path does not exist or its intended scope is ambiguous, ask before editing.
  4. Treat each supplied directory as an exhaustive scope. Do not stop after finding the first vulnerable URL flow.
  5. Do not modify other tool directories. Shared changes to core/Microsoft.Mcp.Core/src/Helpers/EndpointValidator.AllowLists.cs and its tests are allowed when a scoped tool needs a new Azure service allow-list.
  6. Preserve unrelated worktree changes. Read the repository and nearest scoped instructions before editing.

Pattern Sources

Before implementing, inspect the current versions of:

  • core/Microsoft.Mcp.Core/src/Helpers/IEndpointValidator.cs
  • core/Microsoft.Mcp.Core/src/Helpers/EndpointValidator.cs
  • core/Microsoft.Mcp.Core/src/Helpers/EndpointValidator.AllowLists.cs
  • core/Azure.Mcp.Core/src/Services/Azure/IAzureService.cs
  • core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Core.Tests/Helpers/EndpointValidatorTests.cs
  • core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Helpers/AzureServiceTestHelpers.cs

When wiring dependencies or testing namespace overrides, also inspect SsrfProtectionPolicy.cs, EndpointValidationServiceCollectionExtensions.cs, ICommandContextAccessor.cs, and EndpointValidationRegistrationTests.cs in their corresponding core projects. Read the executing-command-context guidance in CONTRIBUTING.md and transport boundaries in docs/design/HttpClientFactory.md.

Read the full file on GitHub · 355 lines

Changes

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.

  1. 12d ago Changed · +83 lines · +6 tokens per session 38e57d6ca8e1
  2. 22d ago First seen · 272 lines · 71 tokens per session scan A 9d3318c6fca5

Subscribe to this mod's changes

harden-tool-url-inputs is a skill published in the GitHub repository microsoft/mcp (3,800 stars, last pushed yesterday), licensed MIT. It adds 77 tokens to every session and 5,786 once invoked, about $0.0003 per session on Opus 5.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-10-03.

Related

Other skills, from other repositories

research-engineer

An uncompromising Academic Research Engineer. Operates with absolute scientific rigor, objective criticism, and zero flair. Focuses on theoretical correctness, formal verification, and optimal implementation across any required technology.

davila7/claude-code-templates · 43 tokens

tika-eval-compare

Compare extracts from two Tika builds over a corpus to detect regressions in content, encoding, exceptions, and embedded-document handling. Use for "compare before/after extracts", "eval this change against the corpus".

apache/tika · 50 tokens

cua-driver

Use Cua Driver for desktop or browser tasks that are awkward or unavailable through Bash/APIs, or when the user explicitly wants GUI interaction: app testing, visual bug reproduction, form filling, calendar entry, screenshots, and demo recording. Also covers Cua setup; not OpenAI Codex Computer Use or web research.

davidondrej/skills · 68 tokens

jetson-validate-image

Use after jetson-flash-image to run static BSP checks, on-target smoke/regression tests on a flashed DUT, or both. Not for build or flash steps. Triggers: validate bsp, on-target validation.

NVIDIA/skills · 50 tokens

atmos-validation

Validate Atmos projects, components, arbitrary JSON Schema inputs, EditorConfig, and GitHub Actions; use affected-file selection and native CI annotations.

cloudposse/atmos · 31 tokens

skill-benchmark

Benchmark AI skill effectiveness by measuring implementation quality against legacy constraints.

HoangNguyen0403/agent-skills-standard · 16 tokens