Skip to content
Back to skills

Mcp Server Security

ASecurity

Harden MCP servers against SSRF, path traversal, prompt injection, excessive capabilities, and missing audit logs

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
ai-agentsrustshellsecurity

Works with

  • mcp

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add AdityaaaTiwari/ANVIL --skill mcp-server-security --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mcp Server Security?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Mcp Server Security
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adityaaatiwari-mcp-server-security/badge)](https://www.skillsdirectory.com/skills/adityaaatiwari-mcp-server-security)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: Harden MCP servers against SSRF, path traversal, prompt injection, excessive capabilities, and missing audit logs
profile: standard
tags: mcp, security, agents, ai
---

# MCP server security

Use when designing, exposing, or auditing Model Context Protocol servers and tools.

## Least privilege and input safety
- Default tools to read-only operations and narrow JSON schemas (enums, max lengths, bounded pagination limits).
- Canonicalize file paths with `realpath` and reject paths outside the configured workspace root or matching `.env` / secret patterns.
- Validate outbound URLs against private IP ranges, loopback, and cloud metadata addresses (`169.254.169.254`) after DNS resolution to block SSRF.

## Isolation and auditability
- Treat external data returned by MCP tools as untrusted: mark boundaries clearly and never evaluate tool outputs as shell commands.
- Bind local HTTP/SSE transports to loopback with origin validation; require scoped auth tokens for remote MCP endpoints.
- Log every tool invocation with caller identity, duration, and outcome without logging secrets or raw credentials.

## Verify
Test traversal payloads, blocked secret reads, rejected schema violations, and audit log output cleanly.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.