Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .vscode-test.mjs
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.

import { defineConfig } from '@vscode/test-cli';

export default defineConfig({
Expand Down
30 changes: 30 additions & 0 deletions AGENTS.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
# Agent Guidelines for DebugMCP

## File Header
Include the following header in each source file (adjust comment syntax as needed).
`// Copyright (c) Microsoft Corporation.`

## Build/Lint/Test Commands
- **Compile**: `npm run compile` - Compiles TypeScript to JavaScript in `out/` directory
- **Lint**: `npm run lint` - Runs ESLint on `src/` directory
- **Test**: `npm test` - Runs all tests (compiles + lints first via pretest)
- **Single Test**: Use VSCode Test Explorer or `npm test` (no CLI test filtering available)
- **Watch Mode**: `npm run watch` - Compiles TypeScript in watch mode

## Code Style & Conventions
- **TypeScript**: Strict mode enabled, target ES2022, Node16 modules
- **Imports**: Use camelCase/PascalCase naming. Import order: vscode → external → internal (e.g., `./utils/logger`)
- **Naming**: camelCase for variables/functions, PascalCase for classes/interfaces, prefix interfaces with `I` (e.g., `IDebuggingHandler`)
- **Types**: Explicit types preferred, use strict null checks, avoid `any` unless necessary
- **Error Handling**: Use try-catch with descriptive error messages, throw `Error` objects (not literals)
- **Formatting**: Use semicolons, curly braces for all control structures, consistent indentation (tabs)
- **Async**: Use async/await, handle promises properly, implement exponential backoff for retries
- **VSCode API**: Import as `import * as vscode from 'vscode'`, use proper disposal in `context.subscriptions`
- **Logging**: Use `logger` from `./utils/logger` for all logging (info/error/warn)
- **Dependencies**: fastmcp (MCP server), express (HTTP), zod (validation), @modelcontextprotocol/sdk

## Architecture Notes
- VSCode extension with MCP server for AI agent debugging capabilities
- Main entry: `extension.ts` → activates MCP server and registers commands
- Core: `debuggingHandler.ts` handles debug operations, `debuggingExecutor.ts` executes VSCode debug API calls
- State: `debugState.ts` tracks current debugging session state
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,4 +11,4 @@ instructions provided by the bot. You will only need to do this once across all

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
Copyright (c) Microsoft Corporation.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
27 changes: 27 additions & 0 deletions README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -158,6 +158,33 @@ npm install
npm run compile
```

## Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

## Security

Security vulnerabilities should be reported following the guidance at [https://aka.ms/SECURITY.md](https://aka.ms/SECURITY.md).
Please do not report security vulnerabilities through public GitHub issues.

## Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
trademarks or logos is subject to and must follow
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
Any use of third-party trademarks or logos are subject to those third-party's policies.

## License

MIT License - See [LICENSE](LICENSE.txt) for details
2 changes: 2 additions & 0 deletions eslint.config.mjs
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.

import typescriptEslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/debugMCPServer.ts
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.

import * as vscode from 'vscode';
import { z } from 'zod';
import * as path from 'path';
Expand Down
2 changes: 2 additions & 0 deletions src/debugState.ts
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.

/**
* Represents the current state of a debugging session
*/
Expand Down
2 changes: 2 additions & 0 deletions src/debuggingExecutor.ts
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.

import * as vscode from 'vscode';
import { DebugState } from './debugState';

Expand Down
2 changes: 2 additions & 0 deletions src/debuggingHandler.ts
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.

import * as vscode from 'vscode';
import { IDebugConfigurationManager } from './utils/debugConfigurationManager';
import { DebugState } from './debugState';
Expand Down
2 changes: 2 additions & 0 deletions src/extension.ts
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.

import * as vscode from 'vscode';
import { DebugMCPServer } from './debugMCPServer';
import { AgentConfigurationManager } from './utils/agentConfigurationManager';
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.

// Export all debugging-related classes and interfaces
export { DebugState } from './debugState';
export { DebuggingExecutor, IDebuggingExecutor } from './debuggingExecutor';
Expand Down
2 changes: 2 additions & 0 deletions src/test/debuggingHandler.test.ts
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.

import * as assert from 'assert';
import { DebugState } from '../debugState';
import { DebuggingHandler } from '../debuggingHandler';
Expand Down
2 changes: 2 additions & 0 deletions src/test/extension.test.ts
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.

import * as assert from 'assert';

// You can import and use all API from the 'vscode' module
Expand Down
2 changes: 2 additions & 0 deletions src/utils/agentConfigurationManager.ts
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.

import * as vscode from 'vscode';
import * as fs from 'fs';
import * as path from 'path';
Expand Down
2 changes: 2 additions & 0 deletions src/utils/debugConfigurationManager.ts
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.

import * as vscode from 'vscode';
import * as path from 'path';

Expand Down
2 changes: 2 additions & 0 deletions src/utils/logger.ts
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.

import * as fs from 'fs';
import * as path from 'path';
import * as os from 'os';
Expand Down