Skip to content

Commit d9867aa

Browse files
committed
Fix MCP method handler errors and standardize server name to desktop-commander
1 parent 8b48d78 commit d9867aa

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@wonderwhy-er/desktop-commander",
3-
"version": "0.1.22",
3+
"version": "0.1.23",
44
"description": "MCP server for terminal operations and file editing",
55
"license": "MIT",
66
"author": "Eduards Ruzga",
@@ -31,7 +31,7 @@
3131
"link:local": "npm run build && npm link",
3232
"unlink:local": "npm unlink",
3333
"inspector": "npx @modelcontextprotocol/inspector dist/index.js",
34-
"npm-publish": "npm publish"
34+
"publish": "npm publish"
3535
},
3636
"publishConfig": {
3737
"access": "public"

setup-claude-server.js

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ try {
7373

7474
// Prepare the new server config based on OS
7575
// Determine if running through npx or locally
76-
const isNpx = import.meta.url.endsWith('dist/setup-claude-server.js');
76+
const isNpx = import.meta.url.endsWith('dist/setup-claude-server.js');
7777

7878
const serverConfig = isNpx ? {
7979
"command": "npx",
@@ -87,27 +87,26 @@ try {
8787
]
8888
};
8989

90-
// Add or update the terminal server config
90+
// Initialize mcpServers if it doesn't exist
9191
if (!config.mcpServers) {
9292
config.mcpServers = {};
9393
}
9494

95-
config.mcpServers.desktopCommander = serverConfig;
96-
97-
// Add puppeteer server if not present
98-
/*if (!config.mcpServers.puppeteer) {
99-
config.mcpServers.puppeteer = {
100-
"command": "npx",
101-
"args": ["-y", "@modelcontextprotocol/server-puppeteer"]
102-
};
103-
}*/
95+
// Check if the old "desktopCommander" exists and remove it
96+
if (config.mcpServers.desktopCommander) {
97+
logToFile('Found old "desktopCommander" installation. Removing it...');
98+
delete config.mcpServers.desktopCommander;
99+
}
100+
101+
// Add or update the terminal server config with the proper name "desktop-commander"
102+
config.mcpServers["desktop-commander"] = serverConfig;
104103

105104
// Write the updated config back
106105
writeFileSync(claudeConfigPath, JSON.stringify(config, null, 2), 'utf8');
107106

108-
logToFile('Successfully added MCP servers to Claude configuration!');
107+
logToFile('Successfully added MCP server to Claude configuration!');
109108
logToFile(`Configuration location: ${claudeConfigPath}`);
110-
logToFile('\nTo use the servers:\n1. Restart Claude if it\'s currently running\n2. The servers will be available in Claude\'s MCP server list');
109+
logToFile('\nTo use the server:\n1. Restart Claude if it\'s currently running\n2. The server will be available as "desktop-commander" in Claude\'s MCP server list');
111110

112111
} catch (error) {
113112
logToFile(`Error updating Claude configuration: ${error}`, true);

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const VERSION = '0.1.22';
1+
export const VERSION = '0.1.23';

0 commit comments

Comments
 (0)