acidtest 0.1.2 → 0.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 +90 -10
- package/dist/index.js +146 -35
- package/dist/index.js.map +1 -1
- package/dist/loaders/mcp-loader.d.ts +28 -0
- package/dist/loaders/mcp-loader.d.ts.map +1 -0
- package/dist/loaders/mcp-loader.js +191 -0
- package/dist/loaders/mcp-loader.js.map +1 -0
- package/dist/mcp-server.d.ts +7 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +159 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/scanner.d.ts +2 -2
- package/dist/scanner.d.ts.map +1 -1
- package/dist/scanner.js +125 -68
- package/dist/scanner.js.map +1 -1
- package/package.json +6 -3
- package/test-fixtures/README.md +157 -0
- package/test-fixtures/fixture-danger/SKILL.md +27 -0
- package/test-fixtures/fixture-danger/handler.ts +29 -0
- package/test-fixtures/fixture-fail/SKILL.md +32 -0
- package/test-fixtures/fixture-fail/handler.ts +26 -0
- package/test-fixtures/fixture-mcp-pass/index.js +26 -0
- package/test-fixtures/fixture-mcp-pass/mcp.json +31 -0
- package/test-fixtures/fixture-pass/SKILL.md +32 -0
- package/test-fixtures/fixture-pass/handler.ts +17 -0
- package/test-fixtures/fixture-warn/SKILL.md +28 -0
- package/test-fixtures/fixture-warn/handler.ts +20 -0
package/README.md
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
# AcidTest
|
|
2
2
|
|
|
3
|
-
Security scanner for AI agent skills. Scan before you install.
|
|
3
|
+
Security scanner for AI agent skills and MCP servers. Scan before you install.
|
|
4
4
|
|
|
5
5
|
## The Problem
|
|
6
6
|
|
|
7
|
-
The
|
|
8
|
-
- **
|
|
7
|
+
The AI agent ecosystem is growing rapidly with thousands of skills and MCP servers. Security concerns include:
|
|
8
|
+
- **AgentSkills**: 66,000+ skills with 26% containing vulnerabilities
|
|
9
9
|
- **230+** confirmed malicious skills uploaded to ClawHub in one week
|
|
10
10
|
- **341** skills flagged in the ClawHavoc campaign
|
|
11
|
+
- **MCP Servers**: New ecosystem with similar security risks
|
|
11
12
|
|
|
12
13
|
## Quick Start
|
|
13
14
|
```bash
|
|
15
|
+
# See AcidTest in action
|
|
16
|
+
npx acidtest demo
|
|
17
|
+
|
|
18
|
+
# Scan an AgentSkills skill
|
|
14
19
|
npx acidtest scan ./my-skill
|
|
20
|
+
|
|
21
|
+
# Scan an MCP server
|
|
22
|
+
npx acidtest scan ./my-mcp-server
|
|
15
23
|
```
|
|
16
24
|
|
|
17
25
|
No API keys. No configuration. No Python.
|
|
@@ -48,6 +56,7 @@ RECOMMENDATION: Do not install. Prompt injection attempt detected.
|
|
|
48
56
|
|
|
49
57
|
## What It Detects
|
|
50
58
|
|
|
59
|
+
**For AgentSkills:**
|
|
51
60
|
- Prompt injection attempts
|
|
52
61
|
- Undeclared network calls
|
|
53
62
|
- Credential harvesting
|
|
@@ -55,9 +64,22 @@ RECOMMENDATION: Do not install. Prompt injection attempt detected.
|
|
|
55
64
|
- Data exfiltration patterns
|
|
56
65
|
- Obfuscated payloads
|
|
57
66
|
|
|
67
|
+
**For MCP Servers:**
|
|
68
|
+
- Dangerous command execution
|
|
69
|
+
- Undeclared network access (SSE transport)
|
|
70
|
+
- Environment variable credential requests
|
|
71
|
+
- Shell binary access
|
|
72
|
+
- Permission mismatches between manifest and code
|
|
73
|
+
|
|
58
74
|
## How It Works
|
|
59
75
|
|
|
60
|
-
AcidTest runs four analysis layers:
|
|
76
|
+
AcidTest runs four analysis layers:
|
|
77
|
+
1. **Permission Audit**: Analyzes declared permissions (bins, env, tools)
|
|
78
|
+
2. **Prompt Injection Scan**: Detects instruction override attempts (AgentSkills)
|
|
79
|
+
3. **Code Analysis**: AST-based analysis of JavaScript/TypeScript files
|
|
80
|
+
4. **Cross-Reference**: Catches code behavior not matching declared permissions
|
|
81
|
+
|
|
82
|
+
Works with both SKILL.md (AgentSkills) and MCP manifests (mcp.json, server.json, package.json).
|
|
61
83
|
|
|
62
84
|
## Install
|
|
63
85
|
```bash
|
|
@@ -70,18 +92,76 @@ npx acidtest scan ./path-to-skill
|
|
|
70
92
|
```
|
|
71
93
|
|
|
72
94
|
## Usage
|
|
95
|
+
|
|
96
|
+
### CLI Commands
|
|
73
97
|
```bash
|
|
74
|
-
#
|
|
75
|
-
acidtest
|
|
98
|
+
# See AcidTest in action with demo fixtures
|
|
99
|
+
acidtest demo
|
|
76
100
|
|
|
77
|
-
# Scan
|
|
101
|
+
# Scan an AgentSkills skill
|
|
102
|
+
acidtest scan ./my-skill
|
|
78
103
|
acidtest scan ./my-skill/SKILL.md
|
|
79
104
|
|
|
80
|
-
# Scan
|
|
81
|
-
acidtest scan-
|
|
105
|
+
# Scan an MCP server
|
|
106
|
+
acidtest scan ./my-mcp-server # Auto-detects mcp.json, server.json, etc.
|
|
107
|
+
acidtest scan ./server/mcp.json # Direct manifest path
|
|
108
|
+
|
|
109
|
+
# Scan all skills/servers in a directory
|
|
110
|
+
acidtest scan-all ./directory
|
|
82
111
|
|
|
83
|
-
# JSON output
|
|
112
|
+
# JSON output for programmatic use
|
|
84
113
|
acidtest scan ./my-skill --json
|
|
114
|
+
|
|
115
|
+
# Start as MCP server (for AI agents)
|
|
116
|
+
acidtest serve
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Use as MCP Server
|
|
120
|
+
|
|
121
|
+
AcidTest can run as an MCP (Model Context Protocol) server, allowing AI agents like Claude to scan skills and MCP servers before installation.
|
|
122
|
+
|
|
123
|
+
#### Claude Desktop Configuration
|
|
124
|
+
|
|
125
|
+
Add to your `claude_desktop_config.json`:
|
|
126
|
+
|
|
127
|
+
```json
|
|
128
|
+
{
|
|
129
|
+
"mcpServers": {
|
|
130
|
+
"acidtest": {
|
|
131
|
+
"command": "npx",
|
|
132
|
+
"args": ["-y", "acidtest", "serve"]
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Or if installed globally:
|
|
139
|
+
|
|
140
|
+
```json
|
|
141
|
+
{
|
|
142
|
+
"mcpServers": {
|
|
143
|
+
"acidtest": {
|
|
144
|
+
"command": "acidtest",
|
|
145
|
+
"args": ["serve"]
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
#### Available MCP Tools
|
|
152
|
+
|
|
153
|
+
- **`scan_skill`**: Scan a single skill or MCP server
|
|
154
|
+
- Input: `{ "path": "/path/to/skill" }`
|
|
155
|
+
- Returns: Full scan result with trust score and findings
|
|
156
|
+
|
|
157
|
+
- **`scan_all`**: Scan all skills/servers in a directory
|
|
158
|
+
- Input: `{ "directory": "/path/to/directory" }`
|
|
159
|
+
- Returns: Array of scan results
|
|
160
|
+
|
|
161
|
+
Once configured, Claude can scan skills before installation:
|
|
162
|
+
```
|
|
163
|
+
User: "Can you scan this MCP server before I install it?"
|
|
164
|
+
Claude: [Uses acidtest scan_skill tool to analyze the server]
|
|
85
165
|
```
|
|
86
166
|
|
|
87
167
|
## Scoring
|
package/dist/index.js
CHANGED
|
@@ -3,32 +3,41 @@
|
|
|
3
3
|
* AcidTest CLI entry point
|
|
4
4
|
* Parses arguments and routes to appropriate commands
|
|
5
5
|
*/
|
|
6
|
-
import { scanSkill, scanAllSkills } from
|
|
7
|
-
import { reportToTerminal, reportAsJSON } from
|
|
8
|
-
|
|
6
|
+
import { scanSkill, scanAllSkills } from "./scanner.js";
|
|
7
|
+
import { reportToTerminal, reportAsJSON } from "./reporter.js";
|
|
8
|
+
import { join, dirname } from "path";
|
|
9
|
+
import { fileURLToPath } from "url";
|
|
10
|
+
import { spawn } from "child_process";
|
|
11
|
+
const VERSION = "0.2.0";
|
|
9
12
|
/**
|
|
10
13
|
* Main CLI function
|
|
11
14
|
*/
|
|
12
15
|
async function main() {
|
|
13
16
|
const args = process.argv.slice(2);
|
|
14
17
|
// Handle --version flag
|
|
15
|
-
if (args.includes(
|
|
18
|
+
if (args.includes("--version") || args.includes("-v")) {
|
|
16
19
|
console.log(`acidtest v${VERSION}`);
|
|
17
20
|
process.exit(0);
|
|
18
21
|
}
|
|
19
22
|
// Handle --help flag
|
|
20
|
-
if (args.includes(
|
|
23
|
+
if (args.includes("--help") || args.includes("-h") || args.length === 0) {
|
|
21
24
|
printHelp();
|
|
22
25
|
process.exit(0);
|
|
23
26
|
}
|
|
24
27
|
// Parse command
|
|
25
28
|
const command = args[0];
|
|
26
|
-
if (command ===
|
|
29
|
+
if (command === "scan") {
|
|
27
30
|
await handleScan(args.slice(1));
|
|
28
31
|
}
|
|
29
|
-
else if (command ===
|
|
32
|
+
else if (command === "scan-all") {
|
|
30
33
|
await handleScanAll(args.slice(1));
|
|
31
34
|
}
|
|
35
|
+
else if (command === "demo") {
|
|
36
|
+
await handleDemo(args.slice(1));
|
|
37
|
+
}
|
|
38
|
+
else if (command === "serve") {
|
|
39
|
+
await handleServe(args.slice(1));
|
|
40
|
+
}
|
|
32
41
|
else {
|
|
33
42
|
console.error(`Unknown command: ${command}`);
|
|
34
43
|
console.error('Run "acidtest --help" for usage information.');
|
|
@@ -40,11 +49,11 @@ async function main() {
|
|
|
40
49
|
*/
|
|
41
50
|
async function handleScan(args) {
|
|
42
51
|
// Parse flags
|
|
43
|
-
const jsonOutput = args.includes(
|
|
44
|
-
const paths = args.filter(arg => !arg.startsWith(
|
|
52
|
+
const jsonOutput = args.includes("--json");
|
|
53
|
+
const paths = args.filter((arg) => !arg.startsWith("--"));
|
|
45
54
|
if (paths.length === 0) {
|
|
46
|
-
console.error(
|
|
47
|
-
console.error(
|
|
55
|
+
console.error("Error: No skill path provided");
|
|
56
|
+
console.error("Usage: acidtest scan <path-to-skill> [--json]");
|
|
48
57
|
process.exit(1);
|
|
49
58
|
}
|
|
50
59
|
const skillPath = paths[0];
|
|
@@ -57,12 +66,12 @@ async function handleScan(args) {
|
|
|
57
66
|
reportToTerminal(result);
|
|
58
67
|
}
|
|
59
68
|
// Exit with non-zero code for FAIL or DANGER
|
|
60
|
-
if (result.status ===
|
|
69
|
+
if (result.status === "FAIL" || result.status === "DANGER") {
|
|
61
70
|
process.exit(1);
|
|
62
71
|
}
|
|
63
72
|
}
|
|
64
73
|
catch (error) {
|
|
65
|
-
console.error(
|
|
74
|
+
console.error("Error scanning skill:", error.message);
|
|
66
75
|
process.exit(1);
|
|
67
76
|
}
|
|
68
77
|
}
|
|
@@ -71,18 +80,18 @@ async function handleScan(args) {
|
|
|
71
80
|
*/
|
|
72
81
|
async function handleScanAll(args) {
|
|
73
82
|
// Parse flags
|
|
74
|
-
const jsonOutput = args.includes(
|
|
75
|
-
const paths = args.filter(arg => !arg.startsWith(
|
|
83
|
+
const jsonOutput = args.includes("--json");
|
|
84
|
+
const paths = args.filter((arg) => !arg.startsWith("--"));
|
|
76
85
|
if (paths.length === 0) {
|
|
77
|
-
console.error(
|
|
78
|
-
console.error(
|
|
86
|
+
console.error("Error: No directory path provided");
|
|
87
|
+
console.error("Usage: acidtest scan-all <directory> [--json]");
|
|
79
88
|
process.exit(1);
|
|
80
89
|
}
|
|
81
90
|
const directory = paths[0];
|
|
82
91
|
try {
|
|
83
92
|
const results = await scanAllSkills(directory);
|
|
84
93
|
if (results.length === 0) {
|
|
85
|
-
console.log(
|
|
94
|
+
console.log("No skills found in directory");
|
|
86
95
|
process.exit(0);
|
|
87
96
|
}
|
|
88
97
|
if (jsonOutput) {
|
|
@@ -95,16 +104,16 @@ async function handleScanAll(args) {
|
|
|
95
104
|
reportToTerminal(result);
|
|
96
105
|
// Add separator between skills (except for last one)
|
|
97
106
|
if (i < results.length - 1) {
|
|
98
|
-
console.log(
|
|
107
|
+
console.log("\n" + "=".repeat(60) + "\n");
|
|
99
108
|
}
|
|
100
109
|
}
|
|
101
110
|
// Print summary statistics
|
|
102
|
-
console.log(
|
|
111
|
+
console.log("\n" + "=".repeat(60));
|
|
103
112
|
console.log(`\nScanned ${results.length} skill(s):\n`);
|
|
104
|
-
const pass = results.filter(r => r.status ===
|
|
105
|
-
const warn = results.filter(r => r.status ===
|
|
106
|
-
const fail = results.filter(r => r.status ===
|
|
107
|
-
const danger = results.filter(r => r.status ===
|
|
113
|
+
const pass = results.filter((r) => r.status === "PASS").length;
|
|
114
|
+
const warn = results.filter((r) => r.status === "WARN").length;
|
|
115
|
+
const fail = results.filter((r) => r.status === "FAIL").length;
|
|
116
|
+
const danger = results.filter((r) => r.status === "DANGER").length;
|
|
108
117
|
if (pass > 0)
|
|
109
118
|
console.log(` PASS: ${pass}`);
|
|
110
119
|
if (warn > 0)
|
|
@@ -116,33 +125,126 @@ async function handleScanAll(args) {
|
|
|
116
125
|
console.log();
|
|
117
126
|
}
|
|
118
127
|
// Exit with non-zero if any skill failed
|
|
119
|
-
const hasFailures = results.some(r => r.status ===
|
|
128
|
+
const hasFailures = results.some((r) => r.status === "FAIL" || r.status === "DANGER");
|
|
120
129
|
if (hasFailures) {
|
|
121
130
|
process.exit(1);
|
|
122
131
|
}
|
|
123
132
|
}
|
|
124
133
|
catch (error) {
|
|
125
|
-
console.error(
|
|
134
|
+
console.error("Error scanning directory:", error.message);
|
|
126
135
|
process.exit(1);
|
|
127
136
|
}
|
|
128
137
|
}
|
|
138
|
+
/**
|
|
139
|
+
* Handle 'demo' command
|
|
140
|
+
* Runs built-in test fixtures to show the full output spectrum
|
|
141
|
+
*/
|
|
142
|
+
async function handleDemo(args) {
|
|
143
|
+
console.log("AcidTest Demo - Running built-in test fixtures...\n");
|
|
144
|
+
// Find fixtures directory relative to this file
|
|
145
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
146
|
+
const __dirname = dirname(__filename);
|
|
147
|
+
const fixturesDir = join(__dirname, "..", "test-fixtures");
|
|
148
|
+
const fixtures = [
|
|
149
|
+
{ name: "PASS", path: join(fixturesDir, "fixture-pass") },
|
|
150
|
+
{ name: "WARN", path: join(fixturesDir, "fixture-warn") },
|
|
151
|
+
{ name: "FAIL", path: join(fixturesDir, "fixture-fail") },
|
|
152
|
+
{ name: "DANGER", path: join(fixturesDir, "fixture-danger") },
|
|
153
|
+
];
|
|
154
|
+
const results = [];
|
|
155
|
+
for (let i = 0; i < fixtures.length; i++) {
|
|
156
|
+
const fixture = fixtures[i];
|
|
157
|
+
try {
|
|
158
|
+
const result = await scanSkill(fixture.path);
|
|
159
|
+
results.push({ fixture: fixture.name, result });
|
|
160
|
+
console.log(`[${fixture.name} Example]`);
|
|
161
|
+
reportToTerminal(result);
|
|
162
|
+
if (i < fixtures.length - 1) {
|
|
163
|
+
console.log("\n" + "─".repeat(60) + "\n");
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
catch (error) {
|
|
167
|
+
console.warn(`Warning: Could not scan ${fixture.name} fixture:`, error.message);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
// Print summary
|
|
171
|
+
console.log("\n" + "=".repeat(60));
|
|
172
|
+
console.log("\nDemo Summary:");
|
|
173
|
+
console.log("AcidTest provides four security levels based on trust score (0-100):\n");
|
|
174
|
+
for (const { fixture, result } of results) {
|
|
175
|
+
const statusColor = result.status === "PASS"
|
|
176
|
+
? "green"
|
|
177
|
+
: result.status === "WARN"
|
|
178
|
+
? "yellow"
|
|
179
|
+
: result.status === "FAIL"
|
|
180
|
+
? "red"
|
|
181
|
+
: "red";
|
|
182
|
+
console.log(` ${result.status.padEnd(6)} (${result.score}/100) - ${getStatusDescription(result.status)}`);
|
|
183
|
+
}
|
|
184
|
+
console.log("\nRun 'acidtest scan <path>' to scan your own skills and tools.");
|
|
185
|
+
console.log("For more information, visit: https://acidtest.dev\n");
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Get status description for demo summary
|
|
189
|
+
*/
|
|
190
|
+
function getStatusDescription(status) {
|
|
191
|
+
switch (status) {
|
|
192
|
+
case "PASS":
|
|
193
|
+
return "Safe to use, no significant security concerns";
|
|
194
|
+
case "WARN":
|
|
195
|
+
return "Review findings before use, minor concerns";
|
|
196
|
+
case "FAIL":
|
|
197
|
+
return "Not recommended, significant security issues";
|
|
198
|
+
case "DANGER":
|
|
199
|
+
return "Do not use, critical security vulnerabilities";
|
|
200
|
+
default:
|
|
201
|
+
return "Unknown status";
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Handle 'serve' command
|
|
206
|
+
* Starts AcidTest as an MCP server
|
|
207
|
+
*/
|
|
208
|
+
async function handleServe(args) {
|
|
209
|
+
// Find the mcp-server.js file relative to this file
|
|
210
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
211
|
+
const __dirname = dirname(__filename);
|
|
212
|
+
const mcpServerPath = join(__dirname, "mcp-server.js");
|
|
213
|
+
// Start the MCP server as a child process
|
|
214
|
+
const mcpServer = spawn("node", [mcpServerPath], {
|
|
215
|
+
stdio: "inherit", // Inherit stdin/stdout/stderr for MCP protocol
|
|
216
|
+
});
|
|
217
|
+
// Handle process termination
|
|
218
|
+
mcpServer.on("exit", (code) => {
|
|
219
|
+
process.exit(code || 0);
|
|
220
|
+
});
|
|
221
|
+
// Handle errors
|
|
222
|
+
mcpServer.on("error", (error) => {
|
|
223
|
+
console.error("Failed to start MCP server:", error.message);
|
|
224
|
+
process.exit(1);
|
|
225
|
+
});
|
|
226
|
+
}
|
|
129
227
|
/**
|
|
130
228
|
* Print help text
|
|
131
229
|
*/
|
|
132
230
|
function printHelp() {
|
|
133
231
|
console.log(`
|
|
134
232
|
AcidTest v${VERSION}
|
|
135
|
-
Security scanner for AI agent skills
|
|
233
|
+
Security scanner for AI agent skills and MCP servers
|
|
136
234
|
|
|
137
235
|
USAGE:
|
|
138
|
-
acidtest scan <path
|
|
236
|
+
acidtest scan <path> [--json]
|
|
139
237
|
acidtest scan-all <directory> [--json]
|
|
238
|
+
acidtest demo
|
|
239
|
+
acidtest serve
|
|
140
240
|
acidtest --version
|
|
141
241
|
acidtest --help
|
|
142
242
|
|
|
143
243
|
COMMANDS:
|
|
144
|
-
scan Scan a single skill
|
|
145
|
-
scan-all Recursively scan all skills in a directory
|
|
244
|
+
scan Scan a single skill/MCP server (SKILL.md, mcp.json, etc.)
|
|
245
|
+
scan-all Recursively scan all skills/servers in a directory
|
|
246
|
+
demo Run demo with built-in test fixtures
|
|
247
|
+
serve Start AcidTest as an MCP server for AI agents
|
|
146
248
|
|
|
147
249
|
OPTIONS:
|
|
148
250
|
--json Output results as JSON
|
|
@@ -150,21 +252,30 @@ OPTIONS:
|
|
|
150
252
|
--help Show this help message
|
|
151
253
|
|
|
152
254
|
EXAMPLES:
|
|
153
|
-
#
|
|
255
|
+
# See AcidTest in action with demo fixtures
|
|
256
|
+
acidtest demo
|
|
257
|
+
|
|
258
|
+
# Scan an AgentSkills skill
|
|
154
259
|
acidtest scan ./my-skill
|
|
155
260
|
|
|
261
|
+
# Scan an MCP server
|
|
262
|
+
acidtest scan ./my-mcp-server
|
|
263
|
+
|
|
156
264
|
# Scan with JSON output
|
|
157
265
|
acidtest scan ./my-skill --json
|
|
158
266
|
|
|
159
|
-
# Scan all skills in a directory
|
|
160
|
-
acidtest scan-all ./
|
|
267
|
+
# Scan all skills/servers in a directory
|
|
268
|
+
acidtest scan-all ./directory
|
|
269
|
+
|
|
270
|
+
# Start as MCP server (for use with Claude Desktop, etc.)
|
|
271
|
+
acidtest serve
|
|
161
272
|
|
|
162
273
|
For more information, visit: https://acidtest.dev
|
|
163
274
|
`);
|
|
164
275
|
}
|
|
165
276
|
// Run CLI
|
|
166
|
-
main().catch(error => {
|
|
167
|
-
console.error(
|
|
277
|
+
main().catch((error) => {
|
|
278
|
+
console.error("Unexpected error:", error);
|
|
168
279
|
process.exit(1);
|
|
169
280
|
});
|
|
170
281
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM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ration files
|
|
4
|
+
*/
|
|
5
|
+
import type { SkillMetadata } from "../types.js";
|
|
6
|
+
/**
|
|
7
|
+
* MCP manifest format types
|
|
8
|
+
*/
|
|
9
|
+
export type MCPManifestFormat = "mcp.json" | "server.json" | "package.json" | "claude_desktop_config.json";
|
|
10
|
+
/**
|
|
11
|
+
* Detected MCP manifest
|
|
12
|
+
*/
|
|
13
|
+
export interface MCPManifest {
|
|
14
|
+
format: MCPManifestFormat;
|
|
15
|
+
path: string;
|
|
16
|
+
metadata: SkillMetadata;
|
|
17
|
+
rawConfig: any;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Detect if a directory contains an MCP server manifest
|
|
21
|
+
* Returns the path to the manifest if found, otherwise null
|
|
22
|
+
*/
|
|
23
|
+
export declare function detectMCPManifest(directory: string): string | null;
|
|
24
|
+
/**
|
|
25
|
+
* Parse an MCP manifest file
|
|
26
|
+
*/
|
|
27
|
+
export declare function parseMCPManifest(manifestPath: string): MCPManifest;
|
|
28
|
+
//# sourceMappingURL=mcp-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-loader.d.ts","sourceRoot":"","sources":["../../src/loaders/mcp-loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GACzB,UAAU,GACV,aAAa,GACb,cAAc,GACd,4BAA4B,CAAC;AAEjC;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,aAAa,CAAC;IACxB,SAAS,EAAE,GAAG,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA6BlE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,WAAW,CAwBlE"}
|