@whoisxmlapidotcom/mcp-whoisxmlapi 1.0.3 → 1.1.1

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 CHANGED
@@ -1,157 +1,21 @@
1
- # MCP Server `mcp-whoisxmlapi`
1
+ # @whoisxmlapidotcom/mcp-whoisxmlapi
2
2
 
3
- `mcp-whoisxmlapi` is a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) server that provides AI tools access to the WhoisXMLAPI in a secure and scalable way.
4
-
5
- For full documentation, see [the MCP Server documentation](https://mcp-whoisxmlapi.pages.dev/).
6
-
7
- ## Features
8
-
9
- - **Token-based Authentication**: Secure API access using bearer tokens configured via environment variables
10
- - **SSE Support**: Run as an HTTP server with Server-Sent Events (SSE) for web-based integrations
11
- - **Timeout Control**: Configurable request timeouts
3
+ This package bundles the prebuilt `mcp-whoisxmlapi` binaries for all supported platforms and automatically selects the correct one for the current operating system and CPU.
12
4
 
13
5
  ## Installation
14
6
 
15
- ### Option 1: Docker (Recommended)
16
-
17
- You can run `mcp-whoisxmlapi` directly with Docker without installing the binary:
18
-
19
- ```json
20
- {
21
- "mcpServers": {
22
- "whoisxmlapi": {
23
- "command": "docker",
24
- "args": [
25
- "run",
26
- "-i",
27
- "--rm",
28
- "-e", "WHOISXMLAPI_TOKEN",
29
- "whoisxmlapidotcom/mcp-whoisxmlapi:latest"
30
- // Add custom options if needed:
31
- // "--timeout=30s"
32
- ],
33
- "env": {
34
- "WHOISXMLAPI_TOKEN": "your-api-token-here"
35
- }
36
- }
37
- }
38
- }
39
- ```
40
-
41
- ### Option 2: npm
42
-
43
- Install via npm for convenience:
44
-
45
7
  ```bash
46
- # Install globally
47
8
  npm install -g @whoisxmlapidotcom/mcp-whoisxmlapi
48
-
49
- # Or install locally in your project
9
+ # or
50
10
  npm install @whoisxmlapidotcom/mcp-whoisxmlapi
51
11
  ```
52
12
 
53
- #### Editor Configuration with npm
54
-
55
- If installed globally via npm:
56
-
57
- ```json
58
- {
59
- "mcpServers": {
60
- "whoisxmlapi": {
61
- "command": "mcp-whoisxmlapi",
62
- "args": [
63
- // Uncomment and modify as needed:
64
- // "--timeout=30s"
65
- ],
66
- "env": {
67
- "WHOISXMLAPI_TOKEN": "your-api-token-here"
68
- }
69
- }
70
- }
71
- }
72
- ```
73
-
74
- If installed locally in a project:
75
-
76
- ```json
77
- {
78
- "mcpServers": {
79
- "whoisxmlapi": {
80
- "command": "npx",
81
- "args": [
82
- "@whoisxmlapidotcom/mcp-whoisxmlapi"
83
- // Add custom options if needed:
84
- // "--timeout=30s"
85
- ],
86
- "env": {
87
- "WHOISXMLAPI_TOKEN": "your-api-token-here"
88
- }
89
- }
90
- }
91
- }
92
- ```
93
-
94
- ### Option 3: Binary Download
95
-
96
- You can also download the appropriate binary for your operating system from the [Downloads](https://mcp-whoisxmlapi.pages.dev/downloads) page and provide the full path to the binary (e.g., `/path/to/mcp-whoisxmlapi`) in your editor configuration.
97
-
98
- ### Docker
99
-
100
- The MCP server is available as a Docker image using `stdio` to communicate:
101
-
102
- ```bash
103
- docker pull whoisxmlapidotcom/mcp-whoisxmlapi:latest
104
- docker run --rm -e WHOISXMLAPI_TOKEN=your-token whoisxmlapidotcom/mcp-whoisxmlapi:latest
105
- ```
106
-
107
- For SSE mode with Docker, expose the SSE port (default `3000`):
108
-
109
- ```bash
110
- docker run --rm -p 3000:3000 -e WHOISXMLAPI_TOKEN=your-token whoisxmlapidotcom/mcp-whoisxmlapi:latest --sse --sse-port 3000
111
- ```
112
-
113
- The configuration for SSE mode changes slightly in your editor's settings -- and note you'll need to run the Docker container in SSE mode for this to work prior to adding the configuration to your editor's or AI client settings:
114
-
115
- ```json
116
- {
117
- "mcpServers": {
118
- "whoisxmlapi": {
119
- "url": "http://localhost:3000"
120
- }
121
- }
122
- }
123
- ```
124
-
125
- Do note that some MCP Clients will not support non-HTTPS endpoints.
126
-
127
- With this configuration you can use the same MCP server for multiple AI clients at once: normally, AI clients will create multiple instances of an MCP server.
13
+ ## Usage
128
14
 
129
- ## Environment Variables
130
-
131
- - `WHOISXMLAPI_TOKEN`: Required. The API token for authenticating with the WhoisXMLAPI service.
132
-
133
- ## Running Modes
134
-
135
- ### Standard (stdio) Mode
136
-
137
- By default, `mcp-whoisxmlapi` runs in stdio mode, which is suitable for integration with editors and other tools that communicate via standard input/output.
138
-
139
- ```bash
140
- export WHOISXMLAPI_TOKEN=your-token-here
141
- mcp-whoisxmlapi
142
- ```
143
-
144
- ### Server-Sent Events (SSE) Mode
145
-
146
- Alternatively, you can run `mcp-whoisxmlapi` as an HTTP server with SSE support for web-based integrations:
15
+ Once installed, the CLI is available as `mcp-whoisxmlapi`. The wrapper script automatically selects the correct native binary for the current platform.
147
16
 
148
17
  ```bash
149
- export WHOISXMLAPI_TOKEN=your-token-here
150
- mcp-whoisxmlapi --sse --sse-port=3000
18
+ mcp-whoisxmlapi --help
151
19
  ```
152
20
 
153
- In SSE mode, the server will listen on the specified port (default: 3000) and provide the same MCP tools over HTTP using Server-Sent Events. This is useful for web applications or environments where stdio communication isn't practical.
154
-
155
- **Available SSE Options:**
156
- - `--sse`: Enable SSE server mode
157
- - `--sse-port=PORT`: Specify the port to listen on (default: 3000)
21
+ For configuration guides, environment variables, and tool descriptions see the public documentation at <https://mcp.whoisxmlapi.com/>.
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { spawn } from "node:child_process";
4
+ import { existsSync } from "node:fs";
5
+ import path from "node:path";
6
+ import { fileURLToPath } from "node:url";
7
+
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = path.dirname(__filename);
10
+
11
+ const PLATFORM_TARGETS = [
12
+ { platform: "darwin", arch: "x64", key: "darwin-x64" },
13
+ { platform: "darwin", arch: "arm64", key: "darwin-arm64" },
14
+ { platform: "linux", arch: "x64", key: "linux-x64" },
15
+ { platform: "linux", arch: "arm64", key: "linux-arm64" },
16
+ { platform: "linux", arch: "arm", key: "linux-arm" },
17
+ { platform: "win32", arch: "x64", key: "win32-x64" },
18
+ { platform: "win32", arch: "arm64", key: "win32-arm64" }
19
+ ];
20
+
21
+ const current = PLATFORM_TARGETS.find(
22
+ (target) => target.platform === process.platform && target.arch === process.arch
23
+ );
24
+
25
+ if (!current) {
26
+ throw new Error(`Unsupported platform combination: ${process.platform}/${process.arch}`);
27
+ }
28
+
29
+ const binaryName = process.platform === "win32" ? "mcp-whoisxmlapi.exe" : "mcp-whoisxmlapi";
30
+ const vendorRoot = path.join(__dirname, "..", "vendor", current.key);
31
+ const binaryPath = path.join(vendorRoot, binaryName);
32
+
33
+ if (!existsSync(binaryPath)) {
34
+ throw new Error(
35
+ `mcp-whoisxmlapi binary not found for ${current.key}. ` +
36
+ "Please reinstall the package or open an issue on GitHub."
37
+ );
38
+ }
39
+
40
+ const child = spawn(binaryPath, process.argv.slice(2), {
41
+ stdio: "inherit",
42
+ env: process.env
43
+ });
44
+
45
+ child.on("error", (err) => {
46
+ console.error(err);
47
+ process.exit(1);
48
+ });
49
+
50
+ child.on("exit", (code, signal) => {
51
+ if (signal) {
52
+ process.kill(process.pid, signal);
53
+ return;
54
+ }
55
+ process.exit(code ?? 1);
56
+ });
package/package.json CHANGED
@@ -1,45 +1,29 @@
1
1
  {
2
2
  "name": "@whoisxmlapidotcom/mcp-whoisxmlapi",
3
- "version": "1.0.3",
3
+ "version": "1.1.1",
4
+ "description": "MCP server for the WhoisXML API packaged for npm.",
5
+ "license": "Apache-2.0",
6
+ "type": "module",
4
7
  "bin": {
5
- "mcp-whoisxmlapi": "index.js"
8
+ "mcp-whoisxmlapi": "bin/mcp-whoisxmlapi.js"
6
9
  },
7
- "optionalDependencies": {
8
- "@whoisxmlapidotcom/mcp-whoisxmlapi_linux_arm": "1.0.3",
9
- "@whoisxmlapidotcom/mcp-whoisxmlapi_linux_amd64": "1.0.3",
10
- "@whoisxmlapidotcom/mcp-whoisxmlapi_linux_arm64": "1.0.3",
11
- "@whoisxmlapidotcom/mcp-whoisxmlapi_windows_amd64": "1.0.3",
12
- "@whoisxmlapidotcom/mcp-whoisxmlapi_windows_arm": "1.0.3",
13
- "@whoisxmlapidotcom/mcp-whoisxmlapi_windows_arm64": "1.0.3",
14
- "@whoisxmlapidotcom/mcp-whoisxmlapi_darwin_amd64": "1.0.3",
15
- "@whoisxmlapidotcom/mcp-whoisxmlapi_darwin_arm64": "1.0.3"
16
- },
17
- "os": [
18
- "linux",
19
- "win32",
20
- "darwin"
21
- ],
22
- "cpu": [
23
- "arm",
24
- "x64",
25
- "arm64"
26
- ],
27
10
  "files": [
28
- "README.md"
11
+ "bin",
12
+ "vendor",
13
+ "README.md",
14
+ "LICENSE"
29
15
  ],
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/whois-api-llc/mcp-whoisxmlapi"
19
+ },
30
20
  "keywords": [
31
21
  "mcp",
32
- "mcp-server",
33
22
  "whoisxmlapi",
34
- "whois",
35
- "reverse-dns",
36
- "reverse-whois",
37
- "ip-geolocation",
38
- "ip-whois",
39
- "domain-whois",
40
- "domain-availability",
41
- "domain-search",
42
- "domain-status"
23
+ "model-context-protocol",
24
+ "mcp-server"
43
25
  ],
44
- "description": "A MCP server for the WhoisXML API"
45
- }
26
+ "engines": {
27
+ "node": ">=18"
28
+ }
29
+ }
Binary file
Binary file
package/index.js DELETED
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
- const path = require('path');
3
- const child_process = require('child_process');
4
- const mapping = { linux_arm: [ '@whoisxmlapidotcom', 'mcp-whoisxmlapi_linux_arm', 'mcp-whoisxmlapi' ], linux_x64: [ '@whoisxmlapidotcom', 'mcp-whoisxmlapi_linux_amd64', 'mcp-whoisxmlapi' ], linux_arm64: [ '@whoisxmlapidotcom', 'mcp-whoisxmlapi_linux_arm64', 'mcp-whoisxmlapi' ], win32_x64: [ '@whoisxmlapidotcom', 'mcp-whoisxmlapi_windows_amd64', 'mcp-whoisxmlapi.exe' ], win32_arm: [ '@whoisxmlapidotcom', 'mcp-whoisxmlapi_windows_arm', 'mcp-whoisxmlapi.exe' ], win32_arm64: [ '@whoisxmlapidotcom', 'mcp-whoisxmlapi_windows_arm64', 'mcp-whoisxmlapi.exe' ], darwin_x64: [ '@whoisxmlapidotcom', 'mcp-whoisxmlapi_darwin_amd64', 'mcp-whoisxmlapi' ], darwin_arm64: [ '@whoisxmlapidotcom', 'mcp-whoisxmlapi_darwin_arm64', 'mcp-whoisxmlapi' ] };
5
- const modulesDirectory = path.dirname(path.dirname(__dirname));
6
- const definition = mapping[process.platform + '_' + process.arch];
7
- const packagePath = path.join(modulesDirectory, ...definition);
8
- child_process.spawn(packagePath, process.argv.splice(2), {
9
- stdio: 'inherit',
10
- env: process.env,
11
- });