@aihubspot/agent-trade-mcp 0.1.12 → 0.1.14
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/README.md +9 -1
- package/dist/index.js +39 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,11 +15,19 @@ ai-hub-trade-mcp setup --client cursor --profile default
|
|
|
15
15
|
ai-hub-trade-mcp setup --client claude-desktop --profile default
|
|
16
16
|
ai-hub-trade-mcp setup --client claude-code --profile default
|
|
17
17
|
ai-hub-trade-mcp setup --client codex --profile default
|
|
18
|
+
ai-hub-trade-mcp setup --client openclaw --profile default
|
|
18
19
|
ai-hub-trade-mcp setup --client codex --profile default --toolset full
|
|
19
20
|
ai-hub-trade-mcp setup --client codex --profile default --response-mode compat
|
|
20
21
|
```
|
|
21
22
|
|
|
22
|
-
Setup registers the currently installed MCP binary through its absolute Node runtime and entrypoint path, so desktop clients do not depend on a global PATH or an unpublished `npx` package. Cursor and Claude Desktop configurations are merged with existing MCP servers through their JSON configurations. Claude Code and
|
|
23
|
+
Setup registers the currently installed MCP binary through its absolute Node runtime and entrypoint path, so desktop clients do not depend on a global PATH or an unpublished `npx` package. Cursor and Claude Desktop configurations are merged with existing MCP servers through their JSON configurations. Claude Code, Codex, and OpenClaw are registered through their official CLIs; Claude Code uses user scope. Existing JSON configurations are validated, atomically updated, and backed up before their first modification. The setup command stores no API credentials; the MCP server continues to read its profile from `~/.ai-hub/config.toml`.
|
|
24
|
+
|
|
25
|
+
For OpenClaw, run setup on the machine that runs the OpenClaw Gateway and as the same operating-system user as that Gateway. The selected AI Hub profile must exist in that user's `~/.ai-hub/config.toml`. Verify the registration after setup:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
openclaw mcp doctor ai-hub-trade-mcp-default --probe
|
|
29
|
+
openclaw mcp reload
|
|
30
|
+
```
|
|
23
31
|
|
|
24
32
|
## Spot market-order units
|
|
25
33
|
|
package/dist/index.js
CHANGED
|
@@ -2855,7 +2855,8 @@ var MCP_CLIENT_NAMES = {
|
|
|
2855
2855
|
cursor: "Cursor",
|
|
2856
2856
|
"claude-desktop": "Claude Desktop",
|
|
2857
2857
|
"claude-code": "Claude Code",
|
|
2858
|
-
codex: "Codex"
|
|
2858
|
+
codex: "Codex",
|
|
2859
|
+
openclaw: "OpenClaw"
|
|
2859
2860
|
};
|
|
2860
2861
|
var SUPPORTED_MCP_CLIENTS = Object.keys(MCP_CLIENT_NAMES);
|
|
2861
2862
|
function runtime() {
|
|
@@ -2890,15 +2891,17 @@ function findMicrosoftStoreClaudePath(value, home) {
|
|
|
2890
2891
|
return void 0;
|
|
2891
2892
|
}
|
|
2892
2893
|
}
|
|
2893
|
-
function
|
|
2894
|
-
if (client === "cursor") return path.join(value.home, ".cursor", "mcp.json");
|
|
2894
|
+
function getMcpClientConfigPaths(client, value = runtime()) {
|
|
2895
|
+
if (client === "cursor") return [path.join(value.home, ".cursor", "mcp.json")];
|
|
2895
2896
|
if (value.platform === "win32") {
|
|
2896
|
-
return findMicrosoftStoreClaudePath(value.localAppData, value.home) ?? path.join(windowsAppData(value.appData, value.home), "Claude", "claude_desktop_config.json");
|
|
2897
|
+
return [findMicrosoftStoreClaudePath(value.localAppData, value.home) ?? path.join(windowsAppData(value.appData, value.home), "Claude", "claude_desktop_config.json")];
|
|
2897
2898
|
}
|
|
2898
2899
|
if (value.platform === "darwin") {
|
|
2899
|
-
|
|
2900
|
+
const legacyPath = path.join(value.home, "Library", "Application Support", "Claude", "claude_desktop_config.json");
|
|
2901
|
+
const modernPath = path.join(value.home, "Library", "Application Support", "Claude-3p", "claude_desktop_config.json");
|
|
2902
|
+
return fs.existsSync(modernPath) ? [legacyPath, modernPath] : [legacyPath];
|
|
2900
2903
|
}
|
|
2901
|
-
return path.join(value.xdgConfigHome ?? path.join(value.home, ".config"), "Claude", "claude_desktop_config.json");
|
|
2904
|
+
return [path.join(value.xdgConfigHome ?? path.join(value.home, ".config"), "Claude", "claude_desktop_config.json")];
|
|
2902
2905
|
}
|
|
2903
2906
|
function buildServerSpec(profile, toolset, responseMode, launch) {
|
|
2904
2907
|
return {
|
|
@@ -2964,8 +2967,9 @@ function jsonFileAdapter(id) {
|
|
|
2964
2967
|
id,
|
|
2965
2968
|
name: MCP_CLIENT_NAMES[id],
|
|
2966
2969
|
install(server, value) {
|
|
2967
|
-
|
|
2968
|
-
|
|
2970
|
+
const configPaths = getMcpClientConfigPaths(id, value);
|
|
2971
|
+
for (const configPath of configPaths) mergeJsonMcpConfig(configPath, server);
|
|
2972
|
+
process.stdout.write(`Configured ${this.name}: ${configPaths.join(", ")}
|
|
2969
2973
|
Restart ${this.name} to apply changes.
|
|
2970
2974
|
`);
|
|
2971
2975
|
}
|
|
@@ -2992,11 +2996,36 @@ function cliAdapter(id) {
|
|
|
2992
2996
|
}
|
|
2993
2997
|
};
|
|
2994
2998
|
}
|
|
2999
|
+
function openClawAdapter() {
|
|
3000
|
+
return {
|
|
3001
|
+
id: "openclaw",
|
|
3002
|
+
name: MCP_CLIENT_NAMES.openclaw,
|
|
3003
|
+
install(server, value) {
|
|
3004
|
+
const args = [
|
|
3005
|
+
"mcp",
|
|
3006
|
+
"add",
|
|
3007
|
+
server.name,
|
|
3008
|
+
"--command",
|
|
3009
|
+
server.command,
|
|
3010
|
+
// OpenClaw's option parser treats a separate value beginning with
|
|
3011
|
+
// "--" as one of its own flags. The equals form preserves the exact
|
|
3012
|
+
// child-process argument, including MCP flags such as --profile.
|
|
3013
|
+
...server.args.flatMap((argument) => [`--arg=${argument}`])
|
|
3014
|
+
];
|
|
3015
|
+
executeClientRegistration("openclaw", args, value);
|
|
3016
|
+
process.stdout.write(
|
|
3017
|
+
`Configured ${this.name} with local stdio MCP server "${server.name}". Run \`openclaw mcp doctor ${server.name} --probe\` to verify it.
|
|
3018
|
+
`
|
|
3019
|
+
);
|
|
3020
|
+
}
|
|
3021
|
+
};
|
|
3022
|
+
}
|
|
2995
3023
|
var MCP_CLIENT_ADAPTERS = {
|
|
2996
3024
|
cursor: jsonFileAdapter("cursor"),
|
|
2997
3025
|
"claude-desktop": jsonFileAdapter("claude-desktop"),
|
|
2998
3026
|
"claude-code": cliAdapter("claude-code"),
|
|
2999
|
-
codex: cliAdapter("codex")
|
|
3027
|
+
codex: cliAdapter("codex"),
|
|
3028
|
+
openclaw: openClawAdapter()
|
|
3000
3029
|
};
|
|
3001
3030
|
function runMcpSetup(options, value = runtime()) {
|
|
3002
3031
|
const adapter = MCP_CLIENT_ADAPTERS[options.client];
|
|
@@ -3202,7 +3231,7 @@ function readOption(args, option) {
|
|
|
3202
3231
|
}
|
|
3203
3232
|
function printUsage() {
|
|
3204
3233
|
process.stdout.write(
|
|
3205
|
-
"AI Hub Agent Trade MCP\n\nUsage:\n ai-hub-trade-mcp [--profile <name>] [--toolset <default|full>] [--response-mode <compact|compat>] [--read-only]\n ai-hub-trade-mcp setup --client <client> [--profile <name>] [--toolset <default|full>] [--response-mode <compact|compat>]\n\nThe default command starts the local stdio MCP server.\nUse setup to register it with Cursor, Claude Desktop, Claude Code, or
|
|
3234
|
+
"AI Hub Agent Trade MCP\n\nUsage:\n ai-hub-trade-mcp [--profile <name>] [--toolset <default|full>] [--response-mode <compact|compat>] [--read-only]\n ai-hub-trade-mcp setup --client <client> [--profile <name>] [--toolset <default|full>] [--response-mode <compact|compat>]\n\nThe default command starts the local stdio MCP server.\nUse setup to register it with Cursor, Claude Desktop, Claude Code, Codex, or OpenClaw.\n"
|
|
3206
3235
|
);
|
|
3207
3236
|
}
|
|
3208
3237
|
async function main(argv) {
|