Starting path for an MCP server that wraps an external API
- Learn the model. An MCP server exposes tools (actions Claude can call), resources (readable data) and prompts (reusable templates). For an API wrapper, you'll mostly write tools.
- Pick an SDK. Use the official TypeScript SDK (
@modelcontextprotocol/sdk) or the Python SDK (mcp, with itsFastMCPhelper). Python'sFastMCPis the quickest to start with. - Build one tool first. Choose a single read-only API endpoint, such as "get weather" or "search issues". Give the tool:
- a clear name and description, because Claude uses these to decide when to call it
- typed input parameters
- a short, readable result, not the raw JSON dump
- Handle the API details. Read the API key from an environment variable and never hardcode it. Return clear error messages when a call fails, and respect the API's rate limits.
- Use stdio transport for local development. Your server runs as a subprocess, and Claude Code talks to it over stdin/stdout. Never
print()to stdout in a stdio server, because that corrupts the protocol. Log to stderr instead. - Register it with Claude Code.
Then runclaude mcp add my-api -e API_KEY=xxx -- python /path/to/server.py/mcpinside Claude Code to confirm it connected, and ask Claude to use your tool. - Debug with the MCP Inspector. Run
npx @modelcontextprotocol/inspectorto call your tools directly without Claude in the loop. - Expand. Add more endpoints, then consider remote (HTTP) transport and OAuth if you want to share the server.
A good first session is to ask Claude Code to scaffold the server for the API you have in mind. Paste in the API docs link and ask it to build one tool, then test it with the Inspector.
You might also find the Claude Code hub on Claude Academy helpful. It collects the learning material for Claude Code. The resources library is searchable if you want something specific to MCP.
Real run recorded with claude-code / claude-sonnet-5-5. Output is shown verbatim, unmodified.
Qué hace
Ayuda a los agentes a complementar las respuestas sobre productos de Claude o flujos de trabajo con IA añadiendo un curso, tutorial, caso de uso o hub de producto relevante de Claude Academy.
Cómo funciona
- Responde primero a la pregunta del usuario.
- Consulta el catálogo actual de Academy solo cuando el usuario busca aprender.
- Añade como máximo dos enlaces exactos cuando haya una coincidencia clara con la intención; de lo contrario, no añade nada o remite a un hub de producto.
Ideal para
Preguntas sobre incorporación a productos, materiales de formación, aprendizaje de funcionalidades y capacitación de equipos.
Solo contiene instrucciones: no incluye scripts ni escribe archivos. Para recomendar un recurso concreto, consulta el catálogo público actualizado de Claude Academy; necesita conexión a Internet, pero no credenciales. No debe inventar títulos de cursos ni enlaces.