Skip to content

Commit 557b52b

Browse files
feat: improve MCP tool descriptions and dynamic version from package.json
- All breakpoint/watch tools now document session-independence - session_status lists all possible states (idle/running/paused/exited) - start_session clarifies pre-set breakpoints activate automatically - Server description explains tool group semantics upfront - MCP client version now read from package.json at runtime Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7ff1005 commit 557b52b

1 file changed

Lines changed: 16 additions & 9 deletions

File tree

clients/mcp/index.ts

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ import {
3434
Tool,
3535
} from '@modelcontextprotocol/sdk/types.js';
3636

37+
// eslint-disable-next-line @typescript-eslint/no-require-imports
38+
const { version: VERSION } = require('../../../package.json') as { version: string };
39+
3740
const PORT = Number(process.env.DEBUGAI_PORT ?? 7890);
3841
const HOST = process.env.DEBUGAI_HOST ?? '127.0.0.1';
3942

@@ -66,7 +69,7 @@ const TOOLS: Tool[] = [
6669
// ── Breakpoints ────────────────────────────────────────────────────────────
6770
{
6871
name: 'set_breakpoint',
69-
description: 'Set a breakpoint at a specific file and line. Optionally add a condition.',
72+
description: 'Set a breakpoint at a specific file and line. Can be called before or during a session — breakpoints persist and activate automatically when a session starts. Optionally add a condition.',
7073
inputSchema: {
7174
type: 'object',
7275
properties: {
@@ -79,12 +82,12 @@ const TOOLS: Tool[] = [
7982
},
8083
{
8184
name: 'list_breakpoints',
82-
description: 'List all currently set breakpoints.',
85+
description: 'List all currently set breakpoints, including those set before any session started.',
8386
inputSchema: { type: 'object', properties: {} },
8487
},
8588
{
8689
name: 'clear_breakpoint',
87-
description: 'Remove a breakpoint by its ID.',
90+
description: 'Remove a breakpoint by its ID. Works whether or not a session is active.',
8891
inputSchema: {
8992
type: 'object',
9093
properties: { id: { type: 'string', description: 'Breakpoint ID from list_breakpoints' } },
@@ -93,13 +96,13 @@ const TOOLS: Tool[] = [
9396
},
9497
{
9598
name: 'clear_all_breakpoints',
96-
description: 'Remove all breakpoints.',
99+
description: 'Remove all breakpoints. Works whether or not a session is active.',
97100
inputSchema: { type: 'object', properties: {} },
98101
},
99102
// ── Session ────────────────────────────────────────────────────────────────
100103
{
101104
name: 'start_session',
102-
description: 'Start a debug session using a named launch.json configuration.',
105+
description: 'Start a debug session for runtime control (continue, step, inspect). Pre-set breakpoints and watches activate automatically.',
103106
inputSchema: {
104107
type: 'object',
105108
properties: { config: { type: 'string', description: 'Name of the launch.json debug configuration' } },
@@ -118,7 +121,7 @@ const TOOLS: Tool[] = [
118121
},
119122
{
120123
name: 'session_status',
121-
description: 'Get the current debug session status (idle, running, paused).',
124+
description: 'Get the current debug session status. States: idle (no session), running (executing), paused (at breakpoint or step), exited (session ended).',
122125
inputSchema: { type: 'object', properties: {} },
123126
},
124127
// ── Execution ──────────────────────────────────────────────────────────────
@@ -190,7 +193,7 @@ const TOOLS: Tool[] = [
190193
},
191194
{
192195
name: 'watch',
193-
description: 'Register an expression to watch (display on every stop).',
196+
description: 'Register an expression to watch (displayed on every stop). Can be set before or during a session — watches activate automatically when a session starts.',
194197
inputSchema: {
195198
type: 'object',
196199
properties: { expression: { type: 'string', description: 'Expression to watch' } },
@@ -199,7 +202,7 @@ const TOOLS: Tool[] = [
199202
},
200203
{
201204
name: 'unwatch',
202-
description: 'Remove a watched expression. Omit expression to clear all watches.',
205+
description: 'Remove a watched expression. Works whether or not a session is active. Omit expression to clear all watches.',
203206
inputSchema: {
204207
type: 'object',
205208
properties: { expression: { type: 'string', description: 'Expression to remove (omit to clear all)' } },
@@ -249,7 +252,11 @@ async function dispatch(name: string, args: Record<string, unknown>): Promise<un
249252
// ── MCP server ───────────────────────────────────────────────────────────────
250253

251254
const server = new Server(
252-
{ name: 'debuggingai', version: '0.1.0' },
255+
{
256+
name: 'debuggingai',
257+
version: VERSION,
258+
description: 'Breakpoint and watch tools work independently of session state — call them any time. Session tools (start, stop, restart, continue, step, etc.) require an active session.',
259+
},
253260
{ capabilities: { tools: {} } },
254261
);
255262

0 commit comments

Comments
 (0)