mcp-tasks supports an optional configuration file .mcp-tasks.edn in
your project root (sibling to the .mcp-tasks/ directory). This file
allows you to explicitly control whether git integration is used for
task tracking.
Configuration schema:
{:use-git? true} ; Enable git mode
{:use-git? false} ; Disable git mode
{:enable-git-sync? true} ; Enable git sync before modifications (default: same as :use-git?)
{:enable-git-sync? false} ; Disable git sync (faster for local-only workflows)
{:branch-management? false} ; Disable branch management (default when key is absent)
{:branch-management? true} ; Enable branch management for both story tasks and standalone tasks
{:worktree-management? false} ; Disable worktree management (default when key is absent)
{:worktree-management? true} ; Enable automatic worktree management (implies :branch-management? true)
{:worktree-prefix :project-name} ; Include project name in worktree directory (default)
{:worktree-prefix :none} ; Omit project name prefix from worktree directory
{:tasks-dir ".mcp-tasks"} ; Directory for task storage (default: .mcp-tasks relative to config file)
File location:
project-root/
├── .mcp-tasks/ # Task files directory
└── .mcp-tasks.edn # Optional configuration file
The :tasks-dir configuration option specifies where task files (tasks.ednl, complete.ednl, prompts/, etc.) are stored.
Default behavior: When :tasks-dir is not specified, it defaults to .mcp-tasks relative to the config file's directory.
Path resolution rules:
All paths are resolved relative to the directory containing .mcp-tasks.edn, not the current working directory. This ensures consistent behavior regardless of where the MCP server is invoked from.
.mcp-tasks relative to config file's directoryValidation:
:tasks-dir is explicitly specified in the config, the path must exist or server startup will fail:tasks-dir is not specified (using default), the .mcp-tasks directory will be created if it doesn't existExamples:
Absolute path example:
;; Store tasks in a centralized location
{:tasks-dir "/home/user/.mcp-tasks/my-project"}
Relative path example (sibling directory):
;; Store tasks in a sibling directory
{:tasks-dir "../shared-tasks"}
Relative path example (subdirectory):
;; Store tasks in a subdirectory
{:tasks-dir "tasks"}
Default behavior (no :tasks-dir specified):
;; Defaults to .mcp-tasks relative to config file
{:use-git? true}
;; Equivalent to:
{:use-git? true
:tasks-dir ".mcp-tasks"}
Error behavior:
If you explicitly specify a :tasks-dir that doesn't exist, the server will fail at startup with a clear error message:
Configured :tasks-dir does not exist: ../nonexistent-path
Use cases:
/home/user/.mcp-tasks/my-project/ to keep all project tasks in one location../shared-tasks to share tasks across multiple related projectsThe :branch-management? configuration option enables automatic git branch creation and switching during task execution.
Default behavior: When :branch-management? is not present in the config, it defaults to false (no branch management).
Applies to: Both story tasks and standalone tasks
Dependency on git mode: Branch management requires git mode to be enabled. This means:
:use-git? must be true (either explicitly set or auto-detected via .mcp-tasks/.git):use-git? false and :branch-management? true, branch operations will fail at runtime since there's no git repository for the .mcp-tasks directoryIndependent use of git mode: Note that :use-git? can be used independently without :branch-management?. This allows you to version-control task tracking history without automatic branch creation for each task.
Branch naming convention:
Sanitization pattern (same for both):
task-<task-id> if result is emptyExamples:
Story title: "Implement Branch Management for Tasks"
→ Branch name: "implement-branch-management-for-tasks"
Task title: "Update documentation for new config option"
→ Branch name: "update-documentation-for-new-config-option"
Task title: "Fix bug #123"
→ Branch name: "fix-bug-123"
Task title: "!!!" (empty after sanitization, task-id=45)
→ Branch name: "task-45"
The :worktree-management? configuration option enables automatic git worktree creation and management during task execution. This provides better isolation for parallel development efforts by creating separate working directories for different tasks or stories.
Default behavior: When :worktree-management? is not present in the config, it defaults to false (no worktree management).
Applies to: Both story tasks and standalone tasks
Dependency on branch management: Worktree management requires branch management to be enabled because worktrees must be on specific branches. When :worktree-management? true, the system automatically enables :branch-management? true.
Worktree location: Worktrees are created in sibling directories (parent of project directory).
Worktree naming convention:
The :worktree-prefix option controls whether the project name is included in worktree directory names:
:project-name (default): Include project name prefix
<project-name>-<story-or-task-name>:none: Omit project name prefix
<story-or-task-name>Where:
<project-name>: Derived from current directory name<story-or-task-name>: Title converted using same sanitization as branch namesExamples with :worktree-prefix :project-name (default):
Project: "mcp-tasks", Story: "Add Git Worktree Management Option"
→ Worktree path: "../mcp-tasks-add-git-worktree-management-option"
Project: "mcp-tasks", Task: "Fix parser bug"
→ Worktree path: "../mcp-tasks-fix-parser-bug"
Examples with :worktree-prefix :none:
Project: "mcp-tasks", Story: "Add Git Worktree Management Option"
→ Worktree path: "../add-git-worktree-management-option"
Project: "mcp-tasks", Task: "Fix parser bug"
→ Worktree path: "../fix-parser-bug"
Worktree lifecycle:
Creation: When executing a task with :worktree-management? true:
Reuse: Existing worktrees are reused across multiple executions of the same story/task
Cleanup: After task/story completion:
git worktree removeError handling: All worktree operations fail-fast with clear error messages:
The :enable-git-sync? configuration option controls whether modification tools (add-task, update-task, delete-task, complete-task) automatically pull the latest changes from the git remote before making changes.
Default behavior: When :enable-git-sync? is not specified, it defaults to the value of :use-git?. This means git sync is automatically enabled when git mode is enabled, and disabled when git mode is disabled.
When to disable sync:
When to keep sync enabled (default):
Behavior with sync enabled:
Behavior with sync disabled:
Examples:
;; Disable sync for faster local-only development
{:use-git? true
:enable-git-sync? false}
;; Enable sync for multi-agent collaboration (default)
{:use-git? true
:enable-git-sync? true}
;; Explicit false when git mode is disabled (redundant but clear)
{:use-git? false
:enable-git-sync? false}
Note: Disabling sync does not affect git commits. Changes are still committed to the .mcp-tasks git repository; only the automatic pull before modifications is skipped.
When no .mcp-tasks.edn file is present, mcp-tasks automatically
detects whether to use git mode by checking for the presence of
.mcp-tasks/.git directory:
.mcp-tasks/.git exists, the system assumes
you want git integration.mcp-tasks/.git does not exist, the system
operates without gitPrecedence: Explicit configuration in .mcp-tasks.edn always
overrides auto-detection.
When the MCP server starts, it validates the configuration:
.mcp-tasks.edn exists, it must be valid EDN with correct schema.mcp-tasks/.git existsExample error messages:
Git mode enabled but .mcp-tasks/.git not found
Invalid config: :use-git? must be a boolean
Malformed EDN in .mcp-tasks.edn: ...
The configuration affects two main behaviors:
When using the complete-task tool:
Task completed: <task description>
{"modified-files": ["tasks.ednl", "complete.ednl"]}
Task completed: <task description>
Task execution prompts adapt based on git mode:
Git mode: Includes instructions to commit task file changes to
.mcp-tasks repository
Non-git mode: Omits git instructions, focuses only on file operations
Main repository independence: The git mode configuration only
affects the .mcp-tasks directory. Your main project repository commits
are completely independent:
Git mode ON: Commits are made to both .mcp-tasks/.git (for task
tracking) and your main repo (for code changes)
Git mode OFF: Commits are made only to your main repo (for code changes), task files are updated without version control
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |