@chainpatrol/mcp 1.10.1 → 1.10.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @chainpatrol/mcp
2
2
 
3
+ ## 1.10.2
4
+
5
+ ### Patch Changes
6
+
7
+ - aa164fd: Fixed the MCP handshake `instructions` to reflect the tools actually exposed
8
+ when a server is narrowed with `only` (the CLI's `--tools` flag, or a caller
9
+ like the web app's blocklist-only endpoint). Previously every server —
10
+ narrowed or not — advertised the full-API instructions and told the client to
11
+ call `user_orgs` first, even when `user_orgs` wasn't in the exposed tool set.
12
+ A client following that advice would hit "unknown tool" before ever reaching
13
+ the tool it wanted. Supporting work in `@chainpatrol/web` (a new
14
+ blocklist-only MCP route) is a private package and doesn't need a version
15
+ bump.
16
+ - adce1d5: The MCP server now reports its real version in the initialize handshake.
17
+
18
+ `PACKAGE_VERSION` was a hand-maintained literal that changesets does not
19
+ know about, so it went stale on every release: 1.10.1 shipped announcing
20
+ itself as `1.10.0`, the same drift #7804 had already corrected once. It is
21
+ now read from package.json and inlined by tsup at build time, so the
22
+ published server still does no filesystem lookup and the two cannot
23
+ disagree again.
24
+
3
25
  ## 1.10.1
4
26
 
5
27
  ### Patch Changes
@@ -622,7 +622,7 @@ var tools_default = {
622
622
  },
623
623
  source: {
624
624
  type: "string",
625
- description: "Detection source key, from `GET /detection/sources`. The source must support the `organization` scope; global-only sources cannot be configured per organization. One of 55 values, e.g. meta_ads_search, telegram_channels_search, telegram_user_search, telegram_channels_search_vetric, telegram_user_search_vetric, facebook_page_search_vetric, facebook_user_search_vetric, instagram_account_search_vetric. Full list: resource chainpatrol://enums/source"
625
+ description: "Detection source key, from `GET /detection/sources`. The source must support the `organization` scope; global-only sources cannot be configured per organization. One of 57 values, e.g. meta_ads_search, telegram_channels_search, telegram_user_search, telegram_channels_search_vetric, telegram_user_search_vetric, facebook_page_search_vetric, facebook_user_search_vetric, facebook_post_search_vetric. Full list: resource chainpatrol://enums/source"
626
626
  },
627
627
  status: {
628
628
  type: "string",
@@ -1023,7 +1023,7 @@ var tools_default = {
1023
1023
  },
1024
1024
  filters: {
1025
1025
  type: "array",
1026
- description: "Filters to apply to the results. Each clause filters on one property. Accepted values per property \u2014 `source`: One of 55 values, e.g. meta_ads_search, telegram_channels_search, telegram_user_search, telegram_channels_search_vetric, telegram_user_search_vetric, facebook_page_search_vetric, facebook_user_search_vetric, instagram_account_search_vetric. Full list: resource chainpatrol://enums/source; `confidence`: none, low, medium, high; `liveness`: UNKNOWN, ALIVE, DEAD; `watchlist`: ENABLED, DISABLED; `assetStatus`: UNKNOWN, ALLOWED, BLOCKED; `reported`: reported, not_reported; `assetType`: One of 92 values, e.g. URL, PAGE, ADDRESS, DISCORD, LINKEDIN, TWITTER, FACEBOOK, YOUTUBE. Full list: resource chainpatrol://enums/asset_type; `brand`: number values; `deleted`: string values; `countryCode`: string values.",
1026
+ description: "Filters to apply to the results. Each clause filters on one property. Accepted values per property \u2014 `source`: One of 57 values, e.g. meta_ads_search, telegram_channels_search, telegram_user_search, telegram_channels_search_vetric, telegram_user_search_vetric, facebook_page_search_vetric, facebook_user_search_vetric, facebook_post_search_vetric. Full list: resource chainpatrol://enums/source; `confidence`: none, low, medium, high; `liveness`: UNKNOWN, ALIVE, DEAD; `watchlist`: ENABLED, DISABLED; `assetStatus`: UNKNOWN, ALLOWED, BLOCKED; `reported`: reported, not_reported; `assetType`: One of 92 values, e.g. URL, PAGE, ADDRESS, DISCORD, LINKEDIN, TWITTER, FACEBOOK, YOUTUBE. Full list: resource chainpatrol://enums/asset_type; `brand`: number values; `deleted`: string values; `countryCode`: string values.",
1027
1027
  items: {
1028
1028
  type: "object",
1029
1029
  properties: {
@@ -3166,7 +3166,7 @@ var tools_default = {
3166
3166
  properties: {
3167
3167
  type: {
3168
3168
  type: "string",
3169
- description: "Enrichment type One of 39 values, e.g. content_and_metadata, browser_capture, ownership_and_registration, geolocation_and_ip, dns, tls, tcp, post. Full list: resource chainpatrol://enums/asset_scan_enrichment_type"
3169
+ description: "Enrichment type One of 40 values, e.g. content_and_metadata, browser_capture, ownership_and_registration, geolocation_and_ip, dns, tls, tcp, post. Full list: resource chainpatrol://enums/asset_scan_enrichment_type"
3170
3170
  },
3171
3171
  source: {
3172
3172
  type: "string",
@@ -3991,6 +3991,7 @@ var tools_default = {
3991
3991
  "linkedin_profile",
3992
3992
  "meta_ad",
3993
3993
  "google_ad",
3994
+ "adlibrary_ad",
3994
3995
  "contract_deployer"
3995
3996
  ],
3996
3997
  usedBy: [
@@ -4116,6 +4117,7 @@ var tools_default = {
4116
4117
  "telegram_user_search_vetric",
4117
4118
  "facebook_page_search_vetric",
4118
4119
  "facebook_user_search_vetric",
4120
+ "facebook_post_search_vetric",
4119
4121
  "instagram_account_search_vetric",
4120
4122
  "twitter_search_vetric",
4121
4123
  "linkedin_people_search_vetric",
@@ -4161,6 +4163,7 @@ var tools_default = {
4161
4163
  "linkedin_company_search",
4162
4164
  "bing_ads_search",
4163
4165
  "tik_tok_ads_search",
4166
+ "adlibrary_ads_search",
4164
4167
  "dnsdb",
4165
4168
  "daily_motion_search",
4166
4169
  "watchlist"
@@ -4221,6 +4224,17 @@ function toErrorResult(error) {
4221
4224
  content: [{ type: "text", text: message }]
4222
4225
  };
4223
4226
  }
4227
+ var RESOURCE_HINT = "Where a parameter's description points at a `chainpatrol://` resource, read it before guessing a value.";
4228
+ function buildInstructions(tools, isNarrowed) {
4229
+ if (!isNarrowed) {
4230
+ return "ChainPatrol threat intelligence and brand protection. Every public API capability is available here as a tool: checking and searching assets, reports, proposals, detections, takedowns, metrics, healthchecks and organization management.\n\nMost tools are scoped to one organization. Credentials can reach more than one, and there is no implicit default, so call `user_orgs` first and pass the slug explicitly.\n\n" + RESOURCE_HINT;
4231
+ }
4232
+ const names = tools.map((tool) => tool.name).sort().join(", ");
4233
+ const orgScoping = tools.some((tool) => tool.name === "user_orgs") ? "Most tools are scoped to one organization. Credentials can reach more than one, and there is no implicit default, so call `user_orgs` first and pass the slug explicitly.\n\n" : "These tools resolve their organization from the credential in use \u2014 there is no org slug to pass.\n\n";
4234
+ return `ChainPatrol threat intelligence. This server exposes a narrowed set of tools: ${names}.
4235
+
4236
+ ${orgScoping}${RESOURCE_HINT}`;
4237
+ }
4224
4238
  function createChainPatrolMcpServer(options) {
4225
4239
  const tools = selectTools(options.only);
4226
4240
  const resources = buildResources(manifest, tools);
@@ -4229,6 +4243,7 @@ function createChainPatrolMcpServer(options) {
4229
4243
  tools.map((tool) => tool.name)
4230
4244
  );
4231
4245
  const byName = new Map(tools.map((tool) => [tool.name, tool]));
4246
+ const isNarrowed = Boolean(options.only && options.only.length > 0);
4232
4247
  const server = new Server(
4233
4248
  {
4234
4249
  name: options.serverName ?? "chainpatrol",
@@ -4236,7 +4251,7 @@ function createChainPatrolMcpServer(options) {
4236
4251
  },
4237
4252
  {
4238
4253
  capabilities: { tools: {}, resources: {}, prompts: {} },
4239
- instructions: "ChainPatrol threat intelligence and brand protection. Every public API capability is available here as a tool: checking and searching assets, reports, proposals, detections, takedowns, metrics, healthchecks and organization management.\n\nMost tools are scoped to one organization. Credentials can reach more than one, and there is no implicit default, so call `user_orgs` first and pass the slug explicitly.\n\nWhere a parameter's description points at a `chainpatrol://` resource, read it before guessing a value."
4254
+ instructions: buildInstructions(tools, isNarrowed)
4240
4255
  }
4241
4256
  );
4242
4257
  server.setRequestHandler(ListToolsRequestSchema, () => ({
@@ -4449,8 +4464,73 @@ function toolsFromEnvironment(env = process.env) {
4449
4464
  return names.length > 0 ? names : void 0;
4450
4465
  }
4451
4466
 
4467
+ // package.json
4468
+ var package_default = {
4469
+ name: "@chainpatrol/mcp",
4470
+ description: "The official ChainPatrol MCP server \u2014 every public API capability as an MCP tool",
4471
+ author: "ChainPatrol <support@chainpatrol.io>",
4472
+ version: "1.10.2",
4473
+ license: "UNLICENSED",
4474
+ homepage: "https://chainpatrol.com/docs/mcp",
4475
+ keywords: [
4476
+ "chainpatrol",
4477
+ "mcp",
4478
+ "model-context-protocol",
4479
+ "agent"
4480
+ ],
4481
+ type: "module",
4482
+ exports: {
4483
+ ".": {
4484
+ types: "./dist/index.d.ts",
4485
+ import: "./dist/index.js"
4486
+ },
4487
+ "./config": {
4488
+ types: "./dist/chainpatrol-config.d.ts",
4489
+ import: "./dist/chainpatrol-config.js"
4490
+ }
4491
+ },
4492
+ bin: {
4493
+ "chainpatrol-mcp": "./dist/stdio-bin.js"
4494
+ },
4495
+ files: [
4496
+ "./dist/**"
4497
+ ],
4498
+ publishConfig: {
4499
+ access: "public",
4500
+ provenance: false
4501
+ },
4502
+ scripts: {
4503
+ build: "tsup",
4504
+ dev: "tsup --watch",
4505
+ "tools:generate": "tsx scripts/generate-tools.ts",
4506
+ "tools:check": "tsx scripts/generate-tools.ts --check",
4507
+ typecheck: "tsc --noEmit",
4508
+ test: "vitest run --config vitest.config.unit.ts",
4509
+ "lint:eslint": "eslint . --flag unstable_native_nodejs_ts_config --cache --cache-location .cache/.eslintcache",
4510
+ lint: "npx oxlint ."
4511
+ },
4512
+ dependencies: {
4513
+ "@modelcontextprotocol/sdk": "catalog:",
4514
+ luxon: "catalog:",
4515
+ zod: "catalog:"
4516
+ },
4517
+ devDependencies: {
4518
+ "@chainpatrol/eslint-config": "workspace:*",
4519
+ "@chainpatrol/external-trpc": "workspace:*",
4520
+ "@chainpatrol/tsconfig": "workspace:*",
4521
+ "@types/luxon": "catalog:",
4522
+ "@types/node": "catalog:",
4523
+ eslint: "catalog:",
4524
+ tsup: "^8.5.0",
4525
+ tsx: "catalog:",
4526
+ typescript: "catalog:",
4527
+ vitest: "catalog:",
4528
+ "zod-to-json-schema": "^3.24.5"
4529
+ }
4530
+ };
4531
+
4452
4532
  // src/version.ts
4453
- var PACKAGE_VERSION = "1.10.0";
4533
+ var PACKAGE_VERSION = package_default.version;
4454
4534
 
4455
4535
  export {
4456
4536
  PROMPTS,
@@ -4466,4 +4546,4 @@ export {
4466
4546
  toolsFromEnvironment,
4467
4547
  PACKAGE_VERSION
4468
4548
  };
4469
- //# sourceMappingURL=chunk-DXVC4YVX.js.map
4549
+ //# sourceMappingURL=chunk-JBDTADFL.js.map