Release v0.2.0: Comprehensive Web App Debugging Support#1
Merged
markomanninen merged 4 commits intomainfrom Oct 31, 2025
Merged
Release v0.2.0: Comprehensive Web App Debugging Support#1markomanninen merged 4 commits intomainfrom
markomanninen merged 4 commits intomainfrom
Conversation
This commit introduces several security and optimization enhancements to the MCP server. Security: - Disabled the `run_in_terminal` function to prevent arbitrary code execution. - Added path traversal protection to the `read_text_file` function. - Sanitized input for the `run_tests_json` function to prevent command injection. Optimization: - Cached the Python executable path to avoid redundant searches. - Cached agent instructions to avoid redundant file reads. - Made the `read_text_file` function asynchronous to prevent blocking the event loop.
This commit implements full web application debugging support using dap_launch and removes all non-functional dap_attach code, cleaning up the codebase. ## Key Changes ### Web App Debugging Implementation - Added Flask debugging example with launcher script (examples/web_flask/run_flask.py) - Created comprehensive automated tests (tests/test_web_app_debug.py) - Demonstrates HTTP-triggered breakpoints in web applications - Tests verify breakpoint hits in loops and variable inspection ### Code Cleanup - Removed dap_attach() function (187 lines) - does not work with debugpy - Removed DirectDAPClient references from mcp_server.py - Simplified StdioDAPClient to launch-only mode - Deleted non-functional attach mode logic ### Documentation Updates - agent_instructions.md: Added "Debugging Web Applications" section - docs/mcp_usage.md: Updated with web app debugging workflow - docs/DEBUGGING_WEB_APPS.md: New comprehensive guide - examples/web_flask/README.md: Complete rewrite with correct workflow - examples/gui_counter/README.md: Added GUI debugging instructions ### New Files - examples/web_flask/run_flask.py: Flask launcher for debugging - examples/gui_counter/run_counter_debug.py: GUI counter launcher - tests/test_web_app_debug.py: Automated web app debugging tests - docs/DEBUGGING_WEB_APPS.md: Comprehensive debugging guide ### Linting & Configuration - Fixed ruff, black, and mypy linting issues - Updated .pre-commit-config.yaml to exclude examples from mypy - Updated pyproject.toml with explicit package bases configuration - Added types-aiofiles for proper type checking ### Why dap_attach was removed The dap_attach approach was investigated but does not work with debugpy. When you run `python -m debugpy --listen`, debugpy does not work with debugpy does not respond to DAP attach requests. dap_launch is the unified solution for all debugging scenarios including web servers, GUI apps, and scripts. ### Test Results All 9 tests passing: - 7 core tests (mcp_server, cli, end-to-end) - 2 new web app debugging tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎉 Major Features
Full Web Application Debugging
dap_launchNew Examples & Documentation
examples/web_flask/run_flask.py- Flask app launcher for debuggingtests/test_web_app_debug.py- Comprehensive automated tests (2 tests, both passing)docs/DEBUGGING_WEB_APPS.md- Complete guide for web app debuggingagent_instructions.mdRemoved
dap_attach()The
dap_attachapproach was investigated but does not work with debugpy. When you runpython -m debugpy --listen, debugpy does not respond to DAP attach requests.Migration: Use
dap_launchfor ALL debugging scenarios:✨ What's New
Files Added
examples/web_flask/run_flask.py- Flask debugging launcherexamples/gui_counter/run_counter_debug.py- GUI counter launchertests/test_web_app_debug.py- Automated web app debugging testsdocs/DEBUGGING_WEB_APPS.md- Comprehensive debugging guide.envrc- Auto-activate venv with direnvDocumentation Updates
🔧 Improvements
Code Quality
types-aiofilesfor proper type checkingTesting
Developer Experience
.envrcfor automatic venv activation with direnv.venvby default📊 Test Results
All 9 tests passing in 45.57s
🚀 Ready to Merge
This PR is ready for review and merge. All tests pass, documentation is comprehensive, and the code has been thoroughly cleaned up.