mcp-server

anwar-arif/mcp-server

3.2

If you are the rightful owner of mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

This guide provides a comprehensive setup for a Model Context Protocol (MCP) server designed to manage tasks efficiently.

Tools
  1. add_task

    Create new tasks

  2. list_tasks

    View all tasks with filtering options

  3. complete_task

    Mark tasks as done

  4. delete_task

    Remove tasks

  5. get_task_stats

    See completion statistics

MCP Task Manager - Setup Guide

This is a hands-on MCP (Model Context Protocol) server that creates a simple task management system. You'll learn how MCP works by building and testing a real server!

๐Ÿš€ Quick Setup

1. Prerequisites

# Make sure you have Node.js 18+ installed
node --version  # Should be 18.0.0 or higher

2. Create Project Directory

mkdir task-manager-mcp
cd task-manager-mcp

3. Save the Files

  • Save the JavaScript code as server.js
  • Save the package.json content as package.json

4. Install Dependencies

npm install

5. Test the Server

# Start the server
npm start

# Or use watch mode for development
npm run dev

๐Ÿงช Testing Your MCP Server

Method 1: Using MCP Inspector (Recommended)

The MCP Inspector is a web-based tool for testing MCP servers:

# Install the MCP Inspector globally
npm install -g @modelcontextprotocol/inspector

# Run your server with the inspector
npx @modelcontextprotocol/inspector node server.js

This will open a web interface where you can:

  • See all available tools and resources
  • Test tool calls interactively
  • View server responses in real-time

Method 2: Manual Testing with Claude Desktop

  1. Install Claude Desktop from Anthropic's website

  2. Configure Claude Desktop to use your MCP server:

    Edit the Claude Desktop config file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  3. Add your server configuration:

{
  "mcpServers": {
    "task-manager": {
      "command": "node",
      "args": ["/path/to/your/task-manager-mcp/server.js"]
    }
  }
}
  1. Restart Claude Desktop and you should see your MCP server connected!

Method 3: Command Line Testing

You can also test the basic functionality:

# Test that the server starts without errors
echo '{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": {"name": "test", "version": "1.0.0"}}}' | node server.js

๐ŸŽฎ What You Can Do

Once your server is running, you can test these features:

Available Tools:

  • add_task: Create new tasks
  • list_tasks: View all tasks (with filtering)
  • complete_task: Mark tasks as done
  • delete_task: Remove tasks
  • get_task_stats: See completion statistics

Available Resources:

  • task://all: JSON data of all tasks
  • task://stats: Text summary of task statistics

Example Interactions:

"Add a task called 'Learn MCP protocol'"
"Show me all my pending tasks"
"Mark task 1 as completed"
"What are my task statistics?"
"Delete task 2"

๐Ÿ”ง Customization Ideas

Once you have the basic server working, try these enhancements:

  1. Add due dates to tasks
  2. Add priority levels (high, medium, low)
  3. Add task categories or tags
  4. Connect to a real database (SQLite, PostgreSQL)
  5. Add task search functionality
  6. Add task notes or descriptions
  7. Export tasks to different formats

๐Ÿ› Troubleshooting

Common Issues:

"Module not found" errors:

# Make sure you're using Node 18+ and have installed dependencies
npm install

"Permission denied" errors:

# Make sure the server.js file is executable
chmod +x server.js

Claude Desktop not seeing the server:

  • Check the config file path is correct
  • Verify the absolute path to server.js
  • Restart Claude Desktop after config changes

๐Ÿ“š Learning More

This MCP server demonstrates:

  • Tools: Functions the AI can call to perform actions
  • Resources: Data sources the AI can read from
  • Error handling: Proper MCP error responses
  • Persistence: Saving data between sessions
  • Input validation: Checking parameters before processing

Try modifying the code to understand how each part works! The MCP SDK documentation is available at: https://docs.anthropic.com/en/docs/build-with-claude/mcp

๐ŸŽฏ Next Steps

  1. Get the basic server running
  2. Test it with MCP Inspector
  3. Try connecting it to Claude Desktop
  4. Experiment with adding new tools
  5. Build your own MCP server for a different use case!

Happy coding! ๐Ÿš€