ping-mcp-server 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/init.js +9 -10
- package/package.json +1 -1
- package/src/init.ts +12 -10
package/dist/init.js
CHANGED
|
@@ -9,10 +9,7 @@ var API_BASE_URL = process.env.PING_API_URL || "https://api.ping-money.com";
|
|
|
9
9
|
var CONFIG_DIR = path.join(os.homedir(), ".ping");
|
|
10
10
|
var CONFIG_FILE = path.join(CONFIG_DIR, "config.json");
|
|
11
11
|
var CLAUDE_CONFIG_PATHS = [
|
|
12
|
-
path.join(os.homedir(), ".
|
|
13
|
-
path.join(os.homedir(), ".claude", "config.json"),
|
|
14
|
-
path.join(os.homedir(), "Library", "Application Support", "Claude", "config.json"),
|
|
15
|
-
path.join(os.homedir(), ".config", "claude", "config.json")
|
|
12
|
+
path.join(os.homedir(), ".claude", "settings.json")
|
|
16
13
|
];
|
|
17
14
|
var BANNER = `
|
|
18
15
|
+------------------------------------------+
|
|
@@ -101,7 +98,7 @@ function findClaudeCodeConfigDir() {
|
|
|
101
98
|
if (existingConfig) {
|
|
102
99
|
return path.dirname(existingConfig);
|
|
103
100
|
}
|
|
104
|
-
const defaultDir = path.join(os.homedir(), ".
|
|
101
|
+
const defaultDir = path.join(os.homedir(), ".claude");
|
|
105
102
|
return defaultDir;
|
|
106
103
|
}
|
|
107
104
|
function addToClaudeCodeConfig(configPath) {
|
|
@@ -123,8 +120,9 @@ function addToClaudeCodeConfig(configPath) {
|
|
|
123
120
|
return true;
|
|
124
121
|
}
|
|
125
122
|
config.mcpServers.ping = {
|
|
123
|
+
type: "stdio",
|
|
126
124
|
command: "npx",
|
|
127
|
-
args: ["-y", "
|
|
125
|
+
args: ["-y", "-p", "ping-mcp-server", "ping-mcp"]
|
|
128
126
|
};
|
|
129
127
|
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
130
128
|
printSuccess(`Added Ping MCP server to: ${configPath}`);
|
|
@@ -164,9 +162,9 @@ async function main() {
|
|
|
164
162
|
if (claudeConfigPath) {
|
|
165
163
|
printInfo(`Found Claude Code config: ${claudeConfigPath}`);
|
|
166
164
|
} else if (claudeConfigDir) {
|
|
167
|
-
printInfo(`Will create Claude Code config at: ${path.join(claudeConfigDir, "
|
|
165
|
+
printInfo(`Will create Claude Code config at: ${path.join(claudeConfigDir, "settings.json")}`);
|
|
168
166
|
}
|
|
169
|
-
const targetConfigPath = claudeConfigPath || path.join(claudeConfigDir, "
|
|
167
|
+
const targetConfigPath = claudeConfigPath || path.join(claudeConfigDir, "settings.json");
|
|
170
168
|
print("");
|
|
171
169
|
const answer = await prompt("Add Ping MCP server to Claude Code? (y/n): ");
|
|
172
170
|
if (answer === "y" || answer === "yes") {
|
|
@@ -176,13 +174,14 @@ async function main() {
|
|
|
176
174
|
}
|
|
177
175
|
} else {
|
|
178
176
|
printInfo("Skipped Claude Code integration.");
|
|
179
|
-
printInfo("You can manually add this to your
|
|
177
|
+
printInfo("You can manually add this to your ~/.claude/settings.json:");
|
|
180
178
|
print("");
|
|
181
179
|
print(" {");
|
|
182
180
|
print(' "mcpServers": {');
|
|
183
181
|
print(' "ping": {');
|
|
182
|
+
print(' "type": "stdio",');
|
|
184
183
|
print(' "command": "npx",');
|
|
185
|
-
print(' "args": ["-y", "
|
|
184
|
+
print(' "args": ["-y", "-p", "ping-mcp-server", "ping-mcp"]');
|
|
186
185
|
print(" }");
|
|
187
186
|
print(" }");
|
|
188
187
|
print(" }");
|
package/package.json
CHANGED
package/src/init.ts
CHANGED
|
@@ -25,10 +25,7 @@ const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
|
|
|
25
25
|
|
|
26
26
|
// Possible Claude Code config locations
|
|
27
27
|
const CLAUDE_CONFIG_PATHS = [
|
|
28
|
-
path.join(os.homedir(), '.
|
|
29
|
-
path.join(os.homedir(), '.claude', 'config.json'),
|
|
30
|
-
path.join(os.homedir(), 'Library', 'Application Support', 'Claude', 'config.json'),
|
|
31
|
-
path.join(os.homedir(), '.config', 'claude', 'config.json'),
|
|
28
|
+
path.join(os.homedir(), '.claude', 'settings.json'),
|
|
32
29
|
];
|
|
33
30
|
|
|
34
31
|
// ============================================================
|
|
@@ -152,18 +149,20 @@ function findClaudeCodeConfigDir(): string | null {
|
|
|
152
149
|
}
|
|
153
150
|
|
|
154
151
|
// Default location for Claude Code config
|
|
155
|
-
const defaultDir = path.join(os.homedir(), '.
|
|
152
|
+
const defaultDir = path.join(os.homedir(), '.claude');
|
|
156
153
|
return defaultDir;
|
|
157
154
|
}
|
|
158
155
|
|
|
159
156
|
interface ClaudeCodeConfig {
|
|
160
157
|
mcpServers?: {
|
|
161
158
|
[key: string]: {
|
|
159
|
+
type: string;
|
|
162
160
|
command: string;
|
|
163
161
|
args?: string[];
|
|
164
162
|
env?: Record<string, string>;
|
|
165
163
|
};
|
|
166
164
|
};
|
|
165
|
+
[key: string]: unknown;
|
|
167
166
|
}
|
|
168
167
|
|
|
169
168
|
function addToClaudeCodeConfig(configPath: string): boolean {
|
|
@@ -194,9 +193,11 @@ function addToClaudeCodeConfig(configPath: string): boolean {
|
|
|
194
193
|
}
|
|
195
194
|
|
|
196
195
|
// Add Ping MCP server
|
|
196
|
+
// -p flag tells npx which package to install, then runs the ping-mcp binary from it
|
|
197
197
|
config.mcpServers.ping = {
|
|
198
|
+
type: 'stdio',
|
|
198
199
|
command: 'npx',
|
|
199
|
-
args: ['-y', '
|
|
200
|
+
args: ['-y', '-p', 'ping-mcp-server', 'ping-mcp'],
|
|
200
201
|
};
|
|
201
202
|
|
|
202
203
|
// Write updated config
|
|
@@ -252,10 +253,10 @@ async function main() {
|
|
|
252
253
|
if (claudeConfigPath) {
|
|
253
254
|
printInfo(`Found Claude Code config: ${claudeConfigPath}`);
|
|
254
255
|
} else if (claudeConfigDir) {
|
|
255
|
-
printInfo(`Will create Claude Code config at: ${path.join(claudeConfigDir, '
|
|
256
|
+
printInfo(`Will create Claude Code config at: ${path.join(claudeConfigDir, 'settings.json')}`);
|
|
256
257
|
}
|
|
257
258
|
|
|
258
|
-
const targetConfigPath = claudeConfigPath || path.join(claudeConfigDir!, '
|
|
259
|
+
const targetConfigPath = claudeConfigPath || path.join(claudeConfigDir!, 'settings.json');
|
|
259
260
|
|
|
260
261
|
print('');
|
|
261
262
|
const answer = await prompt('Add Ping MCP server to Claude Code? (y/n): ');
|
|
@@ -267,13 +268,14 @@ async function main() {
|
|
|
267
268
|
}
|
|
268
269
|
} else {
|
|
269
270
|
printInfo('Skipped Claude Code integration.');
|
|
270
|
-
printInfo('You can manually add this to your
|
|
271
|
+
printInfo('You can manually add this to your ~/.claude/settings.json:');
|
|
271
272
|
print('');
|
|
272
273
|
print(' {');
|
|
273
274
|
print(' "mcpServers": {');
|
|
274
275
|
print(' "ping": {');
|
|
276
|
+
print(' "type": "stdio",');
|
|
275
277
|
print(' "command": "npx",');
|
|
276
|
-
print(' "args": ["-y", "
|
|
278
|
+
print(' "args": ["-y", "-p", "ping-mcp-server", "ping-mcp"]');
|
|
277
279
|
print(' }');
|
|
278
280
|
print(' }');
|
|
279
281
|
print(' }');
|