The Task API Server is a task management system offering standardized operations across dual runtime modes (STDIO and HTTP+SSE), supporting integration with CLI, AI agents, and web applications.
List Tasks: Retrieve and filter tasks by status (not_started, started, done) or priority (low, medium, high)
Create Tasks: Add new tasks with required fields (task description, category) and optional fields (status, priority)
Update Tasks: Modify existing tasks by updating any field using the task ID
Delete Tasks: Remove tasks using their unique task ID
Multiple Interfaces: Works via STDIO mode for CLI/AI integration and HTTP+SSE for browser-based access
Robust Validation: Ensures data integrity with input validation and error handling
Enables configuration through environment variables to set API credentials, base URLs, and server ports for connecting to external task management services.
Supports browser-based clients through CDN-delivered MCP SDK, enabling web applications to connect to the task management server.
Supports running as a Node.js application in either STDIO mode for CLI/AI agent integration or HTTP+SSE mode for web-based access.
Provides a standardized interface for task management, allowing users to list, create, update, and delete tasks with customizable properties such as status, category, and priority levels.
Implemented in TypeScript, providing type safety and modern JavaScript features for reliable task management operations.
Task API Server - MCP TypeScript Implementation
A Model Context Protocol (MCP) implementation for Task Management API written in TypeScript. This project serves as both a reference implementation and a functional task management server.
Overview
This MCP server connects to an external Task API service and provides a standardized interface for task management. It supports two runtime modes:
STDIO Mode: Standard input/output communication for CLI-based applications and AI agents
HTTP+SSE Mode: Web-accessible server with Server-Sent Events for browser and HTTP-based clients
The server offers a complete set of task management operations, extensive validation, and robust error handling.
Related MCP server: Task Manager MCP Server
Features
Task Management Operations:
List existing tasks with filtering capabilities
Create new tasks with customizable properties
Update task details (description, status, category, priority)
Delete tasks when completed or no longer needed
Dual Interface Modes:
STDIO protocol support for command-line and AI agent integration
HTTP+SSE protocol with web interface for browser-based access
MCP Protocol Implementation:
Complete implementation of the Model Context Protocol
Resources for task data structures
Tools for task operations
Error handling and informative messages
Quality Assurance:
Comprehensive test client for validation
Automatic server shutdown after tests complete
Detailed validation of API responses
Getting Started
Prerequisites
Node.js 16.x or higher
npm or pnpm package manager
Installation
Clone the repository:
git clone https://github.com/yourusername/mcp-template-ts.git cd mcp-template-tsInstall dependencies:
npm installor using pnpm:
pnpm installCreate an
.envfile 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=3000Build the project:
npm run build
Running the Server
STDIO Mode (for CLI/AI integration)
or
HTTP Mode (for web access)
or
By default, the HTTP server runs on port 3000. You can change this by setting the TASK_MANAGER_HTTP_PORT environment variable.
Testing
Run the comprehensive test suite to verify functionality:
This will:
Build the project
Start a server instance
Connect a test client to the server
Run through all task operations
Verify correct responses
Automatically shut down the server
Using the MCP Client
STDIO Client
To connect to the STDIO server from your application:
HTTP Client
To connect to the HTTP server from a browser:
Available Tools
listTasks
Lists all available tasks.
createTask
Creates a new task.
updateTask
Updates an existing task.
deleteTask
Deletes a task.
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 |
Project Structure
Development
Start the TypeScript compiler in watch mode:
npm run watchRun tests to verify changes:
npm test
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
This project uses the @modelcontextprotocol/sdk for MCP protocol implementation
Built for integration with AI tooling and web applications