building-mcp-serverslisted
Install: claude install-skill cyberreinxy/mcp-server-skill
# 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