Task Master MCP server

Integrates with an external task API to provide CRUD operations for task management, enabling natural language interactions for task creation, filtering, and progress reporting.
Back to servers
Provider
Milko Sten
Release date
Mar 05, 2025
Language
TypeScript
Stats
3 stars

This TypeScript MCP server provides a standardized interface for task management, supporting both STDIO (for CLI/AI applications) and HTTP+SSE (for web clients) communication modes. It connects to an external Task API service and offers comprehensive task management capabilities.

Prerequisites

  • Node.js 16.x or higher
  • npm or pnpm package manager

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/mcp-template-ts.git
    cd mcp-template-ts
    
  2. Install dependencies:

    npm install
    

    or using pnpm:

    pnpm install
    
  3. Create an .env file with your Task API credentials:

    TASK_MANAGER_API_BASE_URL=https://your-task-api-url.com/api
    TASK_MANAGER_API_KEY=your_api_key_here
    TASK_MANAGER_HTTP_PORT=3000
    
  4. Build the project:

    npm run build
    

Running the Server

STDIO Mode (for CLI/AI integration)

npm start

or

node dist/index.js

HTTP Mode (for web access)

npm run start:http

or

node dist/http-server.js

By default, the HTTP server runs on port 3000. You can change this by setting the TASK_MANAGER_HTTP_PORT environment variable.

Using the MCP Client

STDIO Client

Connect to the STDIO server from your application:

import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
import * as path from 'path';

// Create transport
const transport = new StdioClientTransport({
  command: 'node',
  args: [path.resolve('path/to/dist/index.js')]
});

// Initialize client
const client = new Client(
  {
    name: "your-client-name",
    version: "1.0.0"
  },
  {
    capabilities: {
      prompts: {},
      resources: {},
      tools: {}
    }
  }
);

// Connect to server
await client.connect(transport);

// Example: List all tasks
const listTasksResult = await client.callTool({
  name: "listTasks",
  arguments: {}
});

// Clean up when done
await client.close();

HTTP Client

Connect to the HTTP server from a browser:

<!DOCTYPE html>
<html>
<head>
  <title>Task Manager</title>
  <script type="module">
    import { Client } from 'https://cdn.jsdelivr.net/npm/@modelcontextprotocol/sdk/dist/esm/client/index.js';
    import { SSEClientTransport } from 'https://cdn.jsdelivr.net/npm/@modelcontextprotocol/sdk/dist/esm/client/sse.js';

    document.addEventListener('DOMContentLoaded', async () => {
      // Create transport
      const transport = new SSEClientTransport('http://localhost:3000/mcp');
      
      // Initialize client
      const client = new Client(
        {
          name: "browser-client",
          version: "1.0.0"
        },
        {
          capabilities: {
            prompts: {},
            resources: {},
            tools: {}
          }
        }
      );

      // Connect to server
      await client.connect(transport);
      
      // Now you can use client.callTool() for tasks
    });
  </script>
</head>
<body>
  <h1>Task Manager</h1>
  <!-- Your interface elements here -->
</body>
</html>

Available Tools

listTasks

Lists all available tasks with optional filtering.

const result = await client.callTool({
  name: "listTasks",
  arguments: {
    // Optional filters
    status: "pending", // Filter by status
    category: "Work",  // Filter by category
    priority: "high"   // Filter by priority
  }
});

createTask

Creates a new task.

const result = await client.callTool({
  name: "createTask",
  arguments: {
    task: "Complete the project report",  // Required: task description
    category: "Work",                     // Optional: task category
    priority: "high"                      // Optional: low, medium, high
  }
});

updateTask

Updates an existing task.

const result = await client.callTool({
  name: "updateTask",
  arguments: {
    taskId: 123,                       // Required: ID of task to update
    task: "Updated task description",  // Optional: new description
    status: "done",                    // Optional: pending, started, done
    category: "Personal",              // Optional: new category
    priority: "medium"                 // Optional: low, medium, high
  }
});

deleteTask

Deletes a task.

const result = await client.callTool({
  name: "deleteTask",
  arguments: {
    taskId: 123  // Required: ID of task to delete
  }
});

Environment Variables

Variable Description Default
TASK_MANAGER_API_BASE_URL URL for the external Task API None (Required)
TASK_MANAGER_API_KEY API key for authentication None (Required)
TASK_MANAGER_HTTP_PORT Port for the HTTP server 3000
PORT Alternative port name (takes precedence) None

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later