File tree Expand file tree Collapse file tree 6 files changed +13
-274
lines changed Expand file tree Collapse file tree 6 files changed +13
-274
lines changed Original file line number Diff line number Diff line change @@ -157,19 +157,15 @@ ${getErrorMessage(error)}`;
157
157
158
158
// start the MCP server if `--mcp` is present
159
159
if ( process . argv . includes ( "--mcp" ) ) {
160
- const { mcpServer } = require ( "../lib/mcp/mcp-server" ) ;
161
- const {
162
- StdioServerTransport,
163
- } = require ( "@modelcontextprotocol/sdk/server/stdio.js" ) ;
164
-
165
- await mcpServer . connect ( new StdioServerTransport ( ) ) ;
160
+ console . warn (
161
+ "You can also run this command directly using 'npx @eslint/mcp@latest'." ,
162
+ ) ;
166
163
167
- // Note: do not use console.log() because stdout is part of the server transport
168
- console . error ( `ESLint MCP server is running. cwd: ${ process . cwd ( ) } ` ) ;
164
+ const spawn = require ( "cross-spawn" ) ;
169
165
170
- process . on ( "SIGINT ", ( ) => {
171
- mcpServer . close ( ) ;
172
- process . exitCode = 0 ;
166
+ spawn . sync ( "npx ", [ "@eslint/mcp@latest" ] , {
167
+ encoding : "utf8" ,
168
+ stdio : "inherit" ,
173
169
} ) ;
174
170
return ;
175
171
}
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ Create a `.vscode/mcp.json` file in your project with the following configuratio
23
23
"ESLint" : {
24
24
"type" : " stdio" ,
25
25
"command" : " npx" ,
26
- "args" : [" eslint" , " -- mcp" ]
26
+ "args" : [" @ eslint/ mcp@latest " ]
27
27
}
28
28
}
29
29
}
@@ -34,7 +34,7 @@ Alternatively, you can use the Command Palette:
34
34
1 . Press ` Ctrl+Shift+P ` (Windows/Linux) or ` Cmd+Shift+P ` (macOS)
35
35
2 . Type and select ` MCP: Add Server `
36
36
3 . Select ` Command (stdio) ` from the dropdown
37
- 4 . Enter ` npx eslint -- mcp ` as the command
37
+ 4 . Enter ` npx @ eslint/ mcp@latest ` as the command
38
38
5 . Type ` ESLint ` as the server ID
39
39
6 . Choose ` Workspace Settings ` to create the configuration in ` .vscode/mcp.json `
40
40
@@ -76,7 +76,7 @@ Create a `.cursor/mcp.json` file in your project directory with the following co
76
76
"mcpServers" : {
77
77
"eslint" : {
78
78
"command" : " npx" ,
79
- "args" : [" eslint" , " -- mcp" ],
79
+ "args" : [" @ eslint/ mcp@latest " ],
80
80
"env" : {}
81
81
}
82
82
}
@@ -112,7 +112,7 @@ Add the following configuration to your `~/.codeium/windsurf/mcp_config.json` fi
112
112
"mcpServers" : {
113
113
"eslint" : {
114
114
"command" : " npx" ,
115
- "args" : [" eslint" , " -- mcp" ],
115
+ "args" : [" @ eslint/ mcp@latest " ],
116
116
"env" : {}
117
117
}
118
118
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 115
115
"@humanfs/node" : " ^0.16.6" ,
116
116
"@humanwhocodes/module-importer" : " ^1.0.1" ,
117
117
"@humanwhocodes/retry" : " ^0.4.2" ,
118
- "@modelcontextprotocol/sdk" : " ^1.8.0" ,
119
118
"@types/estree" : " ^1.0.6" ,
120
119
"@types/json-schema" : " ^7.0.15" ,
121
120
"ajv" : " ^6.12.4" ,
139
138
"lodash.merge" : " ^4.6.2" ,
140
139
"minimatch" : " ^3.1.2" ,
141
140
"natural-compare" : " ^1.4.0" ,
142
- "optionator" : " ^0.9.3" ,
143
- "zod" : " ^3.24.2"
141
+ "optionator" : " ^0.9.3"
144
142
},
145
143
"devDependencies" : {
146
144
"@arethetypeswrong/cli" : " ^0.17.0" ,
Original file line number Diff line number Diff line change @@ -1241,7 +1241,7 @@ describe("bin/eslint.js", () => {
1241
1241
} ) ;
1242
1242
1243
1243
child . stderr . on ( "data" , data => {
1244
- assert . match ( data . toString ( ) , / E S L i n t M C P s e r v e r i s r u n n i n g / u) ;
1244
+ assert . match ( data . toString ( ) , / @ e s l i n t \/ m c p / u) ;
1245
1245
done ( ) ;
1246
1246
} ) ;
1247
1247
} ) ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments