anwar-arif/mcp-server
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.
add_task
Create new tasks
list_tasks
View all tasks with filtering options
complete_task
Mark tasks as done
delete_task
Remove tasks
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
-
Install Claude Desktop from Anthropic's website
-
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
- macOS:
-
Add your server configuration:
{
"mcpServers": {
"task-manager": {
"command": "node",
"args": ["/path/to/your/task-manager-mcp/server.js"]
}
}
}
- 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:
- Add due dates to tasks
- Add priority levels (high, medium, low)
- Add task categories or tags
- Connect to a real database (SQLite, PostgreSQL)
- Add task search functionality
- Add task notes or descriptions
- 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
- Get the basic server running
- Test it with MCP Inspector
- Try connecting it to Claude Desktop
- Experiment with adding new tools
- Build your own MCP server for a different use case!
Happy coding! ๐