---
name: mcp-server-spec-writer
description: "Specifies a Model Context Protocol server end to end, with tool schemas, auth and error cases, before any code is written. Use when an engineer is planning a Model Context Protocol server and needs tool definitions, schemas, auth and risks specified before coding. Do not use for implementing the server or choosing between agent frameworks. Related topics: AI, Engineering, Technical."
---

# MCP Server Spec Writer

Specifies a Model Context Protocol server end to end, with tool schemas, auth and error cases, before any code is written.

## When to use

Use this skill when an engineer is planning a Model Context Protocol server and needs tool definitions, schemas, auth and risks specified before coding. Do not use it for implementing the server or choosing between agent frameworks.

## Workflow

1. Ask the user for each input listed below in a single message, skipping any they have already given. Where options are listed, offer them, but accept other answers too.
2. Map the example requests to a minimal set of tools, merging any that overlap.
3. Write each tool's name and model-facing description stating when to use it and when not.
4. Define input schemas with types and required fields, the return shape, and the error cases for each tool.
5. Specify the auth flow, rate limits and redaction rules from the constraints.
6. Write the risks section naming what write access could do if misused and the control that limits it.

## Inputs

- **System or data the server exposes** (free text, e.g. "an internal CRM or a docs wiki")
- **What an AI assistant should be able to do with it** (longer free text)
- **Access level** (choose one: Read-only, Read and write, Write with confirmation)
- **Candidate tools** (longer free text)
- **Authentication** (choose one: API key, OAuth, None - local only)
- **Include resources as well as tools** (choose one: Yes, No)
- **Rate limits, privacy rules or fields to redact** (longer free text)
- **Implementation language** (choose one: TypeScript, Python)

## Output

A spec with an overview, one block per tool (name, description, input schema, return shape, errors), the auth flow, optional resources, and a short risks section.

## Prompt template

Fill the inputs into this template and follow it as the full instruction.

### MCP Server Spec

Write a build-ready spec for a Model Context Protocol server.

#### Purpose
- System or data the server exposes: {{System or data the server exposes}}
- What an AI assistant should be able to do with it: {{What an AI assistant should be able to do with it}}
- Access level: {{Access level}}

#### Interface
- Candidate tools: {{Candidate tools}}
- Authentication: {{Authentication}}
- Include resources as well as tools: {{Include resources as well as tools}}

#### Constraints
- Rate limits, privacy rules or fields to redact: {{Rate limits, privacy rules or fields to redact}}
- Implementation language: {{Implementation language}}

Produce the spec with: a server overview; each tool with name, a description written for the model (when to use it and when not), input schema with types and required fields, return shape, and error cases; the auth flow; resources if requested; and a short risks section covering what a misbehaving model could do with write access and the control that limits it. Merge overlapping tools, prefer few tools with clear purposes over many narrow ones, and keep return payloads small.

## Pitfalls

- Creating many narrow tools that confuse tool selection instead of a few clear ones.
- Writing tool descriptions for humans rather than for the model that must choose the tool.
- Returning entire records when a small summary would do, which wastes context.
