Skip to content

Commit 80813ed

Browse files
committed
Refactor tools and remove deprecated features
- Renamed 'codebase_trace' to 'exp_codebase_trace' for clarity. - Deleted the 'dragrace' tool due to redundancy and lack of use. - Updated index to remove reference to the deleted 'dragrace' tool. - Added new 'elicitation-demo' tool to demonstrate MCP Elicitation feature with various field types. - Renamed 'file_edit' to 'exp_file_edit' and 'file_read' to 'exp_file_read' for consistency. - Removed the 'wait' tool as it was deemed unnecessary. - Updated tools aggregation to include the new 'elicitation-demo' tool.
1 parent 43e579f commit 80813ed

18 files changed

Lines changed: 435 additions & 1623 deletions

docs/mcp-vs-lm-tools.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# MCP Tools vs LM Tools
2+
3+
## Overview
4+
5+
VS Code DevTools exposes two distinct toolsets, each serving a different role and running in a different VS Code context.
6+
7+
## LM Tools (Language Model Tools)
8+
9+
**Context:** Host workspace (production VS Code instance)
10+
**Purpose:** Stable, production-ready tools registered via `vscode.lm.registerTool()`
11+
**Target audience:** Copilot and other language model agents working in the main VS Code session
12+
13+
### Available LM Tools
14+
15+
| Tool | Description |
16+
|------|-------------|
17+
| `output_read` | Read VS Code output channel logs from Host and Client sessions |
18+
| `terminal_read` | Read terminal output, state, and detect prompts |
19+
| `terminal_execute` | Execute commands in the terminal or send input to waiting terminals |
20+
| `wait` | Wait for a specified duration (0–30000ms) before continuing |
21+
22+
### Characteristics
23+
24+
- Run **inside the Host VS Code process** with full VS Code API access
25+
- Registered unconditionally at extension activation
26+
- Can be individually enabled/disabled via VS Code's native **Configure Tools...** button in Copilot Chat
27+
- Declared in `package.json``contributes.languageModelTools`
28+
- Implemented in `extension/services/`
29+
30+
## MCP Tools (Model Context Protocol)
31+
32+
**Context:** Client workspace (Extension Development Host)
33+
**Purpose:** Experimental and browser-automation tools served via the MCP server
34+
**Target audience:** MCP clients (Inspector, Claude Desktop, etc.) connected to the stdio MCP server
35+
36+
### Standard MCP Tools
37+
38+
These tools interact with the Client's browser/webview and are considered stable:
39+
40+
| Tool | Description |
41+
|------|-------------|
42+
| `keyboard_hotkey` | Press key combinations |
43+
| `keyboard_type` | Type text into inputs |
44+
| `mouse_click` | Click elements |
45+
| `mouse_drag` | Drag elements |
46+
| `mouse_hover` | Hover over elements |
47+
| `mouse_scroll` | Scroll elements |
48+
| `take_snapshot` | Take an accessibility tree snapshot |
49+
| `take_screenshot` | Take a screenshot |
50+
| `read_console` | Read browser console messages |
51+
52+
### Experimental MCP Tools (exp_ prefix)
53+
54+
These tools are under active development and may change significantly:
55+
56+
| Tool | Description |
57+
|------|-------------|
58+
| `exp_codebase_map` | Get a structural map of the codebase |
59+
| `exp_codebase_trace` | Trace a symbol through the codebase |
60+
| `exp_codebase_lint` | Find dead code and quality issues |
61+
| `exp_file_read` | Read files with flexible targeting |
62+
| `exp_file_edit` | Edit files in the workspace |
63+
| `exp_elicitation_demo` | Demonstrate MCP elicitation (SDK preview) |
64+
65+
### Characteristics
66+
67+
- Run in the **MCP server process** (Node.js, outside VS Code)
68+
- Communicate with the Client VS Code via named pipes
69+
- Served over MCP stdio transport (JSON-RPC)
70+
- All tools available when the MCP server is connected
71+
- Experimental tools prefixed with `exp_` to signal instability
72+
73+
## Key Differences
74+
75+
| Aspect | LM Tools | MCP Tools |
76+
|--------|----------|-----------|
77+
| Runtime | VS Code extension (Host) | MCP server process |
78+
| Protocol | VS Code Language Model API | MCP (JSON-RPC over stdio) |
79+
| Context | Host workspace | Client workspace |
80+
| Toggle | Native VS Code tool config | Always available when connected |
81+
| Stability | Production-ready | Standard + experimental |
82+
| Naming | Plain names | Standard or `exp_` prefixed |
83+
84+
## Configuration
85+
86+
### Workspace Selection
87+
88+
The active workspace for MCP tools is configured via:
89+
90+
1. CLI: `--test-workspace /path/to/workspace`
91+
2. Config: `.devtools/devtools.jsonc``"testWorkspace": "relative/or/absolute/path"`
92+
93+
The sidebar **Workspace Root** panel shows all Git repositories discovered by VS Code's Git extension. Selecting a repository writes its relative path to `.devtools/devtools.jsonc`.
94+
95+
### LM Tool Toggles
96+
97+
LM tools are registered unconditionally at extension startup. Users can enable/disable individual tools using VS Code's native **Configure Tools...** button in Copilot Chat.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
"docs:generate": "node --experimental-strip-types scripts/generate-docs.ts",
2020
"start": "pnpm run build && node build/src/index.js",
2121
"start-debug": "DEBUG=mcp:* DEBUG_COLORS=false pnpm run build && node build/src/index.js",
22+
"inspect": "pnpm run build && npx @modelcontextprotocol/inspector node build/src/index.js --test-workspace ../test-workspace --extension ../extension",
23+
"inspect:cli": "pnpm run build && npx @modelcontextprotocol/inspector --cli node build/src/index.js --test-workspace ../test-workspace --extension ../extension",
2224
"test": "pnpm run build && node scripts/test.mjs",
2325
"test:no-build": "node scripts/test.mjs",
2426
"test:only": "pnpm run build && node scripts/test.mjs --test-only",
@@ -34,7 +36,6 @@
3436
"license": "Apache-2.0",
3537
"devDependencies": {
3638
"@eslint/js": "^10.0.1",
37-
"@modelcontextprotocol/sdk": "1.26.0",
3839
"@rollup/plugin-commonjs": "^29.0.0",
3940
"@rollup/plugin-json": "^6.1.0",
4041
"@rollup/plugin-node-resolve": "^16.0.3",
@@ -68,6 +69,7 @@
6869
"node": "^20.19.0 || ^22.12.0 || >=23"
6970
},
7071
"dependencies": {
72+
"@modelcontextprotocol/sdk": "1.27.0",
7173
"get-port": "^7.1.0",
7274
"jsonc-parser": "^3.3.0",
7375
"logpare": "^0.1.0",

0 commit comments

Comments
 (0)