@ecommaps/mcp 1.0.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 +34 -0
- package/index.js +58 -0
- package/package.json +19 -0
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# EcoBaseAI MCP Client CLI
|
|
2
|
+
|
|
3
|
+
This package provides the official CLI bridge for EcoBaseAI MCP servers.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @ecommaps/mcp
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx @ecommaps/mcp <YOUR_API_KEY>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Development & Publishing
|
|
18
|
+
|
|
19
|
+
To publish this package to NPM:
|
|
20
|
+
|
|
21
|
+
1. Ensure you are logged in to NPM:
|
|
22
|
+
```bash
|
|
23
|
+
npm login
|
|
24
|
+
```
|
|
25
|
+
2. Navigate to this directory:
|
|
26
|
+
```bash
|
|
27
|
+
cd packages/mcp-cli
|
|
28
|
+
```
|
|
29
|
+
3. Publish with public access:
|
|
30
|
+
```bash
|
|
31
|
+
npm publish --access public
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Once published, anyone can use `npx @ecommaps/mcp`!
|
package/index.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawn } = require('child_process');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const args = require('minimist')(process.argv.slice(2));
|
|
6
|
+
|
|
7
|
+
// Configuration
|
|
8
|
+
const SSE_URL = "https://api.ecommaps.com/api/v1/mcp/sse";
|
|
9
|
+
|
|
10
|
+
// Usage: npx @ecommaps/mcp <API_KEY>
|
|
11
|
+
// Or: npx @ecommaps/mcp --key <API_KEY>
|
|
12
|
+
|
|
13
|
+
const apiKey = args.key || args._[0];
|
|
14
|
+
|
|
15
|
+
if (!apiKey) {
|
|
16
|
+
console.error("❌ Error: API Key is required.");
|
|
17
|
+
console.error("Usage: npx @ecommaps/mcp <YOUR_API_KEY>");
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
console.error(`🔌 EcoBaseAI MCP Client Connecting...`);
|
|
22
|
+
console.error(` Target: ${SSE_URL}`);
|
|
23
|
+
console.error(` Key: ${apiKey.substring(0, 8)}...`);
|
|
24
|
+
|
|
25
|
+
// We use 'npx supergateway' internally, or if installed as dependency, call the bin.
|
|
26
|
+
// Since we want this to be a standalone package, we can just spawn 'npx supergateway'.
|
|
27
|
+
// Ideally, we would bundle supergateway code, but for this proof of concept, spawning is easiest.
|
|
28
|
+
|
|
29
|
+
const child = spawn('npx', [
|
|
30
|
+
'-y',
|
|
31
|
+
'supergateway',
|
|
32
|
+
'--sse', SSE_URL,
|
|
33
|
+
'--oauth2Bearer', apiKey
|
|
34
|
+
], {
|
|
35
|
+
stdio: 'inherit' // Connect stdio to the parent process (Claude/Cursor)
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// Forward signals to child to prevent zombie processes
|
|
39
|
+
process.on('SIGINT', () => {
|
|
40
|
+
// console.error("\nReceived SIGINT, shutting down...");
|
|
41
|
+
child.kill('SIGINT');
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
process.on('SIGTERM', () => {
|
|
45
|
+
child.kill('SIGTERM');
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
child.on('error', (err) => {
|
|
49
|
+
console.error('Failed to start client:', err);
|
|
50
|
+
process.exit(1);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
child.on('close', (code) => {
|
|
54
|
+
if (code !== 0 && code !== null) {
|
|
55
|
+
console.error(`Client exited with code ${code}`);
|
|
56
|
+
process.exit(code);
|
|
57
|
+
}
|
|
58
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ecommaps/mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "EcoBaseAI Official MCP Client",
|
|
5
|
+
"bin": {
|
|
6
|
+
"ecommaps-mcp": "./index.js"
|
|
7
|
+
},
|
|
8
|
+
"main": "index.js",
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"minimist": "^1.2.8"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"mcp",
|
|
14
|
+
"ai",
|
|
15
|
+
"ecommaps"
|
|
16
|
+
],
|
|
17
|
+
"author": "EcoBaseAI",
|
|
18
|
+
"license": "ISC"
|
|
19
|
+
}
|