Compare commits

..

1 Commits

Author SHA1 Message Date
github-actions[bot]
7d76d72adc docs: auto-update documentation based on changes in next branch
This PR was automatically generated to update documentation based on recent changes.

  Original commit: feat: add MCP timeout configuration for long-running operations (#1112)\n\n\n

  Co-authored-by: Claude <claude-assistant@anthropic.com>
2025-09-22 18:02:09 +00:00
10 changed files with 140 additions and 64 deletions

View File

@@ -1,5 +0,0 @@
---
"task-master-ai": patch
---
Fix Claude Code settings validation for pathToClaudeCodeExecutable

View File

@@ -1,5 +0,0 @@
---
"task-master-ai": patch
---
Fix sonar deep research model failing, should be called `sonar-deep-research`

View File

@@ -66,6 +66,32 @@ Taskmaster uses two primary methods for configuration:
- **Location:**
- For CLI usage: Create a `.env` file in your project root.
- For MCP/Cursor usage: Configure keys in the `env` section of your `.cursor/mcp.json` file.
## MCP Timeout Configuration
For MCP usage, it's important to configure appropriate timeouts for long-running AI operations:
```json
{
"mcpServers": {
"task-master-ai": {
"command": "npx",
"args": ["-y", "task-master-ai"],
"timeout": 300,
"env": {
"ANTHROPIC_API_KEY": "your-api-key-here"
}
}
}
}
```
**Key points:**
- **Default MCP timeout**: 60 seconds (often insufficient for AI operations)
- **Recommended timeout**: 300 seconds (5 minutes)
- **Operations that benefit**: `parse_prd`, `expand_task`, `analyze_project_complexity`, `research`
- **Automatic setup**: Included when using `task-master rules add` for supported editors
- **Required API Keys (Depending on configured providers):**
- `ANTHROPIC_API_KEY`: Your Anthropic API key.
- `PERPLEXITY_API_KEY`: Your Perplexity API key.

View File

@@ -7,6 +7,60 @@ sidebarTitle: "MCP Tools"
This document provides an overview of the MCP (Machine-to-Machine Communication Protocol) interface for the Task Master application. The MCP interface is defined in the `mcp-server/` directory and exposes the application's core functionalities as a set of tools that can be called remotely.
## MCP Timeout Configuration
Long-running AI operations in Task Master can exceed the default 60-second MCP timeout. Operations like `parse_prd`, `expand_task`, `analyze_project_complexity`, and `research` may take 2-5 minutes to complete.
### Adding Timeout Configuration
Add a `timeout` parameter to your MCP configuration to extend the timeout limit:
```json
{
"mcpServers": {
"task-master-ai": {
"command": "npx",
"args": ["-y", "task-master-ai"],
"timeout": 300,
"env": {
"ANTHROPIC_API_KEY": "your-anthropic-api-key"
}
}
}
}
```
**Configuration Details:**
- **`timeout: 300`** - Sets timeout to 300 seconds (5 minutes)
- **Value range**: 1-3600 seconds (1 second to 1 hour)
- **Recommended**: 300 seconds provides sufficient time for most AI operations
- **Format**: Integer value in seconds (not milliseconds)
### Automatic Setup
When using supported AI coding assistants, the timeout configuration is automatically included when you add Task Master rules:
```bash
# Automatically includes timeout configuration
task-master rules add cursor
task-master rules add roo
task-master rules add windsurf
task-master rules add vscode
```
### Troubleshooting Timeouts
If you're still experiencing timeout errors:
1. **Verify configuration**: Check that `timeout: 300` is present in your MCP config
2. **Restart editor**: Restart your editor after making configuration changes
3. **Increase timeout**: For very complex operations, try `timeout: 600` (10 minutes)
4. **Check API keys**: Ensure required API keys are properly configured
**Expected behavior:**
- **Before fix**: Operations fail after 60 seconds with `MCP request timed out after 60000ms`
- **After fix**: Operations complete successfully within the configured timeout limit
## Core Concepts
The MCP interface is built on top of the `fastmcp` library and registers a set of tools that correspond to the core functionalities of the Task Master application. These tools are defined in the `mcp-server/src/tools/` directory and are registered with the MCP server in `mcp-server/src/tools/index.js`.

View File

@@ -20,6 +20,7 @@ For MCP/Cursor usage: Configure keys in the env section of your .cursor/mcp.json
"task-master-ai": {
"command": "npx",
"args": ["-y", "task-master-ai"],
"timeout": 300,
"env": {
"ANTHROPIC_API_KEY": "ANTHROPIC_API_KEY_HERE",
"PERPLEXITY_API_KEY": "PERPLEXITY_API_KEY_HERE",
@@ -37,6 +38,10 @@ For MCP/Cursor usage: Configure keys in the env section of your .cursor/mcp.json
}
```
<Note>
The `timeout: 300` setting (5 minutes) is recommended for long-running AI operations like `parse-prd`, `expand-all`, and `analyze-complexity`. This prevents timeout errors during complex tasks.
</Note>
### CLI Usage: `.env` File
Create a `.env` file in your project root and include the keys for the providers you plan to use:

View File

@@ -119,7 +119,7 @@
| groq | deepseek-r1-distill-llama-70b | 0.52 | 0.75 | 0.99 |
| perplexity | sonar-pro | — | 3 | 15 |
| perplexity | sonar | — | 1 | 1 |
| perplexity | sonar-deep-research | 0.211 | 2 | 8 |
| perplexity | deep-research | 0.211 | 2 | 8 |
| perplexity | sonar-reasoning-pro | 0.211 | 2 | 8 |
| perplexity | sonar-reasoning | 0.211 | 1 | 5 |
| bedrock | us.anthropic.claude-3-opus-20240229-v1:0 | 0.725 | 15 | 75 |

File diff suppressed because one or more lines are too long

View File

@@ -310,7 +310,6 @@ function validateProviderModelCombination(providerName, modelId) {
function validateClaudeCodeSettings(settings) {
// Define the base settings schema without commandSpecific first
const BaseSettingsSchema = z.object({
pathToClaudeCodeExecutable: z.string().optional(),
maxTurns: z.number().int().positive().optional(),
customSystemPrompt: z.string().optional(),
appendSystemPrompt: z.string().optional(),

View File

@@ -522,7 +522,7 @@
"supported": true
},
{
"id": "sonar-deep-research",
"id": "deep-research",
"swe_score": 0.211,
"cost_per_1m_tokens": {
"input": 2,

View File

@@ -14,23 +14,20 @@ function enhanceRooMCPConfiguration(mcpPath) {
log('warn', `[Roo] MCP configuration file not found at ${mcpPath}`);
return;
}
try {
// Read the existing configuration
const mcpConfig = JSON.parse(fs.readFileSync(mcpPath, 'utf8'));
if (mcpConfig.mcpServers && mcpConfig.mcpServers['task-master-ai']) {
const server = mcpConfig.mcpServers['task-master-ai'];
// Add Roo-specific timeout enhancement for long-running AI operations
server.timeout = 300;
// Write the enhanced configuration back
fs.writeFileSync(mcpPath, formatJSONWithTabs(mcpConfig) + '\n');
log(
'debug',
`[Roo] Enhanced MCP configuration with timeout at ${mcpPath}`
);
log('debug', `[Roo] Enhanced MCP configuration with timeout at ${mcpPath}`);
} else {
log('warn', `[Roo] task-master-ai server not found in MCP configuration`);
}