mcp-server
Skill28 starsChanged 5 months agoMITView on GitHub
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.
8 other projects use a version of this.
Adopted by
Most recently taken up by
- timsonner/agent-skillstheir own version, first seen Aug 30, 2026
- saschb2b/skillstheir own version, first seen Aug 8, 2026
- rrezartprebreza/spring-boot-skillstheir own version, first seen Aug 7, 2026
- Happy-Technologies-LLC/happy-platform-skillstheir own version, first seen Jul 28, 2026
- ivanshamaev/de-agent-skillstheir own version, first seen May 17, 2026
- prizmad/agent-skillstheir own version, first seen Apr 30, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- rrezartprebreza/spring-boot-skills★ 293same name
- Happy-Technologies-LLC/happy-platform-skills★ 40same name
- ivanshamaev/de-agent-skills★ 21same name
- saschb2b/skills★ 19same name
- DaleStudy/skills★ 4same name
- prizmad/agent-skills★ 2same name
- timsonner/agent-skills★ 2same name
- michaelsvanbeek/personal-agent-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository137 other files it gives its agents.
- agent-instructionsSkill
- agent-memorySkill
- hooksSkill
- plugin-developmentSkill
- skill-authoringSkill
- skill-reviewSkill
- slash-commandsSkill
- subagentsSkill
- agent-designSkill
- context-engineeringSkill
- fine-tuningSkill
- llm-cost-optimizationSkill
- llm-evaluationSkill
- llm-integrationSkill
- ml-pipelineSkill
- model-selectionSkill
- prompt-engineeringSkill
- ragSkill
- structured-outputSkill
- api-designSkill
- background-jobsSkill
- cachingSkill
- djangoSkill
- event-driven-architectureSkill
- fastapiSkill
- graphqlSkill
- microservicesSkill
- nestjsSkill
- realtime-websocketsSkill
- spring-bootSkill
- competitive-analysisSkill
- lead-researchSkill
- product-analysisSkill
- resumeSkill
- user-researchSkill
- database-performanceSkill
- data-modelingSkill
- data-qualitySkill
- pandasSkill
- postgresSkill
- sparkSkill
- brand-guidelinesSkill
- generative-artSkill
- themingSkill
- ui-reviewSkill
- visual-designSkill
- architecture-decisionsSkill
- bug-fix-protocolSkill
- cli-developmentSkill
- code-reviewSkill
- debuggingSkill
- design-patternsSkill
- domain-modelingSkill
- git-workflowSkill
- legacy-modernizationSkill
- refactoringSkill
- repository-explorationSkill
- simple-designSkill
- system-designSkill
- aws-cdkSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 59
Never trust the model's authorization reasoning.
- Distinctive: line 145
Test by connecting a real client and giving the model realistic tasks.
- Distinctive: line 147
If a tool's description needs to explain a workflow ("first call X, then call Y with the result"), consider whether it should be one tool …
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
MCP Server
Purpose
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.
When to Use
- Exposing a system's capabilities to an LLM client.
- Wrapping an internal API for agent use.
- Improving an MCP server whose tools the model uses incorrectly.
Capabilities
- Tool design: granularity, naming, schema, and descriptions.
- Resources for read-only context.
- Prompts as reusable, parameterized templates.
- Transports: stdio for local, HTTP/SSE for remote.
- Authentication and authorization.
- Error returns that let a model recover.
Inputs
- The underlying system and its API.
- The tasks a model should be able to accomplish.
- The security boundary: what the model may do, and on whose behalf.
Outputs
- A server whose tool descriptions unambiguously state when each tool applies.
- Errors that are instructive rather than merely accurate.
- A test suite exercising the tools as a model would call them.
Workflow
- Design around tasks, not endpoints — Do not mirror your REST API one-to-one. A model needs
find_order_by_customer, notGET /orderswith fourteen optional query parameters. - 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.
- Constrain the inputs — Enums, not free strings. Required parameters, not optional ones the model must guess.
- 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.
- Keep responses compact — Return what the model needs. A tool returning a 40 KB JSON blob spends the model's context on noise.
- 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.
Best Practices
- The tool description is the single highest-leverage text in an MCP server. If the model calls the wrong tool, the description is wrong — not the model.
- Twelve well-designed tools beat forty thin wrappers around API endpoints. Every additional tool is a decision the model must make correctly.
- Distinguish tools (actions with side effects, model-invoked) from resources (read-only context, application-selected). Modeling read-only data as a tool forces the model to call it, which wastes a turn.
- Destructive tools should be clearly marked and, where the client supports it, require confirmation.
- Validate every input server-side. The model will send a malformed argument eventually, and the tool must not act on it.
- Never trust the model's authorization reasoning. Enforce permissions in the server, scoped to the authenticated user — not to the model's belief about who it is acting for.
Examples
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 resource is read-only context the client can attach. Modeling this as a
// tool would force the model to spend a turn asking for something it always needs.
server.registerResource(
"order-schema",
"schema://orders",
{ title: "Order schema", mimeType: "text/markdown" },
async () => ({
contents: [{ uri: "schema://orders", text: await readFile("docs/order-schema.md") }],
}),
);Notes
- Test by connecting a real client and giving the model realistic tasks. Unit tests confirm the handler works; only a real client shows you that the model consistently reaches for the wrong tool because two descriptions overlap.
- stdio transport is right for local, single-user servers. HTTP with SSE is right for remote, multi-user servers — and immediately raises authentication and multi-tenancy questions that stdio lets you ignore.
- If a tool's description needs to explain a workflow ("first call X, then call Y with the result"), consider whether it should be one tool that does both.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

