building-mcp-servers

building-mcp-servers is a skill for Claude Code, Codex from cyberreinxy/mcp-server-skill. It costs 160 tokens per session (2,255 once invoked), scanned A, original, MIT.

A practical guide for building MCP servers, which let AI agents use tools, access data, and follow reusable prompts. It focuses especially on servers connected to databases such as Postgres.

In plain words
What is it for?
Use it when designing, building, securing, reviewing, or debugging an MCP server that connects an AI agent to a database or API.
Why use it?
It helps avoid common server problems such as unsafe SQL, outdated database information, unpinned installations, leaked error details, and oversized changes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code.

Good fit Use it when designing, building, securing, reviewing, or debugging an MCP server that connects an AI agent to a database or API.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cyberreinxy/mcp-server-skill/building-mcp-servers
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 cyberreinxy/mcp-server-skill --skill building-mcp-servers
Clone the repo
git clone --depth 1 https://github.com/cyberreinxy/mcp-server-skill

Made for: Claude Code, Codex.

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 building-mcp-servers

README.md
[![agentmods](https://agentmods.dev/badge/skills/cyberreinxy/mcp-server-skill/building-mcp-servers/github.svg)](https://agentmods.dev/skills/cyberreinxy/mcp-server-skill/building-mcp-servers)
Your own site
<a href="https://agentmods.dev/skills/cyberreinxy/mcp-server-skill/building-mcp-servers"><img src="https://agentmods.dev/badge/skills/cyberreinxy/mcp-server-skill/building-mcp-servers/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 building-mcp-servers

Your own site · 80×15
<a href="https://agentmods.dev/skills/cyberreinxy/mcp-server-skill/building-mcp-servers"><img src="https://agentmods.dev/badge/skills/cyberreinxy/mcp-server-skill/building-mcp-servers.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 160 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,255 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.00160 $0.02255
Opus 5 $0.00080 $0.01128
Sonnet 5 $0.00032 $0.00451
Haiku 4.5 $0.00016 $0.00226

Measured 11d ago against content hash 79e9c130aa0e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

building-mcp-servers 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 11d 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.

skill/building-mcp-servers/SKILL.md · 107 lines

How it starts

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

Building MCP Servers

A practical, security-first guide to building Model Context Protocol (MCP) servers — servers that expose tools, resources, and prompts to AI agents like Claude. Written with a database-first lens (Postgres especially), because that's where most of the sharp edges live, but the architecture section applies to any MCP server.

This skill exists because most "MCP server tutorials" stop at npx create-mcp-server and a toy add(a, b) tool. Real MCP servers — the kind that touch a production database — fail in specific, recurring ways: unparameterized SQL, stale schema caches, install scripts that aren't pinned, stack traces leaked to the client, and scope creep in PRs that bundle an unrequested dashboard into a "security fix." This skill encodes the fixes for all of those.

Step 0: Figure out what's actually being asked

Before writing code, classify the task — it changes what you read next:

Task Go to
Building a new MCP server from scratch Sections 1–4, then the relevant reference file
Adding a tool/resource to an existing server Section 2
Server touches a SQL database references/postgres-database-servers.md (do this even if the user didn't ask about security — read it first)
Reviewing a PR or contributor patch to an MCP server references/security-review-checklist.md
Testing, packaging, or getting the server into Claude Desktop/Claude Code references/testing-and-distribution.md
Something's failing silently or the client can't see the server references/debugging.md

Don't skip the security reference just because the user only asked for a feature. Database MCP servers are agent-facing and internet-facing in ways normal backend code isn't — an LLM will construct arbitrary queries against your tools, including adversarial ones from prompt-injected content it read elsewhere.

1. Core protocol model

MCP servers expose three primitive types over a JSON-RPC transport. Get this taxonomy right before writing any code — most bad MCP servers are bad because they use the wrong primitive.

Read the full file on GitHub · 107 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 11d ago First seen · 107 lines · 160 tokens per session scan A 79e9c130aa0e

Subscribe to this mod's changes

building-mcp-servers is a skill published in the GitHub repository cyberreinxy/mcp-server-skill (1 stars, last pushed 1mo ago), licensed MIT. It adds 160 tokens to every session and 2,255 once invoked, about $0.0008 per session on Opus 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-08-31.

Related

Other skills, from other repositories

api-security

Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication, authorization, rate-limit, and CI/CD testing.

xAmirHamza77/ReverseOps-Skill · 36 tokens

protocol-reverse

Use for authorized reverse engineering of custom binary protocols, Protobuf/gRPC, WebSocket frames, and PCAP-driven protocol recovery.

xAmirHamza77/ReverseOps-Skill · 30 tokens

competition-graphql-rpc-drift

Internal downstream skill for ctf-sandbox-orchestrator. CTF-sandbox workflow for GraphQL schemas, persisted queries, RPC manifests, generated clients, OpenAPI drift, hidden operations, and contract-to-handler mismatches. Use when the user asks to inspect GraphQL or RPC requests, compare client contracts to live…

xAmirHamza77/ReverseOps-Skill · 114 tokens

competition-queue-worker-drift

Internal downstream skill for ctf-sandbox-orchestrator. CTF-sandbox workflow for queues, async workers, cron jobs, delayed tasks, retry behavior, worker-only config drift, and payload-to-side-effect chains. Use when the user asks to trace a queue payload, inspect async job execution, explain worker-only behavior…

xAmirHamza77/ReverseOps-Skill · 121 tokens

competition-template-render-path

Internal downstream skill for ctf-sandbox-orchestrator. CTF-sandbox workflow for SSR, template rendering, route loaders, hydration payloads, server-client render boundaries, and template-to-handler enforcement gaps. Use when the user asks to inspect SSR or template routes, trace render context or hydration data…

xAmirHamza77/ReverseOps-Skill · 111 tokens

competition-websocket-runtime

Internal downstream skill for ctf-sandbox-orchestrator. CTF-sandbox workflow for WebSocket and SSE handshakes, auth material, subscription state, realtime message schemas, reconnect behavior, and frame-driven runtime effects. Use when the user asks to inspect a WebSocket or SSE handshake, decode frames, trace…

xAmirHamza77/ReverseOps-Skill · 114 tokens