solshield-mcp 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +43 -2
- package/cli.js +21 -0
- package/index.js +38 -0
- package/package.json +29 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Arief Noerhidayat
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
-
#
|
|
1
|
+
# solshield-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A small Node.js client for the six read-only tools on the hosted SolShield MCP endpoint. Check dApp domains, inspect public token permissions, or request a pre-trade verdict from an agent. Requires Node.js 20 or newer.
|
|
4
|
+
|
|
5
|
+
## From the command line
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npx solshield-mcp tools
|
|
9
|
+
npx solshield-mcp domain jup.ag
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The domain command returns the hostname, domain status and supporting reasons. A recognized hostname tells you only about that domain. Review the transaction separately before signing.
|
|
13
|
+
|
|
14
|
+
## From JavaScript
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
npm install solshield-mcp
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
import { callTool, listTools, verifyDomain } from "solshield-mcp";
|
|
22
|
+
|
|
23
|
+
const tools = await listTools();
|
|
24
|
+
console.log(tools.map(tool => tool.name));
|
|
25
|
+
console.log(await verifyDomain("jup.ag"));
|
|
26
|
+
console.log(await callTool("solshield_check_token_security", {
|
|
27
|
+
address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
28
|
+
chain: "base"
|
|
29
|
+
}));
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Requests send the supplied arguments to `https://sol-shield.xyz/api/mcp`. Tool availability and rate limits follow the hosted service. Supply only public data. This client has no signing functions.
|
|
33
|
+
|
|
34
|
+
## Using Claude Code
|
|
35
|
+
|
|
36
|
+
Claude Code can connect directly to the hosted server.
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
claude mcp add --transport http solshield https://sol-shield.xyz/api/mcp
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
[SolShield Agent Firewall](https://sol-shield.xyz/agent-firewall)
|
|
43
|
+
|
|
44
|
+
Built in Venice · @Veniceai
|
package/cli.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { listTools, verifyDomain } from "./index.js";
|
|
3
|
+
|
|
4
|
+
const usage = "Usage: solshield-mcp tools | solshield-mcp domain <hostname-or-url>";
|
|
5
|
+
const [command, input, ...rest] = process.argv.slice(2);
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
if ((!command || command === "--help" || command === "-h") && input === undefined) {
|
|
9
|
+
console.log(usage);
|
|
10
|
+
} else if (command === "tools" && input === undefined) {
|
|
11
|
+
console.log((await listTools()).map(tool => tool.name).join("\n"));
|
|
12
|
+
} else if (command === "domain" && input?.trim() && rest.length === 0) {
|
|
13
|
+
console.log(JSON.stringify(await verifyDomain(input), null, 2));
|
|
14
|
+
} else {
|
|
15
|
+
console.error(usage);
|
|
16
|
+
process.exitCode = 2;
|
|
17
|
+
}
|
|
18
|
+
} catch (error) {
|
|
19
|
+
console.error(error.message);
|
|
20
|
+
process.exitCode = 1;
|
|
21
|
+
}
|
package/index.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const endpoint = "https://sol-shield.xyz/api/mcp";
|
|
2
|
+
|
|
3
|
+
async function request(method, params) {
|
|
4
|
+
const response = await fetch(endpoint, {
|
|
5
|
+
method: "POST",
|
|
6
|
+
headers: { "Content-Type": "application/json", Accept: "application/json, text/event-stream" },
|
|
7
|
+
body: JSON.stringify({ jsonrpc: "2.0", id: 1, method, params }),
|
|
8
|
+
signal: AbortSignal.timeout(45_000),
|
|
9
|
+
});
|
|
10
|
+
if (!response.ok) {
|
|
11
|
+
throw new Error(`SolShield returned HTTP ${response.status}. No check result is available.`);
|
|
12
|
+
}
|
|
13
|
+
const reply = await response.json();
|
|
14
|
+
if (reply.error) throw new Error(reply.error.message);
|
|
15
|
+
if (reply.jsonrpc !== "2.0" || reply.id !== 1 || !reply.result) {
|
|
16
|
+
throw new Error("SolShield returned an unexpected response.");
|
|
17
|
+
}
|
|
18
|
+
return reply.result;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export async function listTools() {
|
|
22
|
+
const { tools } = await request("tools/list", {});
|
|
23
|
+
if (!Array.isArray(tools)) throw new Error("SolShield returned an invalid tool list.");
|
|
24
|
+
return tools;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export async function callTool(name, args = {}) {
|
|
28
|
+
const result = await request("tools/call", { name, arguments: args });
|
|
29
|
+
if (result.isError) {
|
|
30
|
+
const message = result.content?.find(item => item.type === "text")?.text;
|
|
31
|
+
throw new Error(message || "The SolShield check failed.");
|
|
32
|
+
}
|
|
33
|
+
return result.structuredContent ?? result.content;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function verifyDomain(hostname) {
|
|
37
|
+
return callTool("solshield_verify_domain", { url: hostname });
|
|
38
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solshield-mcp",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Read-only Node.js client and CLI for the hosted SolShield MCP security tools.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": "./index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"solshield-mcp": "./cli.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"cli.js",
|
|
12
|
+
"index.js"
|
|
13
|
+
],
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=20"
|
|
16
|
+
},
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"homepage": "https://sol-shield.xyz/agent-firewall",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/Blanksite/solshield.git",
|
|
22
|
+
"directory": "packages/mcp-client"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"mcp",
|
|
26
|
+
"solana",
|
|
27
|
+
"evm",
|
|
28
|
+
"solshield",
|
|
29
|
+
"wallet-security"
|
|
30
|
+
]
|
|
31
|
+
}
|