ping-mcp-server 0.1.2 → 0.1.3
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 +11 -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", "ping-mcp-server"]
|
|
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", "ping-mcp-server"]');
|
|
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 {
|
|
@@ -195,8 +194,9 @@ function addToClaudeCodeConfig(configPath: string): boolean {
|
|
|
195
194
|
|
|
196
195
|
// Add Ping MCP server
|
|
197
196
|
config.mcpServers.ping = {
|
|
197
|
+
type: 'stdio',
|
|
198
198
|
command: 'npx',
|
|
199
|
-
args: ['-y', '
|
|
199
|
+
args: ['-y', 'ping-mcp-server'],
|
|
200
200
|
};
|
|
201
201
|
|
|
202
202
|
// Write updated config
|
|
@@ -252,10 +252,10 @@ async function main() {
|
|
|
252
252
|
if (claudeConfigPath) {
|
|
253
253
|
printInfo(`Found Claude Code config: ${claudeConfigPath}`);
|
|
254
254
|
} else if (claudeConfigDir) {
|
|
255
|
-
printInfo(`Will create Claude Code config at: ${path.join(claudeConfigDir, '
|
|
255
|
+
printInfo(`Will create Claude Code config at: ${path.join(claudeConfigDir, 'settings.json')}`);
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
-
const targetConfigPath = claudeConfigPath || path.join(claudeConfigDir!, '
|
|
258
|
+
const targetConfigPath = claudeConfigPath || path.join(claudeConfigDir!, 'settings.json');
|
|
259
259
|
|
|
260
260
|
print('');
|
|
261
261
|
const answer = await prompt('Add Ping MCP server to Claude Code? (y/n): ');
|
|
@@ -267,13 +267,14 @@ async function main() {
|
|
|
267
267
|
}
|
|
268
268
|
} else {
|
|
269
269
|
printInfo('Skipped Claude Code integration.');
|
|
270
|
-
printInfo('You can manually add this to your
|
|
270
|
+
printInfo('You can manually add this to your ~/.claude/settings.json:');
|
|
271
271
|
print('');
|
|
272
272
|
print(' {');
|
|
273
273
|
print(' "mcpServers": {');
|
|
274
274
|
print(' "ping": {');
|
|
275
|
+
print(' "type": "stdio",');
|
|
275
276
|
print(' "command": "npx",');
|
|
276
|
-
print(' "args": ["-y", "
|
|
277
|
+
print(' "args": ["-y", "ping-mcp-server"]');
|
|
277
278
|
print(' }');
|
|
278
279
|
print(' }');
|
|
279
280
|
print(' }');
|