chore(mcp): add @rlwj-lab/opsxdb-mcp npm launcher package
Node wrapper that spawns the Go opsxdb-mcp binary (OPSXDB_MCP_BIN / PATH). Ready for npm publish --access public (requires 2FA OTP).
This commit is contained in:
1 parent
cd319ce7bd
commit
8ae1e438a1
5 files changed
+154
No files matched your search
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 1024way
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,49 @@
|
||||
# @rlwj-lab/opsxdb-mcp
|
||||
|
||||
MCP (Model Context Protocol) launcher for OpsxDB.
|
||||
|
||||
This package ships a small Node CLI that **spawns the Go `opsxdb-mcp` binary** over stdio. Build the binary from the OpsxDB repo, then point the launcher at it.
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
npm i -g @rlwj-lab/opsxdb-mcp
|
||||
# or
|
||||
npx -y @rlwj-lab/opsxdb-mcp
|
||||
```
|
||||
|
||||
## Build the Go binary
|
||||
|
||||
From the OpsxDB repository:
|
||||
|
||||
```bash
|
||||
cd server && go build -o ../bin/opsxdb-mcp ./cmd/opsxdb-mcp
|
||||
```
|
||||
|
||||
Put `bin/opsxdb-mcp` on `PATH`, or set:
|
||||
|
||||
```bash
|
||||
export OPSXDB_MCP_BIN=/absolute/path/to/opsxdb-mcp
|
||||
```
|
||||
|
||||
## Cursor / Claude Desktop
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"opsxdb": {
|
||||
"command": "npx",
|
||||
"args": ["-y", "@rlwj-lab/opsxdb-mcp"],
|
||||
"env": {
|
||||
"OPSXDB_MCP_BIN": "/absolute/path/to/opsxdb-mcp"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Config: `~/.opsxdb/mcp.json`, `~/.opsxdb/connections.json`.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
|
||||
const { spawn } = require('child_process');
|
||||
const {
|
||||
resolveBinary,
|
||||
missingBinaryMessage,
|
||||
} = require('../dist/resolve-binary.js');
|
||||
|
||||
const bin = resolveBinary();
|
||||
if (!bin) {
|
||||
process.stderr.write(missingBinaryMessage());
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const child = spawn(bin, process.argv.slice(2), {
|
||||
stdio: 'inherit',
|
||||
env: process.env,
|
||||
windowsHide: true,
|
||||
});
|
||||
|
||||
child.on('error', (err) => {
|
||||
process.stderr.write(
|
||||
`opsxdb-mcp: failed to start "${bin}": ${err.message}\n`
|
||||
);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
child.on('exit', (code, signal) => {
|
||||
if (signal) {
|
||||
try {
|
||||
process.kill(process.pid, signal);
|
||||
} catch {
|
||||
process.exit(1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
process.exit(code == null ? 1 : code);
|
||||
});
|
||||
@@ -0,0 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* @rlwj-lab/opsxdb-mcp
|
||||
* Node launcher for the OpsxDB Go MCP server (stdio).
|
||||
* Prefer the `opsxdb-mcp` bin / `npx @rlwj-lab/opsxdb-mcp`.
|
||||
*/
|
||||
const {
|
||||
resolveBinary,
|
||||
missingBinaryMessage,
|
||||
} = require('./dist/resolve-binary.js');
|
||||
|
||||
module.exports = {
|
||||
resolveBinary,
|
||||
missingBinaryMessage,
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "@rlwj-lab/opsxdb-mcp",
|
||||
"version": "0.1.0",
|
||||
"description": "MCP server for opsxdb",
|
||||
"main": "index.js",
|
||||
"bin": {
|
||||
"opsxdb-mcp": "bin/cli.js"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"bin",
|
||||
"dist",
|
||||
"LICENSE",
|
||||
"README.md"
|
||||
],
|
||||
"keywords": [
|
||||
"mcp",
|
||||
"opsxdb",
|
||||
"database"
|
||||
],
|
||||
"license": "MIT",
|
||||
"author": "1024way",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user