Skip to main content
Glama
README.md
# Tasks MCP Server

An MCP (Model Context Protocol) server for task management with pluggable storage backends.

## Project Structure

```
tasks-mcp-server/
├── package.json          # Bun project config with MCP SDK dependencies
├── tsconfig.json         # TypeScript configuration
└── src/
    ├── index.ts          # Main MCP server entry point
    ├── types.ts          # Task types and Zod schemas
    └── services/
        ├── TaskService.ts       # Abstract TaskService interface
        └── InMemoryTaskService.ts  # In-memory implementation
```

## Installation

```bash
bun install
```

## Building

```bash
bun run build
```

## Usage

```bash
# Start with default in-memory service
bun run start

# Specify service implementation
bun run start -- --service memory

# Show help
bun run start -- --help
```

## Abstract TaskService Interface

The `TaskService` interface (`src/services/TaskService.ts`) defines the contract for task storage implementations:

- `list(status?)` - List all tasks, optionally filtered by status
- `get(id)` - Get a single task by ID
- `create(input)` - Create a new task
- `complete(id)` - Mark task as completed
- `delete(id)` - Delete a task

### Available Implementations

**InMemoryTaskService** (`src/services/InMemoryTaskService.ts`):
- Stores tasks in a Map
- Generates sequential IDs (`task-1`, `task-2`, etc.)
- Tasks persist only during server runtime

## MCP Tools

| Tool | Description |
|------|-------------|
| `tasks_list` | List all tasks (supports filtering by status and markdown/json output) |
| `tasks_create` | Create a new task with title and optional description |
| `tasks_complete` | Mark a task as completed by ID |
| `tasks_delete` | Delete a task permanently by ID |

## MCP Resources

| Resource | Description |
|----------|-------------|
| `task://{id}` | Access individual tasks by ID (template resource) |
| `task://list` | List all tasks as JSON (static resource) |

## Integration

The server uses stdio transport, making it suitable for integration with MCP clients like Claude Desktop or other MCP-compatible applications.

### Claude Desktop Configuration

Add to your Claude Desktop config:

```json
{
  "mcpServers": {
    "tasks": {
      "command": "bun",
      "args": ["run", "/path/to/tasks-mcp-server/dist/index.js", "--service", "memory"]
    }
  }
}
```