🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Exercises.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
HTML MASTER CLASS /// LEARN TAGS /// BUILD STRUCTURE /// SEMANTIC WEB /// HTML MASTER CLASS /// LEARN TAGS ///

Untitled Lesson

Total XP: 0|💻 backend XP: 0

Skill Matrix

UNLOCK NODES BY LEARNING NEW TAGS.

Select an unlocked node to view details root

Pascual Vila

Pascual Vila

Frontend Instructor // Code Syllabus

Common Pitfalls & Errors

The Error //

Exposing an MCP tool that reads or modifies sensitive data with no authorization check

// Wrong: no authorization check, same gap as an unprotected API endpoint server.tool("getOrder", { orderId: z.string() }, async ({ orderId }) => { return await orderRepository.findById(orderId); // any caller, any order }); // Correct: same rigor as any API server.tool("getOrder", { orderId: z.string(), userId: z.string() }, async ({ orderId, userId }) => { const order = await orderRepository.findById(orderId); if (order.userId !== userId) throw new Error("Unauthorized"); return order; });

The Solution //

An MCP server is functionally another API surface, regardless of the fact that it's designed to be called by an AI client rather than a traditional HTTP client — it needs the exact same authorization discipline as any other endpoint, verifying the requester actually has permission for the specific resource or action being requested.

The Error //

Choosing the wrong transport mechanism for where the MCP server actually runs relative to its client

// Wrong for a remote server: stdio only works for a local subprocess // Correct: choose the transport matching your actual deployment // Local subprocess → stdio transport // Remote, network-accessible server → HTTP-based transport

The Solution //

A stdio transport is designed for a local tool spawned as a subprocess on the same machine as the AI client, and won't work correctly for a server that needs to be reached over a network from a remote client, which requires an HTTP-based transport instead — matching the transport to the actual deployment topology matters.

Continue Learning