๐งชTDD Challengeยทbeginnerยทโฑ๏ธ 25โ40mยทโญ 125 XP
M-048Build Your First MCP Server
Description
Nebula Corp wants to expose their internal customer database to AI assistants via the Model Context Protocol. The skeleton MCP server is set up with the transport layer, but the tool registration and request handling are missing. Wire up the server so it registers a 'lookup_customer' tool, handles incoming tool calls, and returns properly formatted MCP responses.
Test Cases (4)
Lists all tools
Should return all registered tools
Input:handleRequest({ method: 'tools/list' })
Expected:CONTAINS:lookup_customer
Looks up existing customer
Should return customer data
Input:handleRequest({ method: 'tools/call', params: { name: 'lookup_customer', arguments: { customerId: 'C001' } } })
Expected:CONTAINS:Alice
Handles unknown customer
Should return error for missing customer
Input:handleRequest({ method: 'tools/call', params: { name: 'lookup_customer', arguments: { customerId: 'C999' } } })
Expected:CONTAINS:isError
Lists orders with limit
Should return limited orders
Input:handleRequest({ method: 'tools/call', params: { name: 'list_orders', arguments: { customerId: 'C003', limit: 2 } } })
Expected:CONTAINS:Enterprise Suite
Related Lessons
Click Run / Check to validate your solution