Troubleshooting
Common issues and solutions when using Better Context.
Installation Issues
Command Not Found
Problem: btrx: command not found
Causes:
- Better Context not installed globally
- Path issues after installation
- npm link not executed
Solutions:
Check if npm link was run:
cd /path/to/better-context npm link
Verify global installation:
npm list -g btrx
Check your PATH:
echo $PATH which btrx
Reinstall if needed:
npm unlink btrx npm link
Dependencies Issues
Problem: Error during npm install
Common Errors:
npm ERR! peer dep missing
npm ERR! ERESOLVE unable to resolve dependency tree
Solutions:
Clear npm cache:
npm cache clean --force
Delete node_modules and reinstall:
rm -rf node_modules package-lock.json npm install
Use legacy peer deps (if needed):
npm install --legacy-peer-deps
Check Node.js version:
node --version # Should be >= 22
Startup Issues
Port Already in Use
Problem: "Port 3001 is already in use"
Solutions:
Find what's using the port:
lsof -i :3001 lsof -i :3000
Kill the process:
kill -9 <PID>
Use different ports:
# Modify src/config.ts export const API_PORT = 3011 // API server and MCP transport export const WEB_PORT = 3010 // Web interface
Check for other Better Context instances:
ps aux | grep btrx
Database Migration Errors
Problem: "Migration failed" or database errors
Solutions:
Reset database:
rm -rf ~/.bettercontext btrx
Verify permissions:
ls -la ~/.bettercontext
Desktop App Won't Open
Problem: Command runs but desktop app doesn't appear
Causes:
- Tauri build issues
- Display/graphics problems
- Permission issues
Solutions:
Check if Tauri is built:
ls -la src-tauri/target/debug/
Check system requirements:
- macOS: 10.14 or later
- Windows: Windows 10 or later
- Linux: Recent distribution with GUI
Runtime Issues
AI Integration Issues
Problem: AI tools can't connect to Better Context
Symptoms:
- "MCP server unavailable"
- "Tools not found"
- "Connection timeout"
Diagnostic Steps:
Test MCP server HTTP endpoint:
curl -X POST http://localhost:3001/mcp \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "ping", "id": 1}'
This should return a JSON response confirming the MCP server is running.
Test API server health:
curl http://localhost:3001/api/cwd
This should return your current working directory.
Verify AI client configuration: Check your AI client's MCP server configuration to ensure it's pointing to the correct Better Context server endpoint at
http://localhost:3001/mcp
with transport typestreamableHttp
.
Solutions:
Restart Better Context:
# Stop the current instance (Ctrl+C if running in terminal) # Then restart btrx
Check HTTP streaming connection: The MCP server uses HTTP streamable transport for communication. Ensure your AI client is properly connecting to the MCP endpoint at
http://localhost:3001/mcp
with the correct transport type.Verify configuration format:
{ "mcpServers": [ "btrx": { "autoApprove": [], "disabled": false, "url": "http://localhost:3001/mcp", "type": "streamableHttp" } ] }
Getting Help
Collect System Information
When reporting issues, include:
# System info
uname -a
node --version
npm --version
# Better Context version
# Are you using the latest commit from the main branch?
Report Issues
When reporting bugs:
- Include error messages (full stack traces)
- Describe steps to reproduce
- Provide system information
- Share relevant configuration
- Include sample code (if possible)
Community Resources
- GitHub Issues: Report bugs and feature requests
- Documentation: Check latest documentation updates