Lesson 13 Building Your Own MCP Server
Theme:

Homework

Three tasks extending the MCP server with search, building a custom server, and Claude Desktop integration.

Complete all three lab exercises before starting the homework. You will need the MCP SDK and optionally Claude Desktop.

📥 Reference Solution

⬇ lab_answer.pdf

Task 1 — Add a search_notes Tool

Objective

Add a search_notes tool that finds notes containing a keyword.

Instructions

  1. Implement search_notes(query: str) -> str that searches note titles and content for a keyword (case-insensitive)
  2. Return matching note titles and a snippet of the matching content
  3. Handle the case where no notes match
  4. Test with several notes and different search queries

Deliverable

A notebook with the search tool implementation and test results.

Self-check: Searching for a keyword present in 2 of 5 notes returns exactly those 2 notes.

Task 2 — Build a Real MCP Server

Objective

Build a complete MCP server for a domain of your choice (using the design from Lesson 12 Homework Task 2, if completed).

Instructions

  1. Choose a domain: bookmarks, recipes, vocabulary flashcards, project tasks, etc.
  2. Implement at least 3 tools (create, read, update or delete)
  3. Implement at least 1 resource
  4. Include proper error handling for all tools
  5. Test with mcp dev your_server.py

Deliverable

A standalone .py server file and a notebook documenting its tools, resources, and test results.

Self-check: The server starts without errors. All tools work in the Inspector. Error cases return helpful messages.

Task 3 — Connect to Claude Desktop

Objective

Connect your custom MCP server to Claude Desktop and demonstrate it working.

Instructions

  1. Add your server to claude_desktop_config.json
  2. Restart Claude Desktop and verify the server connects
  3. Have a conversation with Claude that uses your server’s tools
  4. Document the conversation, showing Claude discovering and using your tools

Deliverable

A notebook with your config JSON, the conversation transcript, and observations about how Claude uses your tools.

Self-check: Claude successfully calls at least 2 of your tools in a natural conversation.

Submission Checklist