Every document filename now mirrors its lifecycle state with a status suffix (e.g., .draft.md, .wip.md, .accepted.md). No more bare .md for tracked document types. Also renamed all from_str methods to parse to avoid FromStr trait confusion, introduced StagingDeploymentParams struct, and fixed all 19 clippy warnings across the codebase. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2.8 KiB
Spike: Blue Not Detected Fix
| Status | In Progress |
| Date | 2026-01-26 |
| Time Box | 1 hour |
Question
Why does blue_rfc_get (and other Blue MCP tools) fail with "Blue not detected in this directory" when called without explicit cwd parameter?
Investigation
Root Cause
- MCP servers are started by Claude Code as child processes
- The server's working directory is NOT the project directory
- When
cwdisn't passed in tool args,ensure_state()can't find.blue/
What We Tried
-
Fall back to
std::env::current_dir()- Doesn't work because the MCP server process starts from a different directory (likely Claude Code's install location or $HOME) -
Extract roots from initialize params - Added code to check for
rootsandworkspaceFoldersin initialize params. Need to verify if Claude Code sends these.
MCP Protocol Options
Per MCP Spec:
- Roots capability - Server can advertise
rootscapability, then client provides roots viaroots/list - Client info - Initialize params may include workspace info
Potential Solutions
Option A: Wrapper Script
Create a wrapper that finds the project root:
#!/bin/bash
# blue-mcp-wrapper
cd "$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
exec blue mcp
MCP config:
{
"mcpServers": {
"blue": {
"command": "/path/to/blue-mcp-wrapper"
}
}
}
Pros: Simple, works immediately Cons: Requires wrapper script, git dependency
Option B: Environment Variable
Check CLAUDE_PROJECT_DIR or similar env var set by Claude Code.
Status: Need to verify if Claude Code sets such a variable.
Option C: Walk Up Directory Tree
In ensure_state(), if cwd check fails, walk up from process cwd looking for .blue/:
fn find_blue_root() -> Option<PathBuf> {
let mut dir = std::env::current_dir().ok()?;
loop {
if dir.join(".blue").exists() {
return Some(dir);
}
if !dir.pop() {
return None;
}
}
}
Pros: No external dependencies Cons: May find wrong project if nested
Option D: Use MCP Roots Protocol
Properly implement MCP roots:
- Advertise
rootscapability in initialize response - Handle
roots/listrequest from client - Store roots and use first root as project dir
Pros: Standard MCP approach Cons: Requires Claude Code to send roots (need to verify)
Recommendation
Try Option D first (MCP roots), then fall back to Option C (walk up tree) if Claude Code doesn't send roots.
Next Steps
- Add logging to see what Claude Code sends in initialize
- Implement roots handling
- Add directory tree walk as fallback
- Test and verify
Conclusion
Pending investigation completion