task-patterns

Coordinate long-running MCP tool executions with task IDs and status polling.

2|Updated Aug 17, 2025
One-click install
npx skills add https://github.com/aussierobots/turul-mcp-framework --skill task-patterns-aussierobots
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: task-patterns
Source: https://github.com/aussierobots/turul-mcp-framework/tree/main/plugins/turul-mcp-skills/skills/task-patterns
Command: npx skills add https://github.com/aussierobots/turul-mcp-framework --skill task-patterns-aussierobots

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Long-running tool operations are complex to manage synchronously; this skill provides patterns to run tools as tasks with IDs, enabling status updates, cancellation, and deferred results.

Core Features & Use Cases

  • Task-based execution with TaskRuntime and TaskStorage for asynchronous work
  • State machine enforcement and lifecycle management across task states
  • Backed by multiple storage options (InMemory, SQLite, PostgreSQL, DynamoDB) and a cancelable workflow
  • Client-facing patterns for tasks/get, tasks/list, and tasks/result to monitor progress and retrieve outcomes

Quick Start

Configure a tool with task_support and start a task-enabled server to observe the task lifecycle.

Frequently Asked Questions about task-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage long-running MCP tool executions without blocking the client?

To manage long-running MCP tool executions without blocking, you return Task IDs instead of synchronous responses. Clients then use tasks/get, tasks/list, and tasks/result to poll status and retrieve deferred outcomes asynchronously.

What is the best way to cancel an asynchronous MCP task during its lifecycle?

The best way to cancel an asynchronous MCP task is by applying task_support patterns to your tools, which enforce a TaskStorage-backed state machine. This enables a cancelable workflow across the task lifecycle using your chosen storage backend.

Does MCP task management work with persistent storage backends like PostgreSQL and DynamoDB?

Yes, MCP task management works with persistent storage backends like PostgreSQL, DynamoDB, and SQLite. You integrate these with the TaskRuntime and TaskExecutor to enforce reliable state machine lifecycle management.

How do I configure an MCP server to support asynchronous task tracking?

To configure an MCP server for asynchronous task tracking, you set task_support patterns (optional, required, or forbidden) on your tools. Starting a task-enabled server then applies the TaskStorage-backed state machine for lifecycle management.

When should I use asynchronous task IDs instead of direct synchronous tool responses?

You should use asynchronous task IDs instead of direct synchronous responses for long-running tool operations. Returning Task IDs enables status updates, cancellation, and deferred results, which are complex to manage synchronously without blocking the client.

Can I enforce a specific task lifecycle state machine across different storage backends in MCP?

Yes, you can enforce a specific task lifecycle state machine across different storage backends in MCP. The skill applies task_support patterns to integrate TaskRuntime with InMemoryTaskStorage, SQLite, PostgreSQL, or DynamoDB for consistent state transitions.