@agentscore-xyz/mcp-server 2.1.0 → 2.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/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import { z } from "zod";
5
5
  import { handleTool } from "./tools.js";
6
6
  const server = new McpServer({
7
7
  name: "agentscore",
8
- version: "2.1.0",
8
+ version: "2.2.0",
9
9
  });
10
10
  // --- Tools ---
11
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.", {
@@ -30,11 +30,15 @@ server.tool("generate_policy_gate_setup", "Generate the exact GitHub Actions wor
30
30
  path: z.string().optional().describe("Optional path to the repo root. Defaults to the current working directory."),
31
31
  repo_url: z.string().optional().describe("Optional repository URL override for the pilot handoff link."),
32
32
  }, async (args) => handleTool("generate_policy_gate_setup", args));
33
+ server.tool("install_policy_gate", "Write the AgentScore Policy Gate workflow file to this repo. Creates .github/workflows/agentscore-policy-gate.yml with OIDC authentication (no API key needed). Detects MCP dependencies and includes them in the workflow. The gate will auto-provision the repo on first push.", {
34
+ path: z.string().optional().describe("Optional path to the repo root. Defaults to the current working directory."),
35
+ repo_url: z.string().optional().describe("Optional repository URL override."),
36
+ }, async (args) => handleTool("install_policy_gate", args));
33
37
  // --- Start ---
34
38
  async function main() {
35
39
  const transport = new StdioServerTransport();
36
40
  await server.connect(transport);
37
- console.error("AgentScore MCP server v2.1 running on stdio");
41
+ console.error("AgentScore MCP server v2.2 running on stdio");
38
42
  }
39
43
  main().catch((err) => {
40
44
  console.error("Fatal error:", err);
package/dist/tools.js CHANGED
@@ -1,3 +1,5 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
1
3
  import { fetchApi, ApiError } from "./api.js";
2
4
  import { inspectRepoForMcpDependencies, } from "./repo.js";
3
5
  const WEBSITE_BASE = "https://www.agentscores.xyz";
@@ -224,6 +226,34 @@ function formatRepoSummary(repoPath, repoUrl, checkedFiles, results) {
224
226
  lines.push("", "Next step:", " Run generate_policy_gate_setup to get the exact GitHub Actions workflow for this repo.", ` Start a free pilot: ${buildIntentUrl("pilot", repoUrl)}`);
225
227
  return lines.join("\n");
226
228
  }
229
+ function buildOidcWorkflowYaml(packages) {
230
+ const lines = [
231
+ "name: AgentScore Policy Gate",
232
+ "",
233
+ "on:",
234
+ " pull_request:",
235
+ " push:",
236
+ " branches: [main]",
237
+ "",
238
+ "permissions:",
239
+ " id-token: write",
240
+ " contents: read",
241
+ "",
242
+ "jobs:",
243
+ " mcp-policy:",
244
+ " runs-on: ubuntu-latest",
245
+ " steps:",
246
+ " - uses: actions/checkout@v4",
247
+ " - uses: Thezenmonster/mcp-verdict-action@v1",
248
+ " with:",
249
+ ' fail-on: block',
250
+ ];
251
+ if (packages.length > 0) {
252
+ lines.push(` packages: "${packages.join(",")}"`);
253
+ }
254
+ lines.push("");
255
+ return lines.join("\n");
256
+ }
227
257
  function buildWorkflowYaml(packages) {
228
258
  const lines = [
229
259
  "name: AgentScore Policy Gate",
@@ -326,6 +356,35 @@ export async function handleTool(name, args) {
326
356
  const repoUrl = normaliseRepositoryUrl(repoUrlArg || repo.repoUrl);
327
357
  return text(formatPolicyGateSetup(repo.repoPath, repoUrl, repo.dependencies, repo.checkedFiles));
328
358
  }
359
+ case "install_policy_gate": {
360
+ const inputPath = typeof args.path === "string" ? args.path : undefined;
361
+ const repoUrlArg = typeof args.repo_url === "string" ? args.repo_url : undefined;
362
+ const repo = inspectRepoForMcpDependencies(inputPath);
363
+ const repoUrl = normaliseRepositoryUrl(repoUrlArg || repo.repoUrl);
364
+ const packages = repo.dependencies.map((d) => d.name);
365
+ const yaml = buildOidcWorkflowYaml(packages);
366
+ const workflowDir = path.join(repo.repoPath, ".github", "workflows");
367
+ const workflowPath = path.join(workflowDir, "agentscore-policy-gate.yml");
368
+ fs.mkdirSync(workflowDir, { recursive: true });
369
+ fs.writeFileSync(workflowPath, yaml, "utf8");
370
+ const pilotUrl = buildIntentUrl("pilot", repoUrl);
371
+ const lines = [
372
+ `Workflow written to: ${workflowPath}`,
373
+ "",
374
+ `Detected ${packages.length} MCP ${packages.length === 1 ? "dependency" : "dependencies"}: ${packages.join(", ") || "none"}`,
375
+ "",
376
+ "This workflow uses GitHub OIDC for authentication. No API key or secret needed.",
377
+ "On first push, AgentScore will auto-provision your repo and return verdicts.",
378
+ "",
379
+ "Next steps:",
380
+ " 1. Review the workflow file",
381
+ " 2. Commit and push",
382
+ " 3. The gate runs automatically on every PR and push to main",
383
+ "",
384
+ `If you want a managed pilot with custom thresholds and exceptions: ${pilotUrl}`,
385
+ ];
386
+ return text(lines.join("\n"));
387
+ }
329
388
  default:
330
389
  return text(`Unknown tool: ${name}`, true);
331
390
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@agentscore-xyz/mcp-server",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "mcpName": "io.github.Thezenmonster/agentscore",
5
- "description": "MCP security trust layer. Scan packages, inspect repo MCP dependencies, generate Policy Gate setup, check exposure, and query abuse data.",
5
+ "description": "MCP security trust layer. Scan packages, inspect repo MCP dependencies, generate Policy Gate setup, check exposure, and query abuse data.",
6
6
  "type": "module",
7
7
  "bin": {
8
8
  "agentscore-mcp": "./dist/index.js"
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Janus Compliance Limited
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.