📌 UPDATED DOCUMENTATION This migration guide covers changes through v0.15.0, including dynamic adapter loading and major UX improvements.
This release introduces dynamic discovery and loading of language adapters at runtime. The core no longer statically imports adapters; instead, it uses a loader/registry to import packages by convention.
- Adapters live in separate packages:
@debugmcp/adapter-python@debugmcp/adapter-javascript@debugmcp/adapter-rust@debugmcp/adapter-go@debugmcp/adapter-mock
- Adapters are treated as optional dependencies in consumers
- The core discovers and loads adapters on demand:
- Package naming:
@debugmcp/adapter-<language> - Factory class export:
<CapitalizedLanguage>AdapterFactory - Default export (adapter package):
{ name: '<language>', factory: <Language>AdapterFactory }
- Package naming:
- Install core only:
npm install @debugmcp/mcp-debugger
- Install core + Python adapter:
npm install @debugmcp/mcp-debugger @debugmcp/adapter-python
- Verify availability:
- Call the
list_supported_languagestool (from your MCP client) to see which adapters are discoverable - If a language is missing, install its adapter package
- Call the
- Stdout in stdio mode must be NDJSON-only; the runtime preloads a silencer that mirrors logs to
/app/logswithout altering protocol - If you use
whichin minimal Node images, ensureisexeis also present (runtime dependency)
- No breaking API changes from v0.14.x
- Existing tool calls continue to work; dynamic loading only changes how adapters are supplied to the core
The v0.12.0 release adds several AI-friendly features that enhance the debugging experience without breaking existing code:
-
Path Validation: No more cryptic crashes! File paths are now validated before operations.
set_breakpointandstart_debuggingnow validate files exist- Clear error messages instead of "[WinError 267]" crashes
- Shows resolved paths and working directory context
-
Line Context in Breakpoints: The
set_breakpointresponse now includes an optionalcontextfield:{ "success": true, "breakpointId": "...", "context": { "lineContent": " result = a + b", "surrounding": [ { "line": 10, "content": "def add(a, b):" }, { "line": 11, "content": " result = a + b" }, { "line": 12, "content": " return result" } ] } } -
get_source_contextTool: Previously unimplemented, now fully functional:{ "sessionId": "...", "file": "script.py", "line": 50, "linesContext": 5 // Optional, default: 5 }
No Migration Required: All v0.12.0 features are additive and backward compatible. Your existing code will continue to work, and you can adopt the new features at your convenience.
The mcp-debugger has undergone a major architectural change: the transformation from a Python-specific debugger to a multi-language debugging platform using the adapter pattern. This version removes all backward compatibility with the old pythonPath parameter.
Before (v0.9.x):
- Python-specific implementation throughout
pythonPathparameter in APIs- Direct debugpy integration in core code
- Limited to Python debugging only
After (v0.10.0):
- Language-agnostic core with adapters
executablePathparameter (language-neutral)- Adapter pattern for language support
- Extensible to any language with DAP support
Old API:
{
"tool": "create_debug_session",
"arguments": {
"language": "python",
"pythonPath": "/usr/bin/python3",
"name": "My Session"
}
}New API:
{
"tool": "create_debug_session",
"arguments": {
"language": "python",
"executablePath": "/usr/bin/python3", // Changed from pythonPath
"name": "My Session"
}
}pythonPath is no longer supported. You must use executablePath.
Old:
enum DebugLanguage {
PYTHON = 'python' // Only Python
}New:
enum DebugLanguage {
PYTHON = 'python',
JAVASCRIPT = 'javascript',
RUST = 'rust',
GO = 'go',
MOCK = 'mock', // For testing
}No changes to environment variables. The following still work:
DEBUG_MCP_LOG_LEVEL- Logging level (default:info)MCP_CONTAINER- Set totruein container mode (forces log path to/app/logs/)CONSOLE_OUTPUT_SILENCED- Set to1to suppress console output (auto-set in stdio mode)
Launch configurations remain mostly the same, but are now processed through language adapters:
// Still works as before
{
stopOnEntry: true,
justMyCode: false,
env: { "MY_VAR": "value" },
cwd: "/path/to/project"
}If you're using mcp-debugger for Python debugging, you must update your code:
-
Update parameter names (required):
- "pythonPath": "/usr/bin/python3" + "executablePath": "/usr/bin/python3"
-
Update type imports (if using TypeScript):
- import { PythonDebugSession } from 'mcp-debugger'; + import { SessionInfo } from 'mcp-debugger';
-
No changes needed for:
- Breakpoint setting
- Step operations
- Variable inspection
- Expression evaluation
If you've built tools on top of mcp-debugger:
-
Update to new interfaces:
// Old: Direct Python coupling class MyTool { private pythonPath: string; } // New: Language-agnostic class MyTool { private language: DebugLanguage; private executablePath: string; }
-
Handle multiple languages:
// Check supported languages const languages = sessionManager.getSupportedLanguages(); // Validate before creating session if (!languages.includes(userLanguage)) { throw new Error(`Language ${userLanguage} not supported`); }
If you want to add support for a new language:
-
Create an adapter following the Adapter Development Guide
-
Register your adapter: Adapters are now dynamically loaded by convention. Place your adapter package at
packages/adapter-<language>/and export a factory class named<Language>AdapterFactory. TheAdapterLoaderwill discover and register it automatically at runtime. -
Current language enum (in
packages/shared/src/models/index.ts):enum DebugLanguage { PYTHON = 'python', JAVASCRIPT = 'javascript', RUST = 'rust', GO = 'go', MOCK = 'mock', MYLANG = 'mylang' // Add your language }
Breaking: Direct access to Python utilities is no longer available.
Old:
import { findPythonPath } from 'mcp-debugger/python-utils';
const pythonPath = await findPythonPath();New:
// Use adapter methods instead
const adapter = registry.create('python', config);
const executablePath = await adapter.resolveExecutablePath();Breaking: Session info structure has changed.
Old:
interface DebugSession {
id: string;
pythonPath: string;
// ...
}New:
interface SessionInfo {
sessionId: string;
language: DebugLanguage;
name: string;
state: SessionState;
config: SessionConfig;
createdAt: Date;
proxyPort?: number;
}Breaking: Some internal events have changed names.
Old:
sessionManager.on('pythonStarted', handler);New:
sessionManager.on('adapterConnected', handler);-
pythonPathparameter- Status: REMOVED
- Alternative: Use
executablePath - Migration: Required - update all references
-
Session migration utilities
- Status: REMOVED
- The
session-migration.tsfile has been deleted - All code must use the new parameter names
-
Backward compatibility layer
- Status: REMOVED
- No automatic mapping from
pythonPathtoexecutablePath - Direct updates required
Problem: TypeScript error when using old parameter name.
Solution: Update to executablePath (only option):
// Required change
{ executablePath: "/usr/bin/python3" }
// This will NO LONGER work:
// { pythonPath: "/usr/bin/python3" } // ❌ ERRORProblem: Trying to use a language without an adapter.
Solution: Check supported languages first:
const supported = await mcp.call('list_supported_languages');
if (!supported.includes('node')) {
console.log('Node.js debugging not yet available');
}Problem: Imports fail after upgrade.
Solution: Update import paths:
// Old
import { PythonDebugger } from 'mcp-debugger/lib/python';
// New
import { SessionManager } from 'mcp-debugger';// Test that existing Python debugging still works
const session = await mcp.createDebugSession({
language: 'python',
executablePath: '/usr/bin/python3' // MUST use executablePath
});
await mcp.startDebugging({
sessionId: session.sessionId,
script: 'test.py'
});
// Should work exactly as before// Verify adapter is being used
const languages = await mcp.getSupportedLanguages();
console.log('Supported:', languages); // Should include 'python', 'javascript', 'rust', 'go', 'mock'// Test that events still fire correctly
sessionManager.on('stopped', (event) => {
console.log('Still works:', event);
});-
Documentation:
-
Examples:
- Mock Adapter - Reference implementation
- Python Adapter - Production example
-
Support:
- GitHub Issues: Report migration problems
- Discussions: Ask questions about the new architecture
- Update
pythonPathtoexecutablePathin API calls - Update TypeScript imports if using types directly
- Test existing Python debugging functionality
- Review breaking changes section
- Update any custom error handling
- Test with your specific use cases
- Plan for deprecated feature removal
To ensure smooth upgrades to v1.0.0:
- Stop using deprecated features as soon as possible
- Use language-agnostic APIs instead of Python-specific ones
- Test with deprecation warnings enabled
- Follow the adapter pattern for any custom extensions
The new architecture makes it easy to add language support:
- Implement
IDebugAdapterinterface - Register with
AdapterRegistry - No core changes needed!
See the Adapter Development Guide for details.
The v0.10.0 migration is designed to be smooth for existing Python users while opening the door for multi-language support. Most code will continue to work with minimal changes, and the deprecation timeline gives you plenty of time to update.
Key takeaways:
pythonPath→executablePath(old name no longer works - update required)- Python debugging functionality unchanged
- New adapter pattern enables multi-language support
- Clean architecture without backward compatibility baggage
Welcome to the future of multi-language debugging with mcp-debugger!