@hasna/mcps 0.0.3 → 0.0.5
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/bin/index.js +521 -22
- package/bin/mcp.js +78 -4
- package/dashboard/dist/assets/index-Df11SKJo.css +1 -0
- package/dashboard/dist/assets/index-a3768emB.js +264 -0
- package/dashboard/dist/index.html +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +41 -4
- package/dist/lib/doctor.d.ts +2 -0
- package/dist/lib/registry.d.ts +1 -0
- package/package.json +2 -2
- package/dashboard/dist/assets/index-BHsa5YXH.js +0 -229
- package/dashboard/dist/assets/index-C7n__Rq8.css +0 -1
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Hasna MCPs</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-a3768emB.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Df11SKJo.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<div id="root"></div>
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { McpServerEntry, AddServerOptions, McpTool, RegistryServer, ConnectedServer, FinderResult, } from "./types.js";
|
|
2
|
-
export { addServer, removeServer, listServers, getServer, updateServer, enableServer, disableServer, getToolCounts, setServerEnv, unsetServerEnv, } from "./lib/registry.js";
|
|
2
|
+
export { addServer, removeServer, listServers, getServer, updateServer, enableServer, disableServer, getToolCounts, getCachedTools, setServerEnv, unsetServerEnv, cloneServer, } from "./lib/registry.js";
|
|
3
3
|
export { diagnoseServer } from "./lib/doctor.js";
|
|
4
4
|
export type { DoctorReport, DoctorCheck } from "./lib/doctor.js";
|
|
5
5
|
export { searchRegistry, getRegistryServer, installFromRegistry } from "./lib/remote.js";
|
package/dist/index.js
CHANGED
|
@@ -6375,7 +6375,7 @@ var require_formats = __commonJS((exports) => {
|
|
|
6375
6375
|
}
|
|
6376
6376
|
var TIME = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
|
|
6377
6377
|
function getTime(strictTimeZone) {
|
|
6378
|
-
return function
|
|
6378
|
+
return function time3(str) {
|
|
6379
6379
|
const matches = TIME.exec(str);
|
|
6380
6380
|
if (!matches)
|
|
6381
6381
|
return false;
|
|
@@ -7531,6 +7531,30 @@ function getToolCounts() {
|
|
|
7531
7531
|
const rows = db2.prepare("SELECT server_id, COUNT(*) as count FROM tool_cache GROUP BY server_id").all();
|
|
7532
7532
|
return new Map(rows.map((row) => [row.server_id, Number(row.count)]));
|
|
7533
7533
|
}
|
|
7534
|
+
function cloneServer(id, newName) {
|
|
7535
|
+
const server = getServer(id);
|
|
7536
|
+
if (!server)
|
|
7537
|
+
throw new Error(`Server "${id}" not found`);
|
|
7538
|
+
return addServer({
|
|
7539
|
+
name: newName,
|
|
7540
|
+
description: server.description ?? undefined,
|
|
7541
|
+
command: server.command,
|
|
7542
|
+
args: server.args,
|
|
7543
|
+
env: server.env,
|
|
7544
|
+
transport: server.transport,
|
|
7545
|
+
url: server.url ?? undefined,
|
|
7546
|
+
source: server.source
|
|
7547
|
+
});
|
|
7548
|
+
}
|
|
7549
|
+
function getCachedTools(serverId) {
|
|
7550
|
+
const db2 = getDb();
|
|
7551
|
+
const rows = db2.prepare("SELECT name, description, input_schema FROM tool_cache WHERE server_id = ? ORDER BY name").all(serverId);
|
|
7552
|
+
return rows.map((r) => ({
|
|
7553
|
+
name: r.name,
|
|
7554
|
+
description: r.description,
|
|
7555
|
+
input_schema: safeJsonParse(r.input_schema, {})
|
|
7556
|
+
}));
|
|
7557
|
+
}
|
|
7534
7558
|
// src/lib/doctor.ts
|
|
7535
7559
|
import { execFileSync } from "child_process";
|
|
7536
7560
|
|
|
@@ -15828,10 +15852,21 @@ async function diagnoseServer(server) {
|
|
|
15828
15852
|
const checks3 = [];
|
|
15829
15853
|
if (server.transport === "stdio") {
|
|
15830
15854
|
try {
|
|
15831
|
-
execFileSync("which", [server.command], { stdio: "pipe" });
|
|
15832
|
-
|
|
15855
|
+
const path = execFileSync("which", [server.command], { stdio: "pipe" }).toString().trim();
|
|
15856
|
+
let version2 = "";
|
|
15857
|
+
try {
|
|
15858
|
+
version2 = execFileSync(server.command, ["--version"], { stdio: "pipe" }).toString().trim().split(`
|
|
15859
|
+
`)[0];
|
|
15860
|
+
} catch {}
|
|
15861
|
+
checks3.push({ name: "command on PATH", pass: true, message: `${path}${version2 ? ` (${version2})` : ""}` });
|
|
15833
15862
|
} catch {
|
|
15834
|
-
checks3.push({
|
|
15863
|
+
checks3.push({
|
|
15864
|
+
name: "command on PATH",
|
|
15865
|
+
pass: false,
|
|
15866
|
+
message: `${server.command} not found on PATH`,
|
|
15867
|
+
fixable: true,
|
|
15868
|
+
fixHint: server.args[0] || server.command
|
|
15869
|
+
});
|
|
15835
15870
|
}
|
|
15836
15871
|
}
|
|
15837
15872
|
const missingEnv = Object.entries(server.env).filter(([, v]) => !v);
|
|
@@ -16048,6 +16083,7 @@ export {
|
|
|
16048
16083
|
getServer,
|
|
16049
16084
|
getRegistryServer,
|
|
16050
16085
|
getDb,
|
|
16086
|
+
getCachedTools,
|
|
16051
16087
|
findServers,
|
|
16052
16088
|
enableSource,
|
|
16053
16089
|
enableServer,
|
|
@@ -16058,6 +16094,7 @@ export {
|
|
|
16058
16094
|
diagnoseServer,
|
|
16059
16095
|
connectToServer,
|
|
16060
16096
|
closeDb,
|
|
16097
|
+
cloneServer,
|
|
16061
16098
|
callTool,
|
|
16062
16099
|
addSource,
|
|
16063
16100
|
addServer
|
package/dist/lib/doctor.d.ts
CHANGED
package/dist/lib/registry.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export declare function cacheTools(serverId: string, tools: Array<{
|
|
|
14
14
|
input_schema: Record<string, unknown>;
|
|
15
15
|
}>): void;
|
|
16
16
|
export declare function getToolCounts(): Map<string, number>;
|
|
17
|
+
export declare function cloneServer(id: string, newName: string): McpServerEntry;
|
|
17
18
|
export declare function getCachedTools(serverId: string): Array<{
|
|
18
19
|
name: string;
|
|
19
20
|
description: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/mcps",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Meta-MCP registry & CLI — discover, manage, and proxy MCP servers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"README.md"
|
|
24
24
|
],
|
|
25
25
|
"scripts": {
|
|
26
|
-
"build": "bun run build:dashboard && bun build ./src/cli/index.tsx --outdir ./bin --target bun --external ink --external react --external chalk && bun build ./src/mcp/index.ts --outfile ./bin/mcp.js --target bun && bun build ./src/index.ts --outdir ./dist --target bun && tsc --emitDeclarationOnly --declaration --outDir dist",
|
|
26
|
+
"build": "bun run build:dashboard && bun build ./src/cli/index.tsx --outdir ./bin --target bun --external ink --external react --external chalk && bun build ./src/mcp/index.ts --outfile ./bin/mcp.js --target bun && node -e \"const fs=require('fs');const f='bin/mcp.js';const c=fs.readFileSync(f,'utf8');if(!c.startsWith('#!/'))fs.writeFileSync(f,'#!/usr/bin/env bun\\n'+c);fs.chmodSync(f,0o755);\" && bun build ./src/index.ts --outdir ./dist --target bun && tsc --emitDeclarationOnly --declaration --outDir dist",
|
|
27
27
|
"build:dashboard": "cd dashboard && bun install && bun run build",
|
|
28
28
|
"dev": "bun run src/cli/index.tsx",
|
|
29
29
|
"dev:mcp": "bun run src/mcp/index.ts",
|