@whoisxmlapidotcom/mcp-whoisxmlapi 1.1.0 → 1.2.0

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,158 +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
- - **HTTP Server Mode**: Run as an HTTP server with streamable HTTP transport for web-based integrations
11
- - **Hosted Mode**: Multi-tenant deployment with per-request token authentication (see [HOSTING.md](HOSTING.md))
12
- - **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.
13
4
 
14
5
  ## Installation
15
6
 
16
- ### Option 1: Docker (Recommended)
17
-
18
- You can run `mcp-whoisxmlapi` directly with Docker without installing the binary:
19
-
20
- ```json
21
- {
22
- "mcpServers": {
23
- "whoisxmlapi": {
24
- "command": "docker",
25
- "args": [
26
- "run",
27
- "-i",
28
- "--rm",
29
- "-e", "WHOISXMLAPI_TOKEN",
30
- "whoisxmlapidotcom/mcp-whoisxmlapi:latest"
31
- // Add custom options if needed:
32
- // "--timeout=30s"
33
- ],
34
- "env": {
35
- "WHOISXMLAPI_TOKEN": "your-api-token-here"
36
- }
37
- }
38
- }
39
- }
40
- ```
41
-
42
- ### Option 2: npm
43
-
44
- Install via npm for convenience:
45
-
46
7
  ```bash
47
- # Install globally
48
8
  npm install -g @whoisxmlapidotcom/mcp-whoisxmlapi
49
-
50
- # Or install locally in your project
9
+ # or
51
10
  npm install @whoisxmlapidotcom/mcp-whoisxmlapi
52
11
  ```
53
12
 
54
- #### Editor Configuration with npm
55
-
56
- If installed globally via npm:
57
-
58
- ```json
59
- {
60
- "mcpServers": {
61
- "whoisxmlapi": {
62
- "command": "mcp-whoisxmlapi",
63
- "args": [
64
- // Uncomment and modify as needed:
65
- // "--timeout=30s"
66
- ],
67
- "env": {
68
- "WHOISXMLAPI_TOKEN": "your-api-token-here"
69
- }
70
- }
71
- }
72
- }
73
- ```
74
-
75
- If installed locally in a project:
76
-
77
- ```json
78
- {
79
- "mcpServers": {
80
- "whoisxmlapi": {
81
- "command": "npx",
82
- "args": [
83
- "@whoisxmlapidotcom/mcp-whoisxmlapi"
84
- // Add custom options if needed:
85
- // "--timeout=30s"
86
- ],
87
- "env": {
88
- "WHOISXMLAPI_TOKEN": "your-api-token-here"
89
- }
90
- }
91
- }
92
- }
93
- ```
94
-
95
- ### Option 3: Binary Download
96
-
97
- 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.
98
-
99
- ### Docker
100
-
101
- The MCP server is available as a Docker image using `stdio` to communicate:
102
-
103
- ```bash
104
- docker pull whoisxmlapidotcom/mcp-whoisxmlapi:latest
105
- docker run --rm -e WHOISXMLAPI_TOKEN=your-token whoisxmlapidotcom/mcp-whoisxmlapi:latest
106
- ```
107
-
108
- For SSE mode with Docker, expose the SSE port (default `3000`):
109
-
110
- ```bash
111
- docker run --rm -p 3000:3000 -e WHOISXMLAPI_TOKEN=your-token whoisxmlapidotcom/mcp-whoisxmlapi:latest --sse --sse-port 3000
112
- ```
113
-
114
- 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:
115
-
116
- ```json
117
- {
118
- "mcpServers": {
119
- "whoisxmlapi": {
120
- "url": "http://localhost:3000"
121
- }
122
- }
123
- }
124
- ```
125
-
126
- Do note that some MCP Clients will not support non-HTTPS endpoints.
127
-
128
- 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
129
14
 
