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)}`;
157157
158158 // start the MCP server if `--mcp` is present
159159 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+ ) ;
166163
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" ) ;
169165
170- process . on ( "SIGINT ", ( ) => {
171- mcpServer . close ( ) ;
172- process . exitCode = 0 ;
166+ spawn . sync ( "npx ", [ "@eslint/mcp@latest" ] , {
167+ encoding : "utf8" ,
168+ stdio : "inherit" ,
173169 } ) ;
174170 return ;
175171 }
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
2323 "ESLint" : {
2424 "type" : " stdio" ,
2525 "command" : " npx" ,
26- "args" : [" eslint" , " -- mcp" ]
26+ "args" : [" @ eslint/ mcp@latest " ]
2727 }
2828 }
2929}
@@ -34,7 +34,7 @@ Alternatively, you can use the Command Palette:
34341 . Press ` Ctrl+Shift+P ` (Windows/Linux) or ` Cmd+Shift+P ` (macOS)
35352 . Type and select ` MCP: Add Server `
36363 . 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
38385 . Type ` ESLint ` as the server ID
39396 . Choose ` Workspace Settings ` to create the configuration in ` .vscode/mcp.json `
4040
@@ -76,7 +76,7 @@ Create a `.cursor/mcp.json` file in your project directory with the following co
7676 "mcpServers" : {
7777 "eslint" : {
7878 "command" : " npx" ,
79- "args" : [" eslint" , " -- mcp" ],
79+ "args" : [" @ eslint/ mcp@latest " ],
8080 "env" : {}
8181 }
8282 }
@@ -112,7 +112,7 @@ Add the following configuration to your `~/.codeium/windsurf/mcp_config.json` fi
112112 "mcpServers" : {
113113 "eslint" : {
114114 "command" : " npx" ,
115- "args" : [" eslint" , " -- mcp" ],
115+ "args" : [" @ eslint/ mcp@latest " ],
116116 "env" : {}
117117 }
118118 }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 115115 "@humanfs/node" : " ^0.16.6" ,
116116 "@humanwhocodes/module-importer" : " ^1.0.1" ,
117117 "@humanwhocodes/retry" : " ^0.4.2" ,
118- "@modelcontextprotocol/sdk" : " ^1.8.0" ,
119118 "@types/estree" : " ^1.0.6" ,
120119 "@types/json-schema" : " ^7.0.15" ,
121120 "ajv" : " ^6.12.4" ,
139138 "lodash.merge" : " ^4.6.2" ,
140139 "minimatch" : " ^3.1.2" ,
141140 "natural-compare" : " ^1.4.0" ,
142- "optionator" : " ^0.9.3" ,
143- "zod" : " ^3.24.2"
141+ "optionator" : " ^0.9.3"
144142 },
145143 "devDependencies" : {
146144 "@arethetypeswrong/cli" : " ^0.17.0" ,
Original file line number Diff line number Diff line change @@ -1241,7 +1241,7 @@ describe("bin/eslint.js", () => {
12411241 } ) ;
12421242
12431243 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) ;
12451245 done ( ) ;
12461246 } ) ;
12471247 } ) ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments