mirror of
https://github.com/eyaltoledano/claude-task-master.git
synced 2026-01-30 06:12:05 +00:00
feat(project-root): enhance project root detection with boundary markers (#1545)
This commit is contained in:
@@ -24,7 +24,8 @@
|
||||
"dependencies": {
|
||||
"@tm/core": "*",
|
||||
"fastmcp": "^3.23.0",
|
||||
"zod": "^4.1.11"
|
||||
"zod": "^4.1.11",
|
||||
"dotenv": "^16.6.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^1.9.4",
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* Shared utilities for MCP tools
|
||||
*/
|
||||
|
||||
import dotenv from 'dotenv';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import {
|
||||
@@ -395,6 +396,13 @@ export function withToolContext<TArgs extends { projectRoot?: string }>(
|
||||
args: TArgs & { projectRoot: string },
|
||||
context: Context<undefined>
|
||||
) => {
|
||||
// Load project .env if it exists (won't overwrite MCP-provided env vars)
|
||||
// This ensures project-specific env vars are available to tool execution
|
||||
const envPath = path.join(args.projectRoot, '.env');
|
||||
if (fs.existsSync(envPath)) {
|
||||
dotenv.config({ path: envPath });
|
||||
}
|
||||
|
||||
// Create tmCore instance
|
||||
const tmCore = await createTmCore({
|
||||
projectPath: args.projectRoot,
|
||||
|
||||
Reference in New Issue
Block a user