Prompts · Tes propres outils pour Claude Code
Ton premier serveur MCP
Claude construit un petit serveur MCP qui donne à Claude deux à quatre outils vers ton service, avec des entrées vérifiées, des erreurs claires, des tests et la commande pour le brancher.
Le prompt, en français
4 cases sont vides : elles partiront entre crochets, et Claude te posera la question.
Voir la version anglaise, celle qui est copiée
Build a small MCP server so that Claude Code can use this service: [Le service à brancher].
The tools to expose: [Les actions à donner à Claude (2 à 4)]
Language: [Le langage, ou « choisis pour moi »]
The access key is in the `[Le nom de la variable qui contient ta clé (jamais la clé)]` environment variable. Never ask me for its value, never write it in any file, never display it.
1. Read up before coding
- If the official mcp-server-dev plugin is installed, use its server-building skill.
- Otherwise, read the official guide https://modelcontextprotocol.io/docs/develop/build-server and the documentation of the official SDK for the chosen language: its current version, how to declare a tool, the stdio transport. Do not rely on your memory: the SDK changes.
- Read the service's API documentation. If you can't find it, ask me for it.
- Ask me your questions before coding: what data may leave the service, what must stay read-only, the API's limits.
2. Build
- A separate project, in a folder with a short name (propose one).
- Each tool: a clear English name (for example `list_appointments`), a description that says when to use it, an input schema with types, allowed values and examples, and strict validation of those inputs.
- Short responses that are useful to Claude: only the necessary fields, and a limit or pagination if the list can be long.
- Clear errors that say what to do ("Date invalide : utilise le format AAAA-MM-JJ"), never a stack trace or the key.
- Read-only first: no tool that changes or deletes anything without my written approval.
- With stdio, nothing is written to standard output outside the protocol (no `console.log` or `print`): logs go to standard error.
3. Connect
- Give me the exact `claude mcp add` command to add it, checked against https://code.claude.com/docs/en/mcp (with `--scope` and `--env` if needed, and the `--` before the command that starts the server).
- Explain the difference between the local, project and user scopes, and recommend one.
4. Test
- Automated tests for input validation and for errors, without calling the real API.
- A guided real test: I run the add command, I check with `claude mcp list` then `/mcp` that the server is connected, then I ask a question that uses each tool.
Done when the tests pass, and you have given me the add command, a README in French (installation, variable to set, tools, example questions), and the list of what the server does not do yet. Talk to me in French.Comment t’en servir
Crée un dossier vide pour le serveur, ouvre-le dans ton terminal, lance claude et colle le prompt. Garde la documentation de l'API de ton service sous la main : Claude te la demandera s'il ne la trouve pas.
Si tu veux, installe d'abord le plugin officiel qui aide à construire un serveur : /plugin install mcp-server-dev@claude-plugins-official. Claude s'en sert s'il est là ; sinon, il suit le guide officiel du protocole MCP. Dans tous les cas, ta clé reste dans une variable d'environnement : ne la colle jamais dans la conversation.
À la fin, ajoute le serveur avec la commande claude mcp add que Claude te donne, vérifie avec claude mcp list puis /mcp qu'il est connecté, et pose une question qui utilise chaque outil. La formation « MCP : brancher Claude sur tes outils » explique les portées et la sécurité.
Pour comprendre tout ce que fait ce prompt, et l’adapter : la formation MCP : brancher Claude sur tes outils.