agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what…
Use when building a Model Context Protocol server. Covers tool, resource, and prompt design, transport choice, authentication, error handling, and testing an MCP server against a real client. Trigger on "build an mcp server", "expose our api to claude", "the model keeps calling
Claude Code
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill mcp-server --agent claude-code
Codex
$ npx skills add nimadorostkar/Claude-Skills-collection --skill mcp-server -a codex -y
Cursor
$ npx skills add nimadorostkar/Claude-Skills-collection --skill mcp-server -a cursor -y
Gemini CLI
$ npx skills add nimadorostkar/Claude-Skills-collection --skill mcp-server -a gemini-cli -y
GitHub Copilot
$ npx skills add nimadorostkar/Claude-Skills-collection --skill mcp-server -a github-copilot -y
OpenCode
$ npx skills add nimadorostkar/Claude-Skills-collection --skill mcp-server -a opencode -y
Windsurf
$ npx skills add nimadorostkar/Claude-Skills-collection --skill mcp-server -a windsurf -y
name: mcp-server description: Use when building a Model Context Protocol server. Covers tool, resource, and prompt design, transport choice, authentication, error handling, and testing an MCP server against a real client. Trigger on "build an mcp server", "expose our api to claude", "the model keeps calling my mcp tool wrong". Do not use for packaging the server into a distributable plugin — see the plugin-development skill; for the agent loop that calls tools, see the agent-design skill. metadata: category: ai version: 1.0.0 tags: [mcp, tools, protocol, integration, agents]
Build an MCP server that a model can use correctly. The protocol is straightforward; the difficulty is designing a tool surface that a language model uses well, which is a different problem from designing an API for a programmer.
1. **Design around tasks, not endpoints** — Do not mirror your REST API one-to-one. A model needs `find_order_by_customer`, not `GET /orders` with fourteen optional query parameters. 2. **Write the description as if it were the prompt** — Because it is. State what the tool does, when to use it, when *not* to use it, and what it returns. This text determines whether the model uses the tool correctly. 3. **Constrain the inputs** — Enums, not free strings. Required parameters, not optional ones the model must guess. 4. **Return errors a model can act on** — What went wrong, and what to do instead. An error that names the valid values lets the model self-correct in one step. 5. **Keep responses compact** — Return what the model needs. A tool returning a 40 KB JSON blob spends the model's context on noise. 6. **Test as a client** — Not with unit tests on the handlers. Connect a real client and watch which tools the model picks and how it uses them. It will surprise you.
**A tool designed for a model:**
server.registerTool(
"find_orders",
{
title: "Find orders",
description: [
"Search for orders by customer, status, or date range.",
"",
"Use this when you do NOT already know the order ID. If you have an order ID,",
"use `get_order` instead — it is faster and returns the full detail including",
"line items and refund history.",
"",
"At least one filter is required. Returns up to 20 matches, most recent first,",
"with only the order ID, status, total, and customer email. Call `get_order`",
"with an ID from these results to see more.",
].join("\n"),
inputSchema: {
customerEmail: z.string().email().optional()
.describe("Exact email address. Partial matches are not supported."),
status: z.enum(["open", "paid", "shipped", "cancelled"]).optional()
.describe("Exact status. Use 'open' for orders not yet paid."),
placedAfter: z.string().date().optional()
.describe("ISO date (YYYY-MM-DD). Orders placed on or after this date."),
},
},
async ({ customerEmail, status, placedAfter }, { authInfo }) => {
if (!customerEmail && !status && !placedAfter) {
return {
isError: true,
content: [{
type: "text",
// Instructive, not merely accurate. The model can fix this on the next turn.
text: "At least one filter is required. Provide customerEmail, status, or placedAfter.",
}],
};
}
// Authorization is enforced here, against the authenticated principal —
// never against what the model claims.
const orders = await db.orders.search({
tenantId: authInfo.tenantId,
customerEmail, status, placedAfter,
limit: 20,
});
if (orders.length === 0) {
return { content: [{ type: "text",
text: "No orders matched. Try widening the date range or removing the status filter." }] };
}
// Compact: four fields per row, not the full object graph.
return {
content: [{
type: "text",
text: orders
.map((o) => `${o.id} | ${o.status} | ${(o.totalCents / 100).toFixed(2)} ${o.currency} | ${o.customerEmail}`)
.join("\n"),
}],
};
},
);**Resources for context the model should read, not call:**
// A re
A curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory,…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling,…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.