agentsclimarketplace

Secure mcp server

Skill m00kk/agent-skills-playbook/skills/secure-mcp-server

15 production Agent Skills — MCP, LangGraph, RAG, security, Cursor SDK. MIT licensed.

Install
npx -y skills add m00kk/agent-skills-playbook --skill secure-mcp-server

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Hardens MCP servers with OAuth, scoped tools, input validation, and safe defaults. Use when securing MCP, adding authentication, preventing tool abuse, or reviewing MCP security before production.

SKILL.md

1.8 KB, 381 tokens by cl100k_base, as published. Nobody here has run it

Secure MCP Server

Threat model (agent context)

RiskMitigation
Prompt injection → tool abuseScoped tools, human approval for writes
Over-broad toolsSplit read vs write tools; deny by default
Credential exfilNever return env; mask tokens in logs
SSRF via URL toolsAllowlist hosts; block private IP ranges

Workflow

  1. Inventory tools — classify: read / write / admin / network
  2. Apply least privilege — remove unused tools; narrow parameters
  3. Auth layer — remote servers: OAuth 2.1 + PKCE; local: OS user boundary only
  4. Validation — max length, enum fields, regex for IDs
  5. Audit — log tool name + args hash (not secrets)

OAuth pattern (remote HTTP)

  • Register client with redirect URI
  • Store refresh tokens server-side only
  • Pass short-lived access tokens per request scope
  • Document required scopes in README

Destructive operations

Require one of:

  • Separate *_confirm tool that needs explicit confirmed: true
  • Client-side approval (Cursor user confirms)
  • Idempotency keys for retried writes

Review commands

Run from repo root (adjust paths):

# Find dangerous patterns
rg -n 'subprocess|os\.system|eval\(|exec\(|shell=True' --glob '!node_modules'
rg -n 'password|secret|api_key|token' --glob '!.env.example'

Pass criteria

  • No tool returns full filesystem or env
  • Network tools use allowlists
  • Write tools documented and gated
  • Security section in README

See build-mcp-server for implementation scaffolding.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.