130
- ## Environment Variables
131
-
132
- - `WHOISXMLAPI_TOKEN`: Required. The API token for authenticating with the WhoisXMLAPI service.
133
-
134
- ## Running Modes
135
-
136
- ### Standard (stdio) Mode
137
-
138
- By default, `mcp-whoisxmlapi` runs in stdio mode, which is suitable for integration with editors and other tools that communicate via standard input/output.
139
-
140
- ```bash
141
- export WHOISXMLAPI_TOKEN=your-token-here
142
- mcp-whoisxmlapi
143
- ```
144
-
145
- ### HTTP Server Mode
146
-
147
- Alternatively, you can run `mcp-whoisxmlapi` as an HTTP server 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.
148
16
 
149
17
  ```bash
150
- export WHOISXMLAPI_TOKEN=your-token-here
151
- mcp-whoisxmlapi --http --http-port=3000
18
+ mcp-whoisxmlapi --help
152
19
  ```
153
20
 
154
- In HTTP mode, the server will listen on the specified port (default: 3000) and provide the same MCP tools over HTTP using streamable HTTP transport. This is useful for web applications or environments where stdio communication isn't practical.
155
-
156
- **Available HTTP Options:**
157
- - `--http`: Enable HTTP server mode
158
- - `--http-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.1.0",
3
+ "version": "1.2.0",
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.1.0",
9
- "@whoisxmlapidotcom/mcp-whoisxmlapi_linux_amd64": "1.1.0",
10
- "@whoisxmlapidotcom/mcp-whoisxmlapi_linux_arm64": "1.1.0",
11
- "@whoisxmlapidotcom/mcp-whoisxmlapi_windows_amd64": "1.1.0",
12
- "@whoisxmlapidotcom/mcp-whoisxmlapi_windows_arm": "1.1.0",
13
- "@whoisxmlapidotcom/mcp-whoisxmlapi_windows_arm64": "1.1.0",
14
- "@whoisxmlapidotcom/mcp-whoisxmlapi_darwin_amd64": "1.1.0",
15
- "@whoisxmlapidotcom/mcp-whoisxmlapi_darwin_arm64": "1.1.0"
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: { name: [ '@whoisxmlapidotcom', 'mcp-whoisxmlapi_linux_arm' ], bin: 'mcp-whoisxmlapi' }, linux_x64: { name: [ '@whoisxmlapidotcom', 'mcp-whoisxmlapi_linux_amd64' ], bin: 'mcp-whoisxmlapi' }, linux_arm64: { name: [ '@whoisxmlapidotcom', 'mcp-whoisxmlapi_linux_arm64' ], bin: 'mcp-whoisxmlapi' }, win32_x64: { name: [ '@whoisxmlapidotcom', 'mcp-whoisxmlapi_windows_amd64' ], bin: 'mcp-whoisxmlapi.exe' }, win32_arm: { name: [ '@whoisxmlapidotcom', 'mcp-whoisxmlapi_windows_arm' ], bin: 'mcp-whoisxmlapi.exe' }, win32_arm64: { name: [ '@whoisxmlapidotcom', 'mcp-whoisxmlapi_windows_arm64' ], bin: 'mcp-whoisxmlapi.exe' }, darwin_x64: { name: [ '@whoisxmlapidotcom', 'mcp-whoisxmlapi_darwin_amd64' ], bin: 'mcp-whoisxmlapi' }, darwin_arm64: { name: [ '@whoisxmlapidotcom', 'mcp-whoisxmlapi_darwin_arm64' ], bin: 'mcp-whoisxmlapi' } };
5
- const definition = mapping[process.platform + '_' + process.arch];
6
- const packageJsonPath = require.resolve(path.join(...definition.name, 'package.json'));
7
- const packagePath = path.join(path.dirname(packageJsonPath), definition.bin);
8
- child_process.spawn(packagePath, process.argv.splice(2), {
9
- stdio: 'inherit',
10
- env: process.env,
11
- });