@ecommaps/mcp 1.0.7 → 1.0.8
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 +6 -12
- package/cli.js +15 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,22 +7,12 @@ Streamable HTTP endpoint (`/api/v1/mcp`) while speaking stdio locally.
|
|
|
7
7
|
|
|
8
8
|
## Quick Start
|
|
9
9
|
|
|
10
|
-
Run
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
npx @ecommaps/mcp <YOUR_STORE_MCP_KEY>
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
Use a custom endpoint (production or local):
|
|
10
|
+
Run with your store key and the official endpoint:
|
|
17
11
|
|
|
18
12
|
```bash
|
|
19
13
|
npx @ecommaps/mcp <YOUR_STORE_MCP_KEY> --url https://api.ecommaps.com/api/v1/mcp
|
|
20
14
|
```
|
|
21
15
|
|
|
22
|
-
```bash
|
|
23
|
-
npx @ecommaps/mcp <YOUR_STORE_MCP_KEY> --url http://127.0.0.1:8001/api/v1/mcp
|
|
24
|
-
```
|
|
25
|
-
|
|
26
16
|
## CLI Options
|
|
27
17
|
|
|
28
18
|
- `--url <MCP_URL>`: Override the MCP endpoint URL.
|
|
@@ -43,6 +33,7 @@ Use the following shape in any editor that supports stdio MCP servers:
|
|
|
43
33
|
{
|
|
44
34
|
"command": "npx",
|
|
45
35
|
"args": [
|
|
36
|
+
"-y",
|
|
46
37
|
"@ecommaps/mcp",
|
|
47
38
|
"sk_eco_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
48
39
|
"--url",
|
|
@@ -56,13 +47,16 @@ Or with env var:
|
|
|
56
47
|
```json
|
|
57
48
|
{
|
|
58
49
|
"command": "npx",
|
|
59
|
-
"args": ["@ecommaps/mcp", "--url", "https://api.ecommaps.com/api/v1/mcp"],
|
|
50
|
+
"args": ["-y", "@ecommaps/mcp", "--url", "https://api.ecommaps.com/api/v1/mcp"],
|
|
60
51
|
"env": {
|
|
61
52
|
"MCP_BEARER_TOKEN": "sk_eco_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
|
62
53
|
}
|
|
63
54
|
}
|
|
64
55
|
```
|
|
65
56
|
|
|
57
|
+
Important: keep `--url https://api.ecommaps.com/api/v1/mcp` in editor/server configs to avoid falling back to any outdated transport defaults.
|
|
58
|
+
Also make sure `--url` comes **after** `@ecommaps/mcp` in `args`; otherwise `npx` treats it as an npm flag and fails.
|
|
59
|
+
|
|
66
60
|
## Transport Notes
|
|
67
61
|
|
|
68
62
|
- Recommended endpoint: `POST /api/v1/mcp`
|
package/cli.js
CHANGED
|
@@ -11,17 +11,18 @@ function parseCliArgs(argv) {
|
|
|
11
11
|
let showHelp = false;
|
|
12
12
|
|
|
13
13
|
for (let i = 0; i < args.length; i += 1) {
|
|
14
|
-
const
|
|
14
|
+
const rawArg = args[i];
|
|
15
|
+
const arg = typeof rawArg === 'string' ? rawArg.replace(/[–—−]/g, '-') : rawArg;
|
|
15
16
|
if (arg === '--help' || arg === '-h') {
|
|
16
17
|
showHelp = true;
|
|
17
18
|
continue;
|
|
18
19
|
}
|
|
19
|
-
if (arg === '--url' && args[i + 1]) {
|
|
20
|
+
if ((arg === '--url' || arg === '-url') && args[i + 1]) {
|
|
20
21
|
mcpUrl = args[i + 1];
|
|
21
22
|
i += 1;
|
|
22
23
|
continue;
|
|
23
24
|
}
|
|
24
|
-
if (arg === '--api-key' && args[i + 1]) {
|
|
25
|
+
if ((arg === '--api-key' || arg === '-api-key') && args[i + 1]) {
|
|
25
26
|
apiKey = args[i + 1];
|
|
26
27
|
i += 1;
|
|
27
28
|
continue;
|
|
@@ -137,6 +138,17 @@ async function main() {
|
|
|
137
138
|
}
|
|
138
139
|
|
|
139
140
|
try {
|
|
141
|
+
// Some MCP clients may send params as [] or omit them for list methods.
|
|
142
|
+
// Ecommaps MCP expects params to be an object, so normalize empty variants.
|
|
143
|
+
if (payload && typeof payload === 'object') {
|
|
144
|
+
if (
|
|
145
|
+
payload.params == null ||
|
|
146
|
+
(Array.isArray(payload.params) && payload.params.length === 0)
|
|
147
|
+
) {
|
|
148
|
+
payload.params = {};
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
140
152
|
const result = await postRpc(mcpUrl, apiKey, payload);
|
|
141
153
|
process.stdout.write(`${JSON.stringify(result)}\n`);
|
|
142
154
|
} catch (error) {
|