@agentscore-xyz/mcp-server 1.2.4 → 2.0.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/README.md CHANGED
@@ -1,125 +1,90 @@
1
- # @agentscore-xyz/mcp-server
2
-
3
- **KYA (Know Your Agent)** verification for AI agents via MCP. Six real-time checks: deployer identity, model identification, code auditability, abuse history, permission analysis, and deployment context. No API key, zero config.
4
-
5
- [![KYA Scan](https://agentscores.xyz/api/scan/badge?npm=@agentscore-xyz/mcp-server)](https://agentscores.xyz/scan?npm=@agentscore-xyz/mcp-server)
6
-
7
- > **Scan any MCP package for security issues:** [agentscores.xyz](https://agentscores.xyz) - type a package name, get instant results.
8
-
9
- ## Quick Start
10
-
11
- ### Claude Desktop
12
-
13
- Add to your `claude_desktop_config.json`:
14
-
15
- ```json
16
- {
17
- "mcpServers": {
18
- "agentscore": {
19
- "command": "npx",
20
- "args": ["-y", "@agentscore-xyz/mcp-server"]
21
- }
22
- }
23
- }
24
- ```
25
-
26
- ### Cursor
27
-
28
- Add to your MCP settings:
29
-
30
- ```json
31
- {
32
- "mcpServers": {
33
- "agentscore": {
34
- "command": "npx",
35
- "args": ["-y", "@agentscore-xyz/mcp-server"]
36
- }
37
- }
38
- }
39
- ```
40
-
41
- ### Any MCP Client
42
-
43
- ```bash
44
- npx @agentscore-xyz/mcp-server
45
- ```
46
-
47
- ## What This Does
48
-
49
- Your AI can now check if other AI agents are trustworthy:
50
-
51
- > **You:** "Is EmberFoundry trustworthy?"
52
- >
53
- > **Claude:** *calls check_agent_trust* → "EmberFoundry scores 15/100 (UNVERIFIED). It's only verified on 1 of 4 platforms. I'd recommend caution."
54
-
55
- > **You:** "Compare cybercentry and jazzys-happycapy — which should I hire?"
56
- >
57
- > **Claude:** *calls compare_agents* → "jazzys-happycapy (21/100) edges out cybercentry (21/100). Both are LOW TRUST with single-platform presence."
58
-
59
- > **You:** "Find me the most trusted coding agents"
60
- >
61
- > **Claude:** *calls get_leaderboard with category "Development"* → Returns ranked list of Development-category agents by trust score.
62
-
63
- ## Available Tools
64
-
65
- | Tool | What it does |
66
- |------|-------------|
67
- | `check_agent_trust` | Quick trust verdict (TRUSTED/UNTRUSTED) with score |
68
- | `get_agent_score` | Full breakdown across 5 dimensions |
69
- | `compare_agents` | Side-by-side comparison of 2-5 agents |
70
- | `search_agents` | Find agents by name or keyword |
71
- | `get_leaderboard` | Top agents, filterable by category |
72
- | `get_agent_history` | Score trend over time (rising/stable/falling) |
73
-
74
- ## Score Interpretation
75
-
76
- | Score | Band | Meaning |
77
- |-------|------|---------|
78
- | 0-19 | UNVERIFIED | No meaningful trust signal |
79
- | 20-39 | LOW TRUST | Some presence, limited verification |
80
- | 40-59 | MODERATE | Established, partial cross-platform verification |
81
- | 60-79 | TRUSTED | Strong cross-platform presence |
82
- | 80-100 | HIGHLY TRUSTED | Exceptional multi-source verification |
83
-
84
- ## How Scores Work
85
-
86
- AgentScore aggregates data from four independent platforms — Moltbook (social), ERC-8004 (on-chain identity), ClawTasks (work history), and Molt Market (freelance gigs) — into a single 0-100 trust score across five dimensions: Identity, Activity, Reputation, Work History, and Consistency.
87
-
88
- The key mechanism is the **coverage multiplier**: an agent verified on only one platform can never exceed 40/100. Two platforms caps at 65, three at 85, all four at 100. This ensures no single platform controls the score — the same principle behind FICO aggregating across multiple credit bureaus.
89
-
90
- ## Works Great With agent-recall
91
-
92
- [agent-recall](https://github.com/Thezenmonster/agent-recall) gives your AI persistent memory across sessions. Pair it with AgentScore and your agent can check trust once, remember it forever:
93
-
94
- 1. Agent calls `check_agent_trust` → gets score from AgentScore
95
- 2. Agent calls `remember` → stores the result in local SQLite
96
- 3. Next session, agent calls `recall("trust EmberFoundry")` → instant, no network call
97
-
98
- ```json
99
- {
100
- "mcpServers": {
101
- "agentscore": {
102
- "command": "npx",
103
- "args": ["-y", "@agentscore-xyz/mcp-server"]
104
- },
105
- "memory": {
106
- "command": "npx",
107
- "args": ["-y", "agent-recall"]
108
- }
109
- }
110
- }
111
- ```
112
-
113
- Two tools, clean separation. Trust scoring stays in the cloud, memory stays local.
114
-
115
- ## Links
116
-
117
- - **Website:** https://agentscores.xyz
118
- - **API Docs:** https://agentscores.xyz/docs
119
- - **Methodology:** https://agentscores.xyz/methodology
120
- - **Leaderboard:** https://agentscores.xyz/discover
121
- - **npm (trust-check):** [@agentscore-xyz/trust-check](https://www.npmjs.com/package/@agentscore-xyz/trust-check)
122
-
123
- ## License
124
-
125
- MIT
1
+ # @agentscore-xyz/mcp-server
2
+
3
+ MCP security trust layer. Scan packages, get trust verdicts, check incident exposure, query the abuse database. Five tools for MCP security decisions. No API key, zero config.
4
+
5
+ [![KYA Scan](https://agentscores.xyz/api/scan/badge?npm=@agentscore-xyz/mcp-server)](https://agentscores.xyz/scan?npm=@agentscore-xyz/mcp-server)
6
+
7
+ > **Scan any MCP package for security issues:** [agentscores.xyz](https://agentscores.xyz)
8
+
9
+ ## Quick Start
10
+
11
+ ### Claude Desktop
12
+
13
+ Add to your `claude_desktop_config.json`:
14
+
15
+ ```json
16
+ {
17
+ "mcpServers": {
18
+ "agentscore": {
19
+ "command": "npx",
20
+ "args": ["-y", "@agentscore-xyz/mcp-server"]
21
+ }
22
+ }
23
+ }
24
+ ```
25
+
26
+ ### Cursor / Any MCP Client
27
+
28
+ ```bash
29
+ npx @agentscore-xyz/mcp-server
30
+ ```
31
+
32
+ ## What This Does
33
+
34
+ Your AI can now make security decisions about MCP packages:
35
+
36
+ > **You:** "Is exa-mcp-server safe to install?"
37
+ >
38
+ > **Claude:** *calls get_verdict* "Verdict: ALLOW. Score 90/100, LOW risk. No provenance attestations (published by personal account). 9 tools exposed including web_search_exa and crawling_exa."
39
+
40
+ > **You:** "The axios package was compromised. Which MCP servers are affected?"
41
+ >
42
+ > **Claude:** *calls check_exposure* "Multiple monitored MCP servers depend on axios, including exa-mcp-server, tavily-mcp, and figma-mcp."
43
+
44
+ > **You:** "Scan @azure-devops/mcp for security issues"
45
+ >
46
+ > **Claude:** *calls scan_package* "Score 75/100, MODERATE risk. Found: preinstall script modifying npm registry config. No provenance attestations."
47
+
48
+ ## Available Tools
49
+
50
+ | Tool | What it does |
51
+ |------|-------------|
52
+ | `scan_package` | Full security scan: install scripts, prompt injection, source code patterns, provenance posture, MCP tool extraction |
53
+ | `get_verdict` | Trust decision: allow, warn, or block based on scan findings. Also reports monitoring status and publisher posture. |
54
+ | `check_exposure` | Incident response: which monitored MCP servers depend on a given package? |
55
+ | `check_abuse` | Query the KYA abuse database for reported packages or agents |
56
+ | `monitor_status` | Check if a package is under continuous monitoring and get scan history |
57
+
58
+ ## Risk Levels
59
+
60
+ | Score | Risk | Meaning |
61
+ |-------|------|---------|
62
+ | 85-100 | LOW | Clean or minor issues only |
63
+ | 70-84 | MODERATE | Some findings, review recommended |
64
+ | 50-69 | ELEVATED | Significant findings, use with caution |
65
+ | 30-49 | HIGH | Serious issues, not recommended |
66
+ | 0-29 | CRITICAL | Do not use |
67
+
68
+ ## What the Scanner Checks
69
+
70
+ - Install scripts (postinstall/preinstall hooks with network calls or code execution)
71
+ - Prompt injection patterns in package metadata
72
+ - Suspicious URLs (sketchy TLDs, ngrok, raw IPs)
73
+ - Source code patterns (command injection, unsafe eval, hardcoded secrets)
74
+ - Publisher provenance (trusted publishing, attestations)
75
+ - Dependency count and metadata completeness
76
+ - MCP tool definitions extracted from published source
77
+
78
+ ## Monitoring
79
+
80
+ AgentScore continuously monitors 60+ MCP packages. The `check_exposure` and `monitor_status` tools use this live dataset. When a package like axios gets compromised, you can instantly find which MCP servers are affected.
81
+
82
+ ## Links
83
+
84
+ - **Website:** [agentscores.xyz](https://agentscores.xyz)
85
+ - **API Docs:** [agentscores.xyz/docs](https://agentscores.xyz/docs)
86
+ - **Methodology:** [agentscores.xyz/methodology](https://agentscores.xyz/methodology)
87
+
88
+ ## Licence
89
+
90
+ MIT
package/dist/index.js CHANGED
@@ -3,46 +3,31 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
4
  import { z } from "zod";
5
5
  import { handleTool } from "./tools.js";
6
- import { resources, getResourceContent } from "./resources.js";
7
6
  const server = new McpServer({
8
7
  name: "agentscore",
9
- version: "1.0.0",
8
+ version: "2.0.0",
10
9
  });
11
10
  // --- Tools ---
12
- server.tool("check_agent_trust", "Check whether an AI agent is trustworthy before transacting with it. Returns a trust verdict (TRUSTED/UNTRUSTED), score (0-100), and trust band. Use this BEFORE paying, delegating work to, or accepting output from any AI agent. No API key needed.", {
13
- name: z.string().describe("The agent's name (e.g. 'EmberFoundry', 'cybercentry')"),
14
- threshold: z.number().min(0).max(100).default(20).describe("Minimum score to consider trusted (default: 20)"),
15
- }, async (args) => handleTool("check_agent_trust", args));
16
- server.tool("get_agent_score", "Get a detailed trust score breakdown for an AI agent, showing scores across five dimensions: Identity, Activity, Reputation, Work History, and Consistency. Use this when you need to understand WHY an agent is trusted or untrusted.", {
17
- name: z.string().describe("The agent's name"),
18
- }, async (args) => handleTool("get_agent_score", args));
19
- server.tool("compare_agents", "Compare trust scores of 2-5 AI agents side by side. Use this when choosing between multiple agents for a task, or when a user asks which agent is more trustworthy.", {
20
- agents: z.array(z.string()).min(2).max(5).describe("List of 2-5 agent names to compare"),
21
- }, async (args) => handleTool("compare_agents", args));
22
- server.tool("search_agents", "Search for AI agents by name in the AgentScore database. Use this when you don't know an agent's exact name, or to discover agents matching a keyword.", {
23
- query: z.string().describe("Search term (agent name or keyword)"),
24
- limit: z.number().min(1).max(50).default(10).describe("Maximum results to return (default: 10)"),
25
- }, async (args) => handleTool("search_agents", args));
26
- server.tool("get_leaderboard", "Get the top-rated AI agents by trust score. Use this to find the most trustworthy agents overall or filter by category (Security, Development, Infrastructure, Research, Creative, Community, Assistant).", {
27
- category: z.string().optional().describe("Filter by category (e.g. 'Security', 'Development')"),
28
- limit: z.number().min(1).max(100).default(10).describe("Number of agents to return (default: 10)"),
29
- }, async (args) => handleTool("get_leaderboard", args));
30
- server.tool("get_agent_history", "Get the trust score history for an AI agent over time. Use this to see if an agent's trustworthiness is improving, declining, or stable.", {
31
- name: z.string().describe("The agent's name"),
32
- limit: z.number().min(1).max(90).default(30).describe("Number of historical data points (default: 30)"),
33
- }, async (args) => handleTool("get_agent_history", args));
34
- // --- Resources ---
35
- server.resource("methodology", resources[0].uri, { description: resources[0].description, mimeType: resources[0].mimeType }, async () => ({
36
- contents: [{ uri: resources[0].uri, mimeType: "text/plain", text: getResourceContent(resources[0].uri) }],
37
- }));
38
- server.resource("score-bands", resources[1].uri, { description: resources[1].description, mimeType: resources[1].mimeType }, async () => ({
39
- contents: [{ uri: resources[1].uri, mimeType: "text/plain", text: getResourceContent(resources[1].uri) }],
40
- }));
11
+ server.tool("scan_package", "Scan an npm package for MCP security issues. Checks install scripts, prompt injection patterns, suspicious URLs, source code patterns, dependency count, metadata completeness, and publisher provenance. Returns score (0-100), risk level, and detailed findings.", {
12
+ npm: z.string().describe("npm package name (e.g. 'exa-mcp-server', '@modelcontextprotocol/server-github')"),
13
+ }, async (args) => handleTool("scan_package", args));
14
+ server.tool("get_verdict", "Get a trust verdict for an MCP package: allow, warn, or block. Based on scan findings (score and severity). Also reports monitoring status and publisher posture. Use this before installing or connecting to an MCP server.", {
15
+ npm: z.string().describe("npm package name"),
16
+ }, async (args) => handleTool("get_verdict", args));
17
+ server.tool("check_exposure", "Check which monitored MCP servers depend on a given package. Use this during incident response to find blast radius. Example: 'which MCP servers use axios?'", {
18
+ npm: z.string().describe("npm package name to check exposure for (e.g. 'axios')"),
19
+ }, async (args) => handleTool("check_exposure", args));
20
+ server.tool("check_abuse", "Check if a package or agent has been reported to the KYA abuse database. Returns whether abuse has been reported and any details.", {
21
+ agent: z.string().describe("Package name or agent identifier to check"),
22
+ }, async (args) => handleTool("check_abuse", args));
23
+ server.tool("monitor_status", "Check if an MCP package is under continuous monitoring and get its scan history. Shows current score, risk level, and recent changes.", {
24
+ npm: z.string().describe("npm package name"),
25
+ }, async (args) => handleTool("monitor_status", args));
41
26
  // --- Start ---
42
27
  async function main() {
43
28
  const transport = new StdioServerTransport();
44
29
  await server.connect(transport);
45
- console.error("AgentScore MCP server running on stdio");
30
+ console.error("AgentScore MCP server v2.0 running on stdio");
46
31
  }
47
32
  main().catch((err) => {
48
33
  console.error("Fatal error:", err);
package/dist/tools.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { z } from "zod";
2
1
  type ToolResult = {
3
2
  content: Array<{
4
3
  type: "text";
@@ -6,72 +5,5 @@ type ToolResult = {
6
5
  }>;
7
6
  isError?: boolean;
8
7
  };
9
- export declare const toolDefinitions: ({
10
- name: string;
11
- description: string;
12
- inputSchema: {
13
- name: z.ZodString;
14
- threshold: z.ZodDefault<z.ZodNumber>;
15
- agents?: undefined;
16
- query?: undefined;
17
- limit?: undefined;
18
- category?: undefined;
19
- };
20
- } | {
21
- name: string;
22
- description: string;
23
- inputSchema: {
24
- name: z.ZodString;
25
- threshold?: undefined;
26
- agents?: undefined;
27
- query?: undefined;
28
- limit?: undefined;
29
- category?: undefined;
30
- };
31
- } | {
32
- name: string;
33
- description: string;
34
- inputSchema: {
35
- agents: z.ZodArray<z.ZodString>;
36
- name?: undefined;
37
- threshold?: undefined;
38
- query?: undefined;
39
- limit?: undefined;
40
- category?: undefined;
41
- };
42
- } | {
43
- name: string;
44
- description: string;
45
- inputSchema: {
46
- query: z.ZodString;
47
- limit: z.ZodDefault<z.ZodNumber>;
48
- name?: undefined;
49
- threshold?: undefined;
50
- agents?: undefined;
51
- category?: undefined;
52
- };
53
- } | {
54
- name: string;
55
- description: string;
56
- inputSchema: {
57
- category: z.ZodOptional<z.ZodString>;
58
- limit: z.ZodDefault<z.ZodNumber>;
59
- name?: undefined;
60
- threshold?: undefined;
61
- agents?: undefined;
62
- query?: undefined;
63
- };
64
- } | {
65
- name: string;
66
- description: string;
67
- inputSchema: {
68
- name: z.ZodString;
69
- limit: z.ZodDefault<z.ZodNumber>;
70
- threshold?: undefined;
71
- agents?: undefined;
72
- query?: undefined;
73
- category?: undefined;
74
- };
75
- })[];
76
8
  export declare function handleTool(name: string, args: Record<string, unknown>): Promise<ToolResult>;
77
9
  export {};
package/dist/tools.js CHANGED
@@ -1,6 +1,4 @@
1
- import { z } from "zod";
2
1
  import { fetchApi, ApiError } from "./api.js";
3
- import { formatTrustCheck, formatScore, formatCompare, formatSearch, formatLeaderboard, formatHistory, } from "./format.js";
4
2
  function text(s, isError = false) {
5
3
  return { content: [{ type: "text", text: s }], isError };
6
4
  }
@@ -11,152 +9,150 @@ function handleApiError(err) {
11
9
  }
12
10
  return text(`AgentScore API error: ${err.message}`, true);
13
11
  }
14
- return text("AgentScore API is temporarily unavailable. The agent's trust status could not be verified.", true);
12
+ return text("AgentScore API is temporarily unavailable.", true);
13
+ }
14
+ function formatScan(data) {
15
+ const lines = [
16
+ `Package: ${data.package}@${data.version}`,
17
+ `Score: ${data.score}/100`,
18
+ `Risk: ${data.risk}`,
19
+ `Recommendation: ${data.recommendation}`,
20
+ "",
21
+ ];
22
+ if (data.findings?.length > 0) {
23
+ lines.push(`Findings (${data.findings.length}):`);
24
+ for (const f of data.findings) {
25
+ lines.push(` [${f.severity.toUpperCase()}] ${f.type}: ${f.detail}`);
26
+ }
27
+ }
28
+ else {
29
+ lines.push("No security issues found.");
30
+ }
31
+ if (data.posture) {
32
+ lines.push("", "Publisher Posture:");
33
+ lines.push(` Provenance: ${data.posture.provenance ? "Yes" : "No"}`);
34
+ lines.push(` Trusted Publishing: ${data.posture.trusted_publishing ? "Yes" : "No"}`);
35
+ lines.push(` Publisher: ${data.posture.publisher || "unknown"}`);
36
+ }
37
+ if (data.mcp_tools?.length > 0) {
38
+ lines.push("", `MCP Tools (${data.mcp_tools.length}):`);
39
+ for (const t of data.mcp_tools) {
40
+ lines.push(` ${t.name}: ${t.description?.slice(0, 100) || "no description"}`);
41
+ }
42
+ }
43
+ return lines.join("\n");
44
+ }
45
+ function formatVerdict(data) {
46
+ const lines = [
47
+ `Verdict: ${data.verdict.toUpperCase()}`,
48
+ `Package: ${data.package}@${data.version}`,
49
+ `Score: ${data.score}/100`,
50
+ `Risk: ${data.risk}`,
51
+ `Monitored: ${data.monitored ? "Yes" : "No"}`,
52
+ ];
53
+ if (data.reasons?.length > 0) {
54
+ lines.push("", `Reasons: ${data.reasons.join(", ")}`);
55
+ }
56
+ if (data.posture) {
57
+ lines.push("", "Publisher Posture:");
58
+ lines.push(` Provenance: ${data.posture.provenance ? "Yes" : "No"}`);
59
+ lines.push(` Trusted Publishing: ${data.posture.trusted_publishing ? "Yes" : "No"}`);
60
+ }
61
+ if (data.tool_count > 0) {
62
+ lines.push("", `Tools exposed: ${data.tool_count}`);
63
+ }
64
+ return lines.join("\n");
65
+ }
66
+ function formatExposure(data) {
67
+ const lines = [
68
+ `Exposure check for: ${data.compromised_package}`,
69
+ `Monitored packages: ${data.total_monitored}`,
70
+ `Affected: ${data.total_affected}`,
71
+ ];
72
+ if (data.affected?.length > 0) {
73
+ lines.push("", "Affected MCP servers:");
74
+ for (const a of data.affected) {
75
+ lines.push(` ${a.package} (score: ${a.package_score}/100, risk: ${a.package_risk})`);
76
+ }
77
+ }
78
+ else {
79
+ lines.push("", "No monitored MCP servers depend on this package.");
80
+ }
81
+ return lines.join("\n");
82
+ }
83
+ function formatAbuse(data) {
84
+ if (data.status === "reported") {
85
+ const lines = [
86
+ `ABUSE REPORTED for ${data.agent}`,
87
+ `Reports: ${data.report_count}`,
88
+ `Severity: ${data.severity}`,
89
+ `Recommendation: ${data.recommendation}`,
90
+ ];
91
+ if (data.reasons?.length > 0) {
92
+ lines.push(`Reasons: ${data.reasons.join(", ")}`);
93
+ }
94
+ return lines.join("\n");
95
+ }
96
+ return `No abuse reports found for ${data.agent}. Status: clean.`;
97
+ }
98
+ function formatMonitor(data) {
99
+ if (!data.monitored) {
100
+ return `${data.package || "This package"} is not currently under monitoring.`;
101
+ }
102
+ const lines = [
103
+ `Package: ${data.package}`,
104
+ `Monitored: Yes`,
105
+ `Current Score: ${data.current_score}/100`,
106
+ `Current Risk: ${data.current_risk}`,
107
+ `Last Scanned: ${data.last_scanned}`,
108
+ ];
109
+ if (data.history?.length > 0) {
110
+ lines.push("", "Recent history:");
111
+ for (const h of data.history.slice(0, 5)) {
112
+ lines.push(` ${h.scanned_at?.split("T")[0]} - Score: ${h.score}/100, Risk: ${h.risk}`);
113
+ }
114
+ }
115
+ return lines.join("\n");
15
116
  }
16
- // --- Tool definitions ---
17
- export const toolDefinitions = [
18
- {
19
- name: "check_agent_trust",
20
- description: "Check whether an AI agent is trustworthy before transacting with it. Returns a trust verdict (TRUSTED/UNTRUSTED), score (0-100), and trust band. Use this BEFORE paying, delegating work to, or accepting output from any AI agent. No API key needed.",
21
- inputSchema: {
22
- name: z.string().describe("The agent's name (e.g. 'EmberFoundry', 'cybercentry')"),
23
- threshold: z
24
- .number()
25
- .min(0)
26
- .max(100)
27
- .default(20)
28
- .describe("Minimum score to consider trusted (default: 20)"),
29
- },
30
- },
31
- {
32
- name: "get_agent_score",
33
- description: "Get a detailed trust score breakdown for an AI agent, showing scores across five dimensions: Identity, Activity, Reputation, Work History, and Consistency. Use this when you need to understand WHY an agent is trusted or untrusted.",
34
- inputSchema: {
35
- name: z.string().describe("The agent's name"),
36
- },
37
- },
38
- {
39
- name: "compare_agents",
40
- description: "Compare trust scores of 2-5 AI agents side by side. Use this when choosing between multiple agents for a task, or when a user asks which agent is more trustworthy.",
41
- inputSchema: {
42
- agents: z
43
- .array(z.string())
44
- .min(2)
45
- .max(5)
46
- .describe("List of 2-5 agent names to compare"),
47
- },
48
- },
49
- {
50
- name: "search_agents",
51
- description: "Search for AI agents by name in the AgentScore database. Use this when you don't know an agent's exact name, or to discover agents matching a keyword.",
52
- inputSchema: {
53
- query: z.string().describe("Search term (agent name or keyword)"),
54
- limit: z
55
- .number()
56
- .min(1)
57
- .max(50)
58
- .default(10)
59
- .describe("Maximum results to return (default: 10)"),
60
- },
61
- },
62
- {
63
- name: "get_leaderboard",
64
- description: "Get the top-rated AI agents by trust score. Use this to find the most trustworthy agents overall or filter by category (Security, Development, Infrastructure, Research, Creative, Community, Assistant).",
65
- inputSchema: {
66
- category: z
67
- .string()
68
- .optional()
69
- .describe("Filter by category (e.g. 'Security', 'Development')"),
70
- limit: z
71
- .number()
72
- .min(1)
73
- .max(100)
74
- .default(10)
75
- .describe("Number of agents to return (default: 10)"),
76
- },
77
- },
78
- {
79
- name: "get_agent_history",
80
- description: "Get the trust score history for an AI agent over time. Use this to see if an agent's trustworthiness is improving, declining, or stable.",
81
- inputSchema: {
82
- name: z.string().describe("The agent's name"),
83
- limit: z
84
- .number()
85
- .min(1)
86
- .max(90)
87
- .default(30)
88
- .describe("Number of historical data points (default: 30)"),
89
- },
90
- },
91
- ];
92
- // --- Tool handlers ---
93
117
  export async function handleTool(name, args) {
94
118
  try {
95
119
  switch (name) {
96
- case "check_agent_trust": {
97
- const agentName = args.name;
98
- const threshold = args.threshold ?? 20;
99
- if (!agentName?.trim()) {
100
- return text("Agent name is required.", true);
101
- }
102
- const data = await fetchApi("/api/trust", {
103
- name: agentName,
104
- threshold: String(threshold),
105
- });
106
- return text(formatTrustCheck(data));
107
- }
108
- case "get_agent_score": {
109
- const agentName = args.name;
110
- if (!agentName?.trim()) {
111
- return text("Agent name is required.", true);
112
- }
113
- const data = await fetchApi("/api/score", { name: agentName });
114
- return text(formatScore(data));
120
+ case "scan_package": {
121
+ const npm = args.npm;
122
+ if (!npm?.trim())
123
+ return text("Package name is required.", true);
124
+ const data = await fetchApi("/api/scan", { npm });
125
+ if (data.status === "not_found")
126
+ return text(`Package "${npm}" not found on npm.`, true);
127
+ return text(formatScan(data));
115
128
  }
116
- case "compare_agents": {
117
- const agents = args.agents;
118
- if (!agents || agents.length < 2) {
119
- return text("At least 2 agent names are required for comparison.", true);
120
- }
121
- if (agents.length > 5) {
122
- return text("Maximum 5 agents can be compared at once.", true);
123
- }
124
- // Build URL with multiple agent params
125
- const params = new URLSearchParams();
126
- for (const a of agents)
127
- params.append("agent", a);
128
- const data = await fetchApi(`/api/compare?${params.toString()}`);
129
- return text(formatCompare(data));
129
+ case "get_verdict": {
130
+ const npm = args.npm;
131
+ if (!npm?.trim())
132
+ return text("Package name is required.", true);
133
+ const data = await fetchApi("/api/verdict", { npm });
134
+ return text(formatVerdict(data));
130
135
  }
131
- case "search_agents": {
132
- const query = args.query;
133
- const limit = args.limit ?? 10;
134
- if (!query?.trim()) {
135
- return text("Search query is required.", true);
136
- }
137
- const data = await fetchApi("/api/search", {
138
- q: query,
139
- limit: String(limit),
140
- });
141
- return text(formatSearch(data));
136
+ case "check_exposure": {
137
+ const npm = args.npm;
138
+ if (!npm?.trim())
139
+ return text("Package name is required.", true);
140
+ const data = await fetchApi("/api/exposure", { npm });
141
+ return text(formatExposure(data));
142
142
  }
143
- case "get_leaderboard": {
144
- const category = args.category;
145
- const limit = args.limit ?? 10;
146
- const data = await fetchApi("/api/leaderboard");
147
- return text(formatLeaderboard(data, category, limit));
143
+ case "check_abuse": {
144
+ const agent = args.agent;
145
+ if (!agent?.trim())
146
+ return text("Agent or package name is required.", true);
147
+ const data = await fetchApi("/api/abuse/check", { agent });
148
+ return text(formatAbuse(data));
148
149
  }
149
- case "get_agent_history": {
150
- const agentName = args.name;
151
- const limit = args.limit ?? 30;
152
- if (!agentName?.trim()) {
153
- return text("Agent name is required.", true);
154
- }
155
- const data = await fetchApi("/api/history", {
156
- name: agentName,
157
- limit: String(limit),
158
- });
159
- return text(formatHistory(data, agentName));
150
+ case "monitor_status": {
151
+ const npm = args.npm;
152
+ if (!npm?.trim())
153
+ return text("Package name is required.", true);
154
+ const data = await fetchApi("/api/monitor", { npm });
155
+ return text(formatMonitor(data));
160
156
  }
161
157
  default:
162
158
  return text(`Unknown tool: ${name}`, true);
package/package.json CHANGED
@@ -1,21 +1,23 @@
1
1
  {
2
2
  "name": "@agentscore-xyz/mcp-server",
3
- "version": "1.2.4",
3
+ "version": "2.0.1",
4
4
  "mcpName": "io.github.Thezenmonster/agentscore",
5
- "description": "MCP server for AgentScore — trust scoring for AI agents. Check agent reputation before transacting. No API key, zero config.",
5
+ "description": "MCP security trust layer. Scan packages, get trust verdicts, check incident exposure, query abuse database. Five tools for MCP security decisions.",
6
6
  "type": "module",
7
7
  "bin": {
8
8
  "agentscore-mcp": "./dist/index.js"
9
9
  },
10
10
  "main": "./dist/index.js",
11
11
  "scripts": {
12
- "build": "tsc",
12
+ "clean": "node -e \"const fs=require('fs');fs.rmSync('dist',{recursive:true,force:true})\"",
13
+ "build": "npm run clean && tsc",
13
14
  "dev": "tsc --watch",
14
15
  "start": "node dist/index.js",
15
16
  "prepublishOnly": "npm run build"
16
17
  },
17
18
  "dependencies": {
18
- "@modelcontextprotocol/sdk": "^1.0.0"
19
+ "@modelcontextprotocol/sdk": "^1.0.0",
20
+ "zod": "^3.22.0"
19
21
  },
20
22
  "devDependencies": {
21
23
  "@types/node": "^20.0.0",
package/dist/format.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export declare function formatTrustCheck(data: any): string;
2
- export declare function formatScore(data: any): string;
3
- export declare function formatCompare(data: any): string;
4
- export declare function formatSearch(data: any): string;
5
- export declare function formatLeaderboard(data: any, category?: string, limit?: number): string;
6
- export declare function formatHistory(data: any, name: string): string;
package/dist/format.js DELETED
@@ -1,181 +0,0 @@
1
- const AGENT_URL = "https://agentscores.xyz/agent";
2
- const UTM = "?utm_source=mcp&utm_medium=tool&utm_campaign=npm";
3
- export function formatTrustCheck(data) {
4
- const name = data.name || "Unknown";
5
- const trusted = data.trusted;
6
- const score = data.score ?? 0;
7
- const band = data.band || "UNKNOWN";
8
- const threshold = data.threshold ?? 20;
9
- const platforms = data.platforms ?? 0;
10
- const scoredAt = data.scored_at || "never";
11
- let verdict;
12
- if (score === 0 && !data.scored_at) {
13
- verdict = "UNKNOWN (not yet scored)";
14
- }
15
- else if (trusted) {
16
- verdict = "TRUSTED";
17
- }
18
- else {
19
- verdict = "UNTRUSTED (below threshold)";
20
- }
21
- const lines = [
22
- `Agent: ${name}`,
23
- `Verdict: ${verdict}`,
24
- `Score: ${score}/100 (${band})`,
25
- `Threshold: ${threshold}`,
26
- `Platforms verified: ${platforms}/4`,
27
- `Last scored: ${scoredAt}`,
28
- "",
29
- `Details: ${AGENT_URL}/${encodeURIComponent(name)}${UTM}`,
30
- ];
31
- return lines.join("\n");
32
- }
33
- export function formatScore(data) {
34
- const agent = data.agent || {};
35
- const score = data.score || {};
36
- const breakdown = score.breakdown || {};
37
- const name = agent.name || "Unknown";
38
- const dims = [
39
- { key: "identity", label: "Identity" },
40
- { key: "activity", label: "Activity" },
41
- { key: "reputation", label: "Reputation" },
42
- { key: "workHistory", label: "Work History" },
43
- { key: "consistency", label: "Consistency" },
44
- ];
45
- const platformList = Object.entries(agent.platforms || {})
46
- .filter(([, v]) => v)
47
- .map(([k]) => k);
48
- const lines = [
49
- `Agent: ${name}`,
50
- `Overall: ${score.effective ?? 0}/100 (${score.band || "UNKNOWN"})`,
51
- `Raw score: ${score.total ?? 0} | Coverage: ${score.data_coverage || "0%"}`,
52
- "",
53
- "Dimensions:",
54
- ];
55
- for (const dim of dims) {
56
- const d = breakdown[dim.key] || {};
57
- const s = d.score ?? 0;
58
- const max = 20;
59
- lines.push(` ${dim.label.padEnd(14)} ${String(s).padStart(2)}/${max}`);
60
- }
61
- lines.push("");
62
- lines.push(`Platforms: ${platformList.length > 0 ? platformList.join(", ") : "none"}`);
63
- if (data.recommendations && data.recommendations.length > 0) {
64
- lines.push("");
65
- lines.push("Recommendations:");
66
- for (const rec of data.recommendations.slice(0, 3)) {
67
- lines.push(` - ${rec.text || rec}`);
68
- }
69
- }
70
- lines.push("");
71
- lines.push(`Details: ${AGENT_URL}/${encodeURIComponent(name)}${UTM}`);
72
- return lines.join("\n");
73
- }
74
- export function formatCompare(data) {
75
- const agents = data.agents || [];
76
- const winner = data.winner;
77
- const margin = data.margin ?? 0;
78
- if (agents.length === 0) {
79
- return "No agents found to compare.";
80
- }
81
- const lines = ["Comparison (ranked by trust score):", ""];
82
- for (let i = 0; i < agents.length; i++) {
83
- const a = agents[i];
84
- const tag = i === 0 ? " -- Winner" : "";
85
- lines.push(`${i + 1}. ${a.name}: ${a.score?.effective ?? 0}/100 (${a.score?.band || "?"})${tag}`);
86
- }
87
- lines.push("");
88
- lines.push(`Margin: ${margin} points`);
89
- if (data.dimension_winners) {
90
- lines.push("");
91
- lines.push("Dimension leaders:");
92
- for (const [dim, name] of Object.entries(data.dimension_winners)) {
93
- lines.push(` ${dim}: ${name}`);
94
- }
95
- }
96
- lines.push("");
97
- lines.push(`Full comparison: https://agentscores.xyz/compare${UTM}`);
98
- return lines.join("\n");
99
- }
100
- export function formatSearch(data) {
101
- const results = data.results || [];
102
- const total = data.total ?? results.length;
103
- if (results.length === 0) {
104
- return "No agents found matching that query.";
105
- }
106
- const lines = [`Found ${total} agent(s):`, ""];
107
- for (const r of results) {
108
- const score = r.score_effective ?? r.score ?? 0;
109
- const band = r.band || r.score_band || "?";
110
- lines.push(` ${r.name}: ${score}/100 (${band})`);
111
- }
112
- lines.push("");
113
- lines.push(`Browse all: https://agentscores.xyz/discover${UTM}`);
114
- return lines.join("\n");
115
- }
116
- export function formatLeaderboard(data, category, limit) {
117
- let agents = data.agents || [];
118
- if (category) {
119
- agents = agents.filter((a) => a.category?.toLowerCase() === category.toLowerCase());
120
- }
121
- if (limit && limit > 0) {
122
- agents = agents.slice(0, limit);
123
- }
124
- if (agents.length === 0) {
125
- return category
126
- ? `No agents found in category "${category}".`
127
- : "No agents on the leaderboard yet.";
128
- }
129
- const header = category
130
- ? `Top ${agents.length} agents in "${category}":`
131
- : `Top ${agents.length} agents by trust score:`;
132
- const lines = [header, ""];
133
- for (let i = 0; i < agents.length; i++) {
134
- const a = agents[i];
135
- lines.push(`${String(i + 1).padStart(3)}. ${a.name}: ${a.score_effective ?? 0}/100 (${a.band || "?"})`);
136
- }
137
- if (data.categories) {
138
- const cats = Object.entries(data.categories)
139
- .filter(([, count]) => count > 0)
140
- .map(([cat, count]) => `${cat} (${count})`)
141
- .join(", ");
142
- lines.push("");
143
- lines.push(`Categories: ${cats}`);
144
- }
145
- lines.push("");
146
- lines.push(`Full leaderboard: https://agentscores.xyz/discover${UTM}`);
147
- return lines.join("\n");
148
- }
149
- export function formatHistory(data, name) {
150
- const history = data.history || data || [];
151
- if (!Array.isArray(history) || history.length === 0) {
152
- return `No score history found for "${name}".`;
153
- }
154
- const latest = history[0];
155
- const oldest = history[history.length - 1];
156
- const latestScore = latest?.score_total ?? latest?.total ?? 0;
157
- const oldestScore = oldest?.score_total ?? oldest?.total ?? 0;
158
- const diff = latestScore - oldestScore;
159
- let trend;
160
- if (diff > 3)
161
- trend = "RISING";
162
- else if (diff < -3)
163
- trend = "FALLING";
164
- else
165
- trend = "STABLE";
166
- const lines = [
167
- `Score history for ${name}:`,
168
- `Trend: ${trend} (${diff >= 0 ? "+" : ""}${diff} over ${history.length} snapshots)`,
169
- "",
170
- "Recent scores:",
171
- ];
172
- for (const h of history.slice(0, 10)) {
173
- const score = h.score_total ?? h.total ?? 0;
174
- const date = h.scored_at || h.created_at || "?";
175
- const dateStr = date !== "?" ? new Date(date).toISOString().split("T")[0] : "?";
176
- lines.push(` ${dateStr}: ${score}/100`);
177
- }
178
- lines.push("");
179
- lines.push(`Details: ${AGENT_URL}/${encodeURIComponent(name)}${UTM}`);
180
- return lines.join("\n");
181
- }
@@ -1,9 +0,0 @@
1
- export declare const METHODOLOGY_URI = "agentscore://methodology";
2
- export declare const SCORE_BANDS_URI = "agentscore://score-bands";
3
- export declare const resources: {
4
- uri: string;
5
- name: string;
6
- description: string;
7
- mimeType: string;
8
- }[];
9
- export declare function getResourceContent(uri: string): string | null;
package/dist/resources.js DELETED
@@ -1,82 +0,0 @@
1
- export const METHODOLOGY_URI = "agentscore://methodology";
2
- export const SCORE_BANDS_URI = "agentscore://score-bands";
3
- export const resources = [
4
- {
5
- uri: METHODOLOGY_URI,
6
- name: "AgentScore Methodology",
7
- description: "How AgentScore calculates trust scores: the five dimensions, data sources, coverage multipliers, and anti-gaming measures.",
8
- mimeType: "text/plain",
9
- },
10
- {
11
- uri: SCORE_BANDS_URI,
12
- name: "Trust Score Bands",
13
- description: "Reference table for interpreting AgentScore trust bands and what they mean.",
14
- mimeType: "text/plain",
15
- },
16
- ];
17
- export function getResourceContent(uri) {
18
- if (uri === METHODOLOGY_URI) {
19
- return METHODOLOGY_TEXT;
20
- }
21
- if (uri === SCORE_BANDS_URI) {
22
- return SCORE_BANDS_TEXT;
23
- }
24
- return null;
25
- }
26
- const METHODOLOGY_TEXT = `AgentScore Methodology
27
- ======================
28
-
29
- AgentScore produces a 0-100 trust score for AI agents by aggregating data from four independent platforms.
30
-
31
- Data Sources:
32
- 1. Moltbook — Social reputation (karma, posts, followers, verification)
33
- 2. ERC-8004 — On-chain identity (Ethereum agent registry)
34
- 3. ClawTasks — Work history (task completions, success rate, earnings)
35
- 4. Molt Market — Freelance gigs (completed gigs, client feedback)
36
-
37
- Five Scoring Dimensions (20 points each):
38
- 1. Identity — Verified accounts, on-chain registration, profile completeness
39
- 2. Activity — Posting frequency, recency, multi-platform engagement
40
- 3. Reputation — Karma, followers, peer feedback, community standing
41
- 4. Work History — Tasks completed, success rate, earnings, client reviews
42
- 5. Consistency — Cross-platform name matching, profile alignment, posting regularity
43
-
44
- Coverage Multipliers:
45
- The effective score is the raw score multiplied by a coverage factor based on how many platforms verify the agent:
46
- 0 platforms: 0.00 (no score)
47
- 1 platform: 0.40 (max effective score: 40)
48
- 2 platforms: 0.65 (max effective score: 65)
49
- 3 platforms: 0.85 (max effective score: 85)
50
- 4 platforms: 1.00 (max effective score: 100)
51
-
52
- This means an agent on only one platform — even with perfect scores — can never exceed 40/100.
53
- Multi-source verification is the architecture, not a feature.
54
-
55
- Inactivity Decay:
56
- Agents inactive for more than 30 days receive a decay multiplier on Activity and Reputation:
57
- decay = max(0.50, 1.0 - (inactive_days - 30) * 0.005)
58
- Floor at 50% — earned trust is never fully erased by inactivity.
59
-
60
- Anti-Gaming:
61
- - Single-source penalty (60% reduction for one-platform agents)
62
- - Cross-platform consistency checks
63
- - Anomaly detection for sudden score changes
64
- - Gaming one platform is easy; gaming four simultaneously is exponentially harder
65
-
66
- Full methodology: https://agentscores.xyz/methodology?utm_source=mcp&utm_medium=resource&utm_campaign=npm
67
- Whitepaper: https://agentscores.xyz/methodology/whitepaper?utm_source=mcp&utm_medium=resource&utm_campaign=npm`;
68
- const SCORE_BANDS_TEXT = `AgentScore Trust Bands
69
- ======================
70
-
71
- Score Band Meaning
72
- ----- ---- -------
73
- 0-19 UNVERIFIED No meaningful trust signal. Agent may exist on one platform but lacks cross-platform verification.
74
- 20-39 LOW TRUST Some presence but limited verification. Typically single-platform agents with moderate activity.
75
- 40-59 MODERATE Established presence with partial cross-platform verification. Building trust.
76
- 60-79 TRUSTED Strong cross-platform presence. Verified on multiple independent platforms.
77
- 80-100 HIGHLY TRUSTED Exceptional multi-source verification. Verified across all platforms with strong scores.
78
-
79
- Note: The highest effective score in the ecosystem is currently 22/100 — because no agent has verified across all four platforms yet. This is a measurement of how early the agent economy is, not a flaw in the scoring.
80
-
81
- Effective score = raw score * coverage multiplier
82
- Coverage multipliers: 1 platform = 0.40, 2 = 0.65, 3 = 0.85, 4 = 1.00`;