hvtracker-mcp 0.2.0 → 0.2.1
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/hvtracker-mcp.js +24 -2
- package/package.json +1 -1
- package/server.json +5 -6
package/bin/hvtracker-mcp.js
CHANGED
|
@@ -7,10 +7,13 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
7
7
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
|
|
10
|
-
const VERSION = "0.2.
|
|
10
|
+
const VERSION = "0.2.1";
|
|
11
11
|
const DEFAULT_BASE_URL = "https://hvtracker.net";
|
|
12
12
|
const BASE_URL = (process.env.HVTRACKER_BASE_URL || DEFAULT_BASE_URL).replace(/\/+$/, "");
|
|
13
13
|
const TIMEOUT_MS = Number(process.env.HVTRACKER_TIMEOUT_SECONDS || 20) * 1000;
|
|
14
|
+
// The full leaderboard is ~1MB and the API serves it with Cache-Control
|
|
15
|
+
// max-age=900; re-pulling it per search_agents call is wasted origin load.
|
|
16
|
+
const BOARD_TTL_MS = Number(process.env.HVTRACKER_BOARD_TTL_SECONDS || 900) * 1000;
|
|
14
17
|
const READ_ONLY = {
|
|
15
18
|
readOnlyHint: true,
|
|
16
19
|
destructiveHint: false,
|
|
@@ -40,6 +43,25 @@ export async function apiGet(path, params = {}) {
|
|
|
40
43
|
return payload;
|
|
41
44
|
}
|
|
42
45
|
|
|
46
|
+
const boardCache = { at: 0, data: null };
|
|
47
|
+
|
|
48
|
+
export function resetBoardCache() {
|
|
49
|
+
boardCache.at = 0;
|
|
50
|
+
boardCache.data = null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Returns /api/v1/agents, cached for BOARD_TTL_MS. Failures are not cached —
|
|
54
|
+
// the next call retries.
|
|
55
|
+
async function getBoard() {
|
|
56
|
+
if (boardCache.data !== null && Date.now() - boardCache.at < BOARD_TTL_MS) {
|
|
57
|
+
return boardCache.data;
|
|
58
|
+
}
|
|
59
|
+
const data = await apiGet("/api/v1/agents");
|
|
60
|
+
boardCache.data = data;
|
|
61
|
+
boardCache.at = Date.now();
|
|
62
|
+
return data;
|
|
63
|
+
}
|
|
64
|
+
|
|
43
65
|
function asToolResult(value) {
|
|
44
66
|
return {
|
|
45
67
|
content: [{ type: "text", text: JSON.stringify(value, null, 2) }],
|
|
@@ -170,7 +192,7 @@ export async function compareAgents(a, b) {
|
|
|
170
192
|
|
|
171
193
|
export async function searchAgents(query = "", category = "", limit = 10) {
|
|
172
194
|
try {
|
|
173
|
-
const data = await
|
|
195
|
+
const data = await getBoard();
|
|
174
196
|
const ql = String(query || "").trim().toLowerCase();
|
|
175
197
|
const cl = String(category || "").trim().toLowerCase();
|
|
176
198
|
const matches = [];
|
package/package.json
CHANGED
package/server.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "io.github.YugantM/hvtracker-mcp",
|
|
4
4
|
"title": "HVTracker MCP",
|
|
5
5
|
"description": "Pre-connect trust checks for AI agents and MCP servers using HVTracker's public trust registry.",
|
|
6
|
-
"version": "0.2.
|
|
6
|
+
"version": "0.2.1",
|
|
7
7
|
"repository": {
|
|
8
8
|
"url": "https://github.com/YugantM/hvtracker-mcp",
|
|
9
9
|
"source": "github"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
{
|
|
19
19
|
"registryType": "npm",
|
|
20
20
|
"identifier": "hvtracker-mcp",
|
|
21
|
-
"version": "0.2.
|
|
21
|
+
"version": "0.2.1",
|
|
22
22
|
"transport": {
|
|
23
23
|
"type": "stdio"
|
|
24
24
|
}
|
|
@@ -26,18 +26,17 @@
|
|
|
26
26
|
{
|
|
27
27
|
"registryType": "pypi",
|
|
28
28
|
"identifier": "hvtracker-mcp",
|
|
29
|
-
"version": "0.2.
|
|
29
|
+
"version": "0.2.1",
|
|
30
30
|
"transport": {
|
|
31
31
|
"type": "stdio"
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"registryType": "oci",
|
|
36
|
-
"identifier": "ghcr.io/yugantm/hvtracker-mcp:v0.2.
|
|
36
|
+
"identifier": "ghcr.io/yugantm/hvtracker-mcp:v0.2.1",
|
|
37
37
|
"transport": {
|
|
38
38
|
"type": "stdio"
|
|
39
|
-
}
|
|
40
|
-
"version": "0.2.0"
|
|
39
|
+
}
|
|
41
40
|
}
|
|
42
41
|
],
|
|
43
42
|
"tags": [
|