@aihubspot/agent-trade-mcp 0.1.12 → 0.1.13

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.
Files changed (3) hide show
  1. package/README.md +9 -1
  2. package/dist/index.js +36 -10
  3. 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 Codex 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`.
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 getMcpClientConfigPath(client, value = runtime()) {
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
- return path.join(value.home, "Library", "Application Support", "Claude", "claude_desktop_config.json");
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
- mergeJsonMcpConfig(getMcpClientConfigPath(id, value), server);
2968
- process.stdout.write(`Configured ${this.name}: ${getMcpClientConfigPath(id, value)}
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,33 @@ 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
+ ...server.args.flatMap((argument) => ["--arg", argument])
3011
+ ];
3012
+ executeClientRegistration("openclaw", args, value);
3013
+ process.stdout.write(
3014
+ `Configured ${this.name} with local stdio MCP server "${server.name}". Run \`openclaw mcp doctor ${server.name} --probe\` to verify it.
3015
+ `
3016
+ );
3017
+ }
3018
+ };
3019
+ }
2995
3020
  var MCP_CLIENT_ADAPTERS = {
2996
3021
  cursor: jsonFileAdapter("cursor"),
2997
3022
  "claude-desktop": jsonFileAdapter("claude-desktop"),
2998
3023
  "claude-code": cliAdapter("claude-code"),
2999
- codex: cliAdapter("codex")
3024
+ codex: cliAdapter("codex"),
3025
+ openclaw: openClawAdapter()
3000
3026
  };
3001
3027
  function runMcpSetup(options, value = runtime()) {
3002
3028
  const adapter = MCP_CLIENT_ADAPTERS[options.client];
@@ -3202,7 +3228,7 @@ function readOption(args, option) {
3202
3228
  }
3203
3229
  function printUsage() {
3204
3230
  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 Codex.\n"
3231
+ "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
3232
  );
3207
3233
  }
3208
3234
  async function main(argv) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aihubspot/agent-trade-mcp",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "Local stdio MCP server for AI Hub spot trading tools",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {