📌 UPDATED DOCUMENTATION This migration guide covers changes through v0.19.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-java@debugmcp/adapter-dotnet@debugmcp/adapter-mock
- Adapters are bundled at build time into the
@debugmcp/mcp-debuggerCLI package (not optional npm dependencies that consumers install separately) - The core discovers and loads adapters on demand:
- Package naming:
@debugmcp/adapter-<language> - Factory class export:
<CapitalizedLanguage>AdapterFactory(named export; the loader looks up this class name via convention)
- Package naming:
- Install the package (adapter packages are bundled as optional dependencies):
npm install @debugmcp/mcp-debugger
- Verify availability:
- Call the
list_supported_languagestool (from your MCP client) to see which adapters are discoverable - All adapter packages are included as optional dependencies of
@debugmcp/mcp-debuggerand are installed automatically when available
- 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 the primary parameter. Use executablePath instead. The server's ToolArguments still includes legacy parameters for normalization, but executablePath is the preferred/current parameter.
Old:
enum DebugLanguage {
PYTHON = 'python' // Only Python
}New:
enum DebugLanguage {
PYTHON = 'python',
JAVASCRIPT = 'javascript',
RUST = 'rust',
GO = 'go',
JAVA = 'java',
DOTNET = 'dotnet',
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/)MCP_WORKSPACE_ROOT- Workspace root path used for container-mode path resolution (default:/workspace); set this when mounting your project at a non-default pathCONSOLE_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 { DebugSessionInfo } from '@debugmcp/shared';
-
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 (via MCP tool call) const languages = await mcp.call('list_supported_languages'); // 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 named factory class named<Language>AdapterFactory. TheAdapterLoaderattempts to import@debugmcp/adapter-<language>and falls back to built module entrypoints atnode_modules/@debugmcp/adapter-<language>/dist/index.jsandpackages/adapter-<language>/dist/index.js. -
Current language enum (in
@debugmcp/sharedmodels):enum DebugLanguage { PYTHON = 'python', JAVASCRIPT = 'javascript', RUST = 'rust', GO = 'go', JAVA = 'java', DOTNET = 'dotnet', 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:
// Sessions are managed internally as ManagedSession objects;
// the public-facing type is DebugSessionInfo from @debugmcp/shared
interface DebugSessionInfo {
id: string;
language: DebugLanguage;
name: string;
state: SessionState;
createdAt: Date;
updatedAt: Date;
}Breaking: Some internal events have changed names.
Old:
sessionManager.on('pythonStarted', handler);New:
// Event names are adapter-lifecycle based (e.g., 'stopped', 'terminated', 'adapter-configured')
sessionManager.on('stopped', 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', 'java', 'dotnet', '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 uses dynamic adapter loading:
- Implement
IDebugAdapterinterface in a package named@debugmcp/adapter-<language> - Export a factory class named
<CapitalizedLanguage>AdapterFactory - The
AdapterLoaderdiscovers and imports the package at runtime via convention -- no manual registration in core code is needed - Add the language to the
DebugLanguageenum in@debugmcp/shared
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!