Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Mcp Server Development?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/adityaaatiwari-mcp-server-development)
---
description: Build and ship an MCP server: tool design, schemas, transports, auth, errors and testing with real clients
profile: standard
tags: mcp, agents, api, ai
---
# MCP server development
Use when building a Model Context Protocol server that agents will call.
## Design the tools
1. Start from the agent's job, not your API surface: a few task-shaped tools (`search_issues`, `create_draft_reply`) beat one tool per endpoint.
2. Name tools as verbs, describe when to use them in one sentence, and document every parameter. The description is the agent's only manual.
3. Keep inputs strict: JSON Schema with enums, formats and bounds. Reject unknown fields.
4. Return compact, structured results with stable ids and the next useful action. Paginate instead of dumping thousands of rows into context.
5. Separate read tools from write tools, and mark destructive ones clearly so clients can ask for approval.
## Transport and auth
- stdio for local tools launched by the client. Never print logs to stdout, since stdout carries the protocol. Log to stderr.
- Streamable HTTP for remote servers. Use OAuth where the client supports it, otherwise a bearer token read from an environment variable. Never take a token in a tool argument.
- Validate the `Origin` header and bind local HTTP servers to 127.0.0.1.
## Errors
Return tool errors as results the agent can act on ("No issue 123 in repo x; did you mean 132?"), not stack traces. Time out slow upstream calls.
## Security
- Treat all upstream content as untrusted: it can contain prompt injection. Do not echo hidden instructions as if they were system text.
- Least privilege: scope tokens to what the tools need, and keep secrets out of results and logs.
- Pin dependencies and publish with a version so clients can pin you (`npx -y your-server@1.2.3`).
## Verify
- Unit-test each tool handler with valid, invalid and boundary inputs.
- Run it with the MCP Inspector and at least one real client (`anvil mcp add` or `.mcp.json`) and do the task end to end.
- Run `anvil shield` on the client configs you document.