top of page

Building an Intelligent Task Management Server

  • Apr 3
  • 6 min read




Assignment Overview

Scenario: You are a software engineer at a productivity software company. Your team is developing an AI-powered personal assistant that helps users manage their daily tasks, projects, and goals. Your task is to build an MCP server that provides intelligent task management capabilities to Claude Desktop, allowing users to interact with their task lists using natural language.



Learning Objectives:


  • Implement MCP tools for CRUD operations on task data

  • Design and implement resource endpoints with custom URI schemes

  • Create prompt templates for common task management workflows

  • Apply proper error handling and input validation

  • Implement caching and resource subscription patterns

  • Write comprehensive tests for your MCP server





Functional Requirements




MCP Tools (Module 1 Concepts)

You must implement the following tools with proper JSON Schema inputSchema:


Tool Name

Parameters

Description

create_task

title: str, description: str, priority: str, due_date: str (optional), tags: list[str] (optional)

Creates a new task and returns the task ID. Priority must be one of: low, medium, high, urgent

list_tasks

filter_by: str (optional), status: str (optional), limit: int (optional, default=50)

Lists tasks with optional filters. filter_by can be: priority, tag, date. Status can be: pending, in_progress, completed

update_task

task_id: str, field: str, value: str

Updates a specific field of a task. Validate that field is one of: title, description, priority, status, due_date

delete_task

task_id: str, confirm: bool

Deletes a task. Requires confirmation flag to be True. Should be marked with destructiveHint

search_tasks

query: str, search_in: list[str] (optional)

Performs full-text search across tasks. search_in defaults to ["title", "description", "tags"]

add_subtask

parent_task_id: str, title: str, description: str

Adds a subtask to an existing task. Validates parent task exists

get_task_statistics

group_by: str (optional)

Returns statistics like total tasks, completion rate, tasks by priority. group_by can be: priority, status, tag, date




MCP Resources (Module 2 Concepts)

Implement the following resources with proper URI schemes:


Resource URI

Type

Description

task:///{task_id}

Template

Returns full details of a specific task including subtasks and history

tasks://all

Static

Returns JSON array of all tasks with metadata

tasks://by-priority/{priority}

Template

Returns filtered task list by priority (low, medium, high, urgent)

tasks://by-status/{status}

Template

Returns filtered task list by status (pending, in_progress, completed)

tasks://by-tag/{tag}

Template

Returns tasks matching a specific tag

tasks://statistics

Static

Returns JSON with task statistics and analytics

config://server/info

Static

Server metadata including version, uptime, total tasks managed



Resource Requirements:


  • Implement caching with a 60-second TTL for task lists

  • Support resource subscriptions for tasks://all and tasks://statistics

  • Send resource_list_changed notifications when tasks are created, updated, or deleted

  • Handle missing task_id gracefully with user-friendly error messages




MCP Prompts (Module 3 Concepts)

Create the following prompt templates:


Prompt Name

Arguments

Purpose

plan-my-day

focus_area: str (optional), time_available: str (optional, default: "8 hours")

Generates a daily plan based on pending tasks, priorities, and available time

task-breakdown

task_id: str, granularity: str (optional, default: "medium")

Breaks down a complex task into subtasks with estimated time. Uses EmbeddedResource to include task details

prioritize-tasks

criteria: str (optional, default: "urgency and importance")

Analyzes pending tasks and suggests priority ordering based on criteria

weekly-review

week_offset: int (optional, default: 0)

Generates a review of completed and pending tasks for the specified week

task-template

task_type: str (e.g., "bug-fix", "feature", "research")

Generates a task template with suggested title, description structure, and tags for common task types



Prompt Requirements:


  • At least one prompt must use EmbeddedResource pattern (task-breakdown)

  • Provide sensible default values for optional arguments

  • Include clear descriptions that appear in Claude Desktop's prompt menu

  • Design prompts to minimize user input while maximizing utility





Technical Requirements




Data Storage


  • Use JSON file storage (tasks.json) for persistence

  • Implement atomic write operations to prevent data corruption

  • Store tasks with the following structure: {task_id, title, description, priority, status, due_date, tags, subtasks[], created_at, updated_at}

  • Generate unique task IDs using UUID or timestamp-based approach

  • Create a backup mechanism (tasks.backup.json) before destructive operations




Error Handling & Validation


  • Validate all tool inputs against JSON Schema

  • Implement safepath() or equivalent to prevent path traversal attacks

  • Return isError=True for tool-level errors (invalid task_id, validation failures)

  • Provide clear, actionable error messages suitable for LLM interpretation

  • Handle file I/O errors gracefully (disk full, permissions, corruption)

  • Validate enum values (priority, status) and return helpful error messages listing valid options




Code Quality


  • Follow the 4-Step Server Pattern consistently

  • Use async/await properly for I/O operations

  • Add type hints for function parameters and return values

  • Include docstrings for all tools, resources, and prompts

  • Implement structured logging (optional but recommended)

  • Keep functions focused and modular (single responsibility principle)





Testing Requirements




Minimum Testing Coverage:


  • Write pytest tests for all 7 tools (minimum 15 test cases)

  • Test resource URI resolution for all resource types

  • Test prompt rendering with various argument combinations

  • Test error conditions: invalid inputs, missing files, corrupted data

  • Test edge cases: empty task lists, missing optional parameters, Unicode characters

  • Test tool annotations are properly set (destructiveHint for delete_task)

  • Use pytest fixtures for temporary task files (conftest.py)

  • Achieve at least 80% code coverage




Test File Structure:



tests/

├── conftest.py           # Fixtures for temp directories and sample data
├── test_tools.py            # Tool functionality tests
├── test_resources.py        # Resource resolution tests
├── test_prompts.py          # Prompt rendering tests
├── test_validation.py       # Input validation and error handling
└── test_integration.py      # End-to-end workflow tests





Deliverables


Submit a ZIP file named StudentID_Assignment1_TaskManager.zip containing:


  • task_manager_server.py - Your complete MCP server implementation

  • tests/ directory - Complete test suite as specified above

  • tasks.json - Sample task data (minimum 10 diverse tasks)

  • claude_desktop_config.json - Configuration snippet for Claude Desktop integration

  • README.md - Documentation including:

  •     • Setup instructions (dependencies, Python version)

  •     • How to run the server with Claude Desktop

  •     • How to run tests (pytest commands)

  •     • Example interactions (3-5 sample conversations with Claude)

  •     • Design decisions and assumptions

  •     • Known limitations and future enhancements

  • requirements.txt - Python dependencies with versions





Grading Rubric


Criteria

Points

Description

Tool Implementation

25

7 tools correctly implemented with proper schemas, validation, and error handling

Resource Implementation

20

7 resources with correct URI patterns, caching, and subscriptions

Prompt Templates

15

5 prompts with proper arguments, defaults, and EmbeddedResource usage

Testing

20

Comprehensive test suite meeting coverage requirements

Error Handling

10

Robust validation, graceful failures, clear error messages

Documentation

5

Clear README with examples and setup instructions

Demo/Video

5

Screen recording showing 3-5 interactions (2-3 minutes)

Total

100

Bonus: +10 points for implementing structured logging and health resources





Submission Guidelines




Due Date & Platform


  • Submission Deadline: [Date] at 11:59 PM (Late penalty: 10% per day, max 3 days)

  • Submission Platform: Upload to [Moodle/Canvas/Blackboard] under "Assignment 1" section

  • File Size Limit: 50 MB (exclude large test data files)

  • Format: ZIP file only (no .rar, .7z, or other formats)




Academic Integrity


  • This is an individual assignment. You may discuss concepts with classmates, but all code must be your own work.

  • Properly cite any external resources, libraries, or code snippets used (beyond standard MCP SDK).

  • Do NOT share your code with classmates or post solutions publicly.

  • AI tools (like Claude, ChatGPT) may be used for learning and debugging, but you must understand and be able to explain every line of code.

  • Plagiarism will result in zero credit and potential disciplinary action.




Tips for Success


  • Start early - Begin with Module 1 tools, then add resources and prompts incrementally

  • Test frequently - Write tests as you implement each tool to catch issues early

  • Review course modules - Reference server_v1.py, server_v2.py, and server_v3.py examples

  • Use meaningful task IDs - UUID or timestamp-based (e.g., "task_20240315_001")

  • Handle edge cases - Empty lists, missing parameters, invalid enums

  • Provide examples - Include sample interactions in README showing your server in action

  • Document assumptions - If requirements are ambiguous, state your interpretation

  • Seek help early - Use office hours if stuck on MCP protocol concepts





Call to Action

Ready to transform your business with AI-powered intelligence that accelerates insights, enhances decision-making, and unlocks the full value of your data?


Codersarts is here to help you turn complex data workflows into efficient, scalable, and evidence-driven AI systems that empower teams to make smarter, faster, and more confident decisions.


Whether you’re a startup looking to build AI-driven products, an enterprise aiming to optimize operations through data science, or a research organization advancing innovation with intelligent data solutions, we bring the expertise and experience needed to design, develop, and deploy impactful AI systems that drive measurable business outcomes.




Get Started Today



Schedule an AI & Data Science Consultation:

Book a 30-minute discovery call with our AI strategists and data science experts to discuss your challenges, identify high-impact opportunities, and explore how intelligent AI solutions can transform your workflows and performance.




Request a Custom AI Demo:

Experience AI in action with a personalized demonstration built around your business use cases, datasets, operational environment, and decision workflows — showcasing practical value and real-world impact.









Transform your organization from data accumulation to intelligent decision enablement — accelerating insight generation, improving operational efficiency, and strengthening competitive advantage.


Partner with Codersarts to build scalable AI solutions including RAG systems, predictive analytics platforms, intelligent automation tools, recommendation engines, and custom machine learning models that empower your teams to deliver exceptional results.


Contact us today and take the first step toward next-generation AI and data science capabilities that grow with your business ambitions.




Comments


bottom of page