@cyanheads/sanctions-screening-mcp-server 0.1.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.
Files changed (110) hide show
  1. package/AGENTS.md +452 -0
  2. package/CLAUDE.md +452 -0
  3. package/Dockerfile +126 -0
  4. package/LICENSE +201 -0
  5. package/README.md +354 -0
  6. package/changelog/0.1.x/0.1.0.md +26 -0
  7. package/changelog/template.md +127 -0
  8. package/dist/config/server-config.d.ts +37 -0
  9. package/dist/config/server-config.d.ts.map +1 -0
  10. package/dist/config/server-config.js +87 -0
  11. package/dist/config/server-config.js.map +1 -0
  12. package/dist/index.d.ts +11 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +70 -0
  15. package/dist/index.js.map +1 -0
  16. package/dist/mcp-server/prompts/definitions/index.d.ts +12 -0
  17. package/dist/mcp-server/prompts/definitions/index.d.ts.map +1 -0
  18. package/dist/mcp-server/prompts/definitions/index.js +9 -0
  19. package/dist/mcp-server/prompts/definitions/index.js.map +1 -0
  20. package/dist/mcp-server/prompts/definitions/vet-counterparty.prompt.d.ts +14 -0
  21. package/dist/mcp-server/prompts/definitions/vet-counterparty.prompt.d.ts.map +1 -0
  22. package/dist/mcp-server/prompts/definitions/vet-counterparty.prompt.js +42 -0
  23. package/dist/mcp-server/prompts/definitions/vet-counterparty.prompt.js.map +1 -0
  24. package/dist/mcp-server/resources/definitions/designation.resource.d.ts +25 -0
  25. package/dist/mcp-server/resources/definitions/designation.resource.d.ts.map +1 -0
  26. package/dist/mcp-server/resources/definitions/designation.resource.js +57 -0
  27. package/dist/mcp-server/resources/definitions/designation.resource.js.map +1 -0
  28. package/dist/mcp-server/resources/definitions/entity.resource.d.ts +17 -0
  29. package/dist/mcp-server/resources/definitions/entity.resource.d.ts.map +1 -0
  30. package/dist/mcp-server/resources/definitions/entity.resource.js +40 -0
  31. package/dist/mcp-server/resources/definitions/entity.resource.js.map +1 -0
  32. package/dist/mcp-server/resources/definitions/index.d.ts +32 -0
  33. package/dist/mcp-server/resources/definitions/index.d.ts.map +1 -0
  34. package/dist/mcp-server/resources/definitions/index.js +11 -0
  35. package/dist/mcp-server/resources/definitions/index.js.map +1 -0
  36. package/dist/mcp-server/resources/definitions/sources.resource.d.ts +9 -0
  37. package/dist/mcp-server/resources/definitions/sources.resource.d.ts.map +1 -0
  38. package/dist/mcp-server/resources/definitions/sources.resource.js +50 -0
  39. package/dist/mcp-server/resources/definitions/sources.resource.js.map +1 -0
  40. package/dist/mcp-server/tools/definitions/_shared.d.ts +13 -0
  41. package/dist/mcp-server/tools/definitions/_shared.d.ts.map +1 -0
  42. package/dist/mcp-server/tools/definitions/_shared.js +13 -0
  43. package/dist/mcp-server/tools/definitions/_shared.js.map +1 -0
  44. package/dist/mcp-server/tools/definitions/get-designation.tool.d.ts +78 -0
  45. package/dist/mcp-server/tools/definitions/get-designation.tool.d.ts.map +1 -0
  46. package/dist/mcp-server/tools/definitions/get-designation.tool.js +168 -0
  47. package/dist/mcp-server/tools/definitions/get-designation.tool.js.map +1 -0
  48. package/dist/mcp-server/tools/definitions/get-entity.tool.d.ts +55 -0
  49. package/dist/mcp-server/tools/definitions/get-entity.tool.d.ts.map +1 -0
  50. package/dist/mcp-server/tools/definitions/get-entity.tool.js +176 -0
  51. package/dist/mcp-server/tools/definitions/get-entity.tool.js.map +1 -0
  52. package/dist/mcp-server/tools/definitions/index.d.ts +306 -0
  53. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -0
  54. package/dist/mcp-server/tools/definitions/index.js +21 -0
  55. package/dist/mcp-server/tools/definitions/index.js.map +1 -0
  56. package/dist/mcp-server/tools/definitions/list-sources.tool.d.ts +23 -0
  57. package/dist/mcp-server/tools/definitions/list-sources.tool.d.ts.map +1 -0
  58. package/dist/mcp-server/tools/definitions/list-sources.tool.js +106 -0
  59. package/dist/mcp-server/tools/definitions/list-sources.tool.js.map +1 -0
  60. package/dist/mcp-server/tools/definitions/resolve-entity.tool.d.ts +51 -0
  61. package/dist/mcp-server/tools/definitions/resolve-entity.tool.d.ts.map +1 -0
  62. package/dist/mcp-server/tools/definitions/resolve-entity.tool.js +148 -0
  63. package/dist/mcp-server/tools/definitions/resolve-entity.tool.js.map +1 -0
  64. package/dist/mcp-server/tools/definitions/screen-name.tool.d.ts +82 -0
  65. package/dist/mcp-server/tools/definitions/screen-name.tool.d.ts.map +1 -0
  66. package/dist/mcp-server/tools/definitions/screen-name.tool.js +172 -0
  67. package/dist/mcp-server/tools/definitions/screen-name.tool.js.map +1 -0
  68. package/dist/mcp-server/tools/definitions/trace-ownership.tool.d.ts +74 -0
  69. package/dist/mcp-server/tools/definitions/trace-ownership.tool.d.ts.map +1 -0
  70. package/dist/mcp-server/tools/definitions/trace-ownership.tool.js +273 -0
  71. package/dist/mcp-server/tools/definitions/trace-ownership.tool.js.map +1 -0
  72. package/dist/services/screening/fixtures.d.ts +17 -0
  73. package/dist/services/screening/fixtures.d.ts.map +1 -0
  74. package/dist/services/screening/fixtures.js +162 -0
  75. package/dist/services/screening/fixtures.js.map +1 -0
  76. package/dist/services/screening/gleif-ingest.d.ts +68 -0
  77. package/dist/services/screening/gleif-ingest.d.ts.map +1 -0
  78. package/dist/services/screening/gleif-ingest.js +251 -0
  79. package/dist/services/screening/gleif-ingest.js.map +1 -0
  80. package/dist/services/screening/sanctions-ingest.d.ts +46 -0
  81. package/dist/services/screening/sanctions-ingest.d.ts.map +1 -0
  82. package/dist/services/screening/sanctions-ingest.js +688 -0
  83. package/dist/services/screening/sanctions-ingest.js.map +1 -0
  84. package/dist/services/screening/schema.d.ts +52 -0
  85. package/dist/services/screening/schema.d.ts.map +1 -0
  86. package/dist/services/screening/schema.js +125 -0
  87. package/dist/services/screening/schema.js.map +1 -0
  88. package/dist/services/screening/screening-service.d.ts +203 -0
  89. package/dist/services/screening/screening-service.d.ts.map +1 -0
  90. package/dist/services/screening/screening-service.js +702 -0
  91. package/dist/services/screening/screening-service.js.map +1 -0
  92. package/dist/services/screening/text-matching.d.ts +53 -0
  93. package/dist/services/screening/text-matching.d.ts.map +1 -0
  94. package/dist/services/screening/text-matching.js +514 -0
  95. package/dist/services/screening/text-matching.js.map +1 -0
  96. package/dist/services/screening/types.d.ts +154 -0
  97. package/dist/services/screening/types.d.ts.map +1 -0
  98. package/dist/services/screening/types.js +24 -0
  99. package/dist/services/screening/types.js.map +1 -0
  100. package/dist/services/screening/xml.d.ts +29 -0
  101. package/dist/services/screening/xml.d.ts.map +1 -0
  102. package/dist/services/screening/xml.js +46 -0
  103. package/dist/services/screening/xml.js.map +1 -0
  104. package/package.json +119 -0
  105. package/scripts/_mirror-context.ts +21 -0
  106. package/scripts/mirror-init.ts +66 -0
  107. package/scripts/mirror-refresh.ts +56 -0
  108. package/scripts/mirror-seed.ts +36 -0
  109. package/scripts/mirror-verify.ts +44 -0
  110. package/server.json +148 -0
@@ -0,0 +1,127 @@
1
+ ---
2
+ # FORMAT REFERENCE — do not edit. Copy this file to
3
+ # `changelog/<major.minor>.x/<version>.md` (e.g. `changelog/0.8.x/0.8.6.md`)
4
+ # to author a new release. Set that file's H1 to `# <version> — YYYY-MM-DD`
5
+ # with a concrete date.
6
+
7
+ # Required. One-line GitHub Release-style headline. 350 character cap.
8
+ # Default short and scannable. Don't pad, don't stitch unrelated changes with
9
+ # semicolons — pick the headline. Quotes required: unquoted YAML treats `: `
10
+ # inside the value as a key separator and fails GitHub's strict parser.
11
+ summary: ""
12
+
13
+ # Set `true` when consumers must change code to upgrade: API removals,
14
+ # signature changes, config renames, behavior changes that break existing
15
+ # usage. Flagged as `Breaking` in the rollup.
16
+ breaking: false
17
+
18
+ # Set `true` if this release contains any security fix. Pairs with the
19
+ # `## Security` section below. Flagged as `Security` in the rollup so
20
+ # users can triage upgrade urgency at a glance.
21
+ security: false
22
+
23
+ # Optional free-form notes for maintenance agents processing this release.
24
+ # Not rendered in CHANGELOG — consumed by agents running `maintenance` on
25
+ # downstream servers. Use for adoption instructions that don't fit the
26
+ # human-facing sections: new files to create, fields to populate, one-time
27
+ # migration steps. Omit the field entirely when there's nothing to say.
28
+ # agent-notes: |
29
+ # <instructions for downstream maintenance agents>
30
+ ---
31
+
32
+ # <version> — YYYY-MM-DD
33
+
34
+ <!--
35
+ AUTHORING GUIDE — applies to the new per-version file you create from this
36
+ template.
37
+
38
+ Audience: someone scanning release notes to decide what affects them. Lead
39
+ each bullet with the symbol or concept name in **bold** so they can skip
40
+ what's irrelevant and zoom in on what's not.
41
+
42
+ Tone: terse, fact-dense, not verbose. Default to one sentence per bullet —
43
+ name the symbol, state what changed, stop. Use a second sentence only when
44
+ it carries weight. If a bullet feels long, it is.
45
+
46
+ Cut: mechanism walkthroughs (those belong in JSDoc, CLAUDE.md/AGENTS.md, or the
47
+ relevant skill), ceremonial framings ("This release introduces…",
48
+ backwards-compat paragraphs), file-by-file test enumerations, internal
49
+ implementation notes. Prefer code/symbol names over English re-explanations.
50
+
51
+ Narrative intro: skip by default. Add one short sentence only when the
52
+ release theme genuinely needs framing the bullets can't carry.
53
+
54
+ Sections: Keep a Changelog order — Added, Changed, Deprecated, Removed,
55
+ Fixed, Security. Include only sections with entries; delete the rest
56
+ (including the commented-out scaffolding below). Don't ship empty headers.
57
+
58
+ Include: every distinct fact a reader needs to adopt or audit the release —
59
+ new exports, signatures, lint rule IDs, env vars, breaking changes, version
60
+ bumps on shipped skills. Nothing more.
61
+
62
+ Links: link issues, PRs, docs, or skills where they help a reader jump to
63
+ context. Once per item per entry — don't re-link the same issue in summary,
64
+ narrative, and bullet. Skip links for inline symbol names; code spans speak
65
+ for themselves.
66
+
67
+ Issue/PR URLs: use full URLs. GitHub's bare `#NN` auto-link only resolves
68
+ inside its own UI, not in npm reads or local editors.
69
+
70
+ [#38](https://github.com/cyanheads/mcp-ts-core/issues/38) ← issue
71
+ [#42](https://github.com/cyanheads/mcp-ts-core/pull/42) ← PR
72
+
73
+ Verify numbers exist before linking (`gh issue view NN`, `gh pr view NN`).
74
+ Never speculate on a future number — `#42` for an upcoming PR silently
75
+ resolves to whatever real item already owns 42, and timeline previews pull
76
+ in that unrelated item's metadata.
77
+
78
+ TAG ANNOTATIONS — the annotated tag body renders as the GitHub Release body
79
+ via `gh release create --notes-from-tag`. The tag is a derivative of this
80
+ changelog entry — a condensed, scannable version, not a copy. Format:
81
+
82
+ <theme — omit version number, GitHub prepends it>
83
+ ← blank line
84
+ <1-2 sentence context: what this release does>
85
+ ← blank line
86
+ Dependency bumps: ← section header
87
+ ← blank line
88
+ - `@cyanheads/mcp-ts-core` ^0.9.1 → ^0.9.6 ← bullet
89
+ ← blank line
90
+ Changed: ← only sections with entries
91
+ ← blank line
92
+ - `format()` output includes `query` in text mode
93
+ ← blank line
94
+ Added:
95
+ ← blank line
96
+ - `manifest.json` scaffolded for MCPB bundle support
97
+ - Install badges (Claude Desktop, Cursor, VS Code)
98
+ ← blank line
99
+ <N> tests pass; `bun run devcheck` clean. ← footer
100
+
101
+ Never a flat comma-separated string. Always structured markdown with
102
+ sections. The tag must scan well as a rendered GitHub Release page.
103
+ -->
104
+
105
+ ## Added
106
+
107
+ -
108
+
109
+ ## Changed
110
+
111
+ -
112
+
113
+ <!-- ## Deprecated
114
+
115
+ - -->
116
+
117
+ <!-- ## Removed
118
+
119
+ - -->
120
+
121
+ ## Fixed
122
+
123
+ -
124
+
125
+ <!-- ## Security
126
+
127
+ - -->
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @fileoverview Server-specific environment configuration for
3
+ * sanctions-screening-mcp-server. Holds the local mirror path, fuzzy-match
4
+ * tuning, the refresh cron, and per-source URL overrides. All sources are
5
+ * keyless — the EU "token" is a static public path component, not a credential
6
+ * — so no secret values live here.
7
+ * @module config/server-config
8
+ */
9
+ import { z } from '@cyanheads/mcp-ts-core';
10
+ /** Default upstream source endpoints, all verified official paths (see docs/design.md). */
11
+ export declare const DEFAULT_SOURCE_URLS: {
12
+ readonly ofacSdn: "https://sanctionslistservice.ofac.treas.gov/api/PublicationPreview/exports/SDN_ADVANCED.XML";
13
+ readonly ofacConsolidated: "https://sanctionslistservice.ofac.treas.gov/api/PublicationPreview/exports/CONS_ADVANCED.XML";
14
+ readonly euFsf: "https://webgate.ec.europa.eu/fsd/fsf/public/files/xmlFullSanctionsList_1_1/content?token=dG9rZW4tMjAxNw";
15
+ readonly ukSanctions: "https://sanctionslist.fcdo.gov.uk/docs/UK-Sanctions-List.xml";
16
+ readonly unSc: "https://scsanctions.un.org/resources/xml/en/consolidated.xml";
17
+ readonly gleifGoldenCopyBase: "https://goldencopy.gleif.org";
18
+ };
19
+ declare const ServerConfigSchema: z.ZodObject<{
20
+ mirrorPath: z.ZodDefault<z.ZodString>;
21
+ refreshCron: z.ZodDefault<z.ZodString>;
22
+ fuzzyMinScore: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
23
+ fuzzyMaxResults: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
24
+ ofacSdnUrl: z.ZodDefault<z.ZodString>;
25
+ ofacConsolidatedUrl: z.ZodDefault<z.ZodString>;
26
+ euFsfUrl: z.ZodDefault<z.ZodString>;
27
+ ukSanctionsUrl: z.ZodDefault<z.ZodString>;
28
+ unScUrl: z.ZodDefault<z.ZodString>;
29
+ gleifGoldenCopyBaseUrl: z.ZodDefault<z.ZodString>;
30
+ }, z.core.$strip>;
31
+ export type ServerConfig = z.infer<typeof ServerConfigSchema>;
32
+ /** Lazily parse and memoize the server config. */
33
+ export declare function getServerConfig(): ServerConfig;
34
+ /** Reset memoized config — test isolation only. */
35
+ export declare function resetServerConfig(): void;
36
+ export {};
37
+ //# sourceMappingURL=server-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-config.d.ts","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAG3C,2FAA2F;AAC3F,eAAO,MAAM,mBAAmB;;;;;;;CAUtB,CAAC;AAEX,QAAA,MAAM,kBAAkB;;;;;;;;;;;iBA6CtB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D,kDAAkD;AAClD,wBAAgB,eAAe,IAAI,YAAY,CAc9C;AAED,mDAAmD;AACnD,wBAAgB,iBAAiB,IAAI,IAAI,CAExC"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * @fileoverview Server-specific environment configuration for
3
+ * sanctions-screening-mcp-server. Holds the local mirror path, fuzzy-match
4
+ * tuning, the refresh cron, and per-source URL overrides. All sources are
5
+ * keyless — the EU "token" is a static public path component, not a credential
6
+ * — so no secret values live here.
7
+ * @module config/server-config
8
+ */
9
+ import { z } from '@cyanheads/mcp-ts-core';
10
+ import { parseEnvConfig } from '@cyanheads/mcp-ts-core/config';
11
+ /** Default upstream source endpoints, all verified official paths (see docs/design.md). */
12
+ export const DEFAULT_SOURCE_URLS = {
13
+ ofacSdn: 'https://sanctionslistservice.ofac.treas.gov/api/PublicationPreview/exports/SDN_ADVANCED.XML',
14
+ ofacConsolidated: 'https://sanctionslistservice.ofac.treas.gov/api/PublicationPreview/exports/CONS_ADVANCED.XML',
15
+ euFsf: 'https://webgate.ec.europa.eu/fsd/fsf/public/files/xmlFullSanctionsList_1_1/content?token=dG9rZW4tMjAxNw',
16
+ ukSanctions: 'https://sanctionslist.fcdo.gov.uk/docs/UK-Sanctions-List.xml',
17
+ unSc: 'https://scsanctions.un.org/resources/xml/en/consolidated.xml',
18
+ gleifGoldenCopyBase: 'https://goldencopy.gleif.org',
19
+ };
20
+ const ServerConfigSchema = z.object({
21
+ mirrorPath: z
22
+ .string()
23
+ .default('./data/sanctions.db')
24
+ .describe('Filesystem path for the SQLite mirror; a persistent volume on a hosted deployment.'),
25
+ refreshCron: z
26
+ .string()
27
+ .default('0 4 * * *')
28
+ .describe('Cron for the scheduled refresh of sanctions lists + GLEIF deltas (HTTP only).'),
29
+ fuzzyMinScore: z.coerce
30
+ .number()
31
+ .min(0)
32
+ .max(1)
33
+ .default(0.85)
34
+ .describe('Default Jaro-Winkler similarity floor for fuzzy matches when min_score is omitted.'),
35
+ fuzzyMaxResults: z.coerce
36
+ .number()
37
+ .int()
38
+ .min(1)
39
+ .default(50)
40
+ .describe('Hard cap on fuzzy candidates scored per query, to bound work on short queries.'),
41
+ ofacSdnUrl: z
42
+ .string()
43
+ .default(DEFAULT_SOURCE_URLS.ofacSdn)
44
+ .describe('OFAC SDN advanced-XML URL.'),
45
+ ofacConsolidatedUrl: z
46
+ .string()
47
+ .default(DEFAULT_SOURCE_URLS.ofacConsolidated)
48
+ .describe('OFAC Consolidated advanced-XML URL.'),
49
+ euFsfUrl: z
50
+ .string()
51
+ .default(DEFAULT_SOURCE_URLS.euFsf)
52
+ .describe('EU consolidated XML URL (includes the static public token path component).'),
53
+ ukSanctionsUrl: z
54
+ .string()
55
+ .default(DEFAULT_SOURCE_URLS.ukSanctions)
56
+ .describe('UK Sanctions List (UKSL) XML URL.'),
57
+ unScUrl: z
58
+ .string()
59
+ .default(DEFAULT_SOURCE_URLS.unSc)
60
+ .describe('UN Security Council consolidated XML URL.'),
61
+ gleifGoldenCopyBaseUrl: z
62
+ .string()
63
+ .default(DEFAULT_SOURCE_URLS.gleifGoldenCopyBase)
64
+ .describe('Base URL for the GLEIF golden-copy / delta download API.'),
65
+ });
66
+ let _config;
67
+ /** Lazily parse and memoize the server config. */
68
+ export function getServerConfig() {
69
+ _config ??= parseEnvConfig(ServerConfigSchema, {
70
+ mirrorPath: 'SANCTIONS_MIRROR_PATH',
71
+ refreshCron: 'SANCTIONS_REFRESH_CRON',
72
+ fuzzyMinScore: 'SANCTIONS_FUZZY_MIN_SCORE',
73
+ fuzzyMaxResults: 'SANCTIONS_FUZZY_MAX_RESULTS',
74
+ ofacSdnUrl: 'OFAC_SDN_URL',
75
+ ofacConsolidatedUrl: 'OFAC_CONSOLIDATED_URL',
76
+ euFsfUrl: 'EU_FSF_URL',
77
+ ukSanctionsUrl: 'UK_SANCTIONS_URL',
78
+ unScUrl: 'UN_SC_URL',
79
+ gleifGoldenCopyBaseUrl: 'GLEIF_GOLDEN_COPY_BASE_URL',
80
+ });
81
+ return _config;
82
+ }
83
+ /** Reset memoized config — test isolation only. */
84
+ export function resetServerConfig() {
85
+ _config = undefined;
86
+ }
87
+ //# sourceMappingURL=server-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-config.js","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,2FAA2F;AAC3F,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,OAAO,EACL,6FAA6F;IAC/F,gBAAgB,EACd,8FAA8F;IAChG,KAAK,EACH,yGAAyG;IAC3G,WAAW,EAAE,8DAA8D;IAC3E,IAAI,EAAE,8DAA8D;IACpE,mBAAmB,EAAE,8BAA8B;CAC3C,CAAC;AAEX,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,OAAO,CAAC,qBAAqB,CAAC;SAC9B,QAAQ,CAAC,oFAAoF,CAAC;IACjG,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,OAAO,CAAC,WAAW,CAAC;SACpB,QAAQ,CAAC,+EAA+E,CAAC;IAC5F,aAAa,EAAE,CAAC,CAAC,MAAM;SACpB,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,CAAC,CAAC;SACN,OAAO,CAAC,IAAI,CAAC;SACb,QAAQ,CAAC,oFAAoF,CAAC;IACjG,eAAe,EAAE,CAAC,CAAC,MAAM;SACtB,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,OAAO,CAAC,EAAE,CAAC;SACX,QAAQ,CAAC,gFAAgF,CAAC;IAC7F,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,OAAO,CAAC,mBAAmB,CAAC,OAAO,CAAC;SACpC,QAAQ,CAAC,4BAA4B,CAAC;IACzC,mBAAmB,EAAE,CAAC;SACnB,MAAM,EAAE;SACR,OAAO,CAAC,mBAAmB,CAAC,gBAAgB,CAAC;SAC7C,QAAQ,CAAC,qCAAqC,CAAC;IAClD,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,OAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC;SAClC,QAAQ,CAAC,4EAA4E,CAAC;IACzF,cAAc,EAAE,CAAC;SACd,MAAM,EAAE;SACR,OAAO,CAAC,mBAAmB,CAAC,WAAW,CAAC;SACxC,QAAQ,CAAC,mCAAmC,CAAC;IAChD,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC;SACjC,QAAQ,CAAC,2CAA2C,CAAC;IACxD,sBAAsB,EAAE,CAAC;SACtB,MAAM,EAAE;SACR,OAAO,CAAC,mBAAmB,CAAC,mBAAmB,CAAC;SAChD,QAAQ,CAAC,0DAA0D,CAAC;CACxE,CAAC,CAAC;AAIH,IAAI,OAAiC,CAAC;AAEtC,kDAAkD;AAClD,MAAM,UAAU,eAAe;IAC7B,OAAO,KAAK,cAAc,CAAC,kBAAkB,EAAE;QAC7C,UAAU,EAAE,uBAAuB;QACnC,WAAW,EAAE,wBAAwB;QACrC,aAAa,EAAE,2BAA2B;QAC1C,eAAe,EAAE,6BAA6B;QAC9C,UAAU,EAAE,cAAc;QAC1B,mBAAmB,EAAE,uBAAuB;QAC5C,QAAQ,EAAE,YAAY;QACtB,cAAc,EAAE,kBAAkB;QAClC,OAAO,EAAE,WAAW;QACpB,sBAAsB,EAAE,4BAA4B;KACrD,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,iBAAiB;IAC/B,OAAO,GAAG,SAAS,CAAC;AACtB,CAAC"}
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @fileoverview sanctions-screening-mcp-server MCP server entry point. Wires the
4
+ * screening service (which owns the local SQLite + FTS5 mirrors), registers the
5
+ * six screening/resolution tools, three URI resources, and the counterparty
6
+ * vetting prompt, and schedules the mirror refresh on HTTP deployments. The
7
+ * full-corpus mirror init runs out-of-band via `bun run mirror:init`.
8
+ * @module index
9
+ */
10
+ export {};
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG"}
package/dist/index.js ADDED
@@ -0,0 +1,70 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @fileoverview sanctions-screening-mcp-server MCP server entry point. Wires the
4
+ * screening service (which owns the local SQLite + FTS5 mirrors), registers the
5
+ * six screening/resolution tools, three URI resources, and the counterparty
6
+ * vetting prompt, and schedules the mirror refresh on HTTP deployments. The
7
+ * full-corpus mirror init runs out-of-band via `bun run mirror:init`.
8
+ * @module index
9
+ */
10
+ import { createApp } from '@cyanheads/mcp-ts-core';
11
+ import { config } from '@cyanheads/mcp-ts-core/config';
12
+ import { logger, requestContextService, schedulerService } from '@cyanheads/mcp-ts-core/utils';
13
+ import { getServerConfig } from './config/server-config.js';
14
+ import { allPromptDefinitions } from './mcp-server/prompts/definitions/index.js';
15
+ import { allResourceDefinitions } from './mcp-server/resources/definitions/index.js';
16
+ import { allToolDefinitions } from './mcp-server/tools/definitions/index.js';
17
+ import { getScreeningService, initScreeningService, } from './services/screening/screening-service.js';
18
+ await createApp({
19
+ name: 'sanctions-screening-mcp-server',
20
+ title: 'sanctions-screening-mcp-server',
21
+ tools: allToolDefinitions,
22
+ resources: allResourceDefinitions,
23
+ prompts: allPromptDefinitions,
24
+ instructions: 'Screen names against the consolidated OFAC, EU, UK, and UN sanctions lists and resolve legal entities against GLEIF, all fuzzy-matched offline over a local mirror. Start with sanctions_screen_name for "is this entity on a watchlist"; sanctions_resolve_entity → sanctions_get_entity → sanctions_trace_ownership for "who is this legal entity and who owns it." Every result is a screening AID, not a compliance determination — a hit is a candidate to verify against the official source, and an empty result is never a clearance. Check sanctions_list_sources for which lists are loaded and how fresh the mirror is.',
25
+ landing: {
26
+ requireAuth: false,
27
+ tagline: 'Screen names against OFAC, EU, UK, and UN sanctions lists and resolve legal entities against GLEIF — offline, fuzzy-matched. A screening aid, not a compliance determination.',
28
+ links: [
29
+ {
30
+ label: 'OFAC Sanctions List Service',
31
+ href: 'https://sanctionslistservice.ofac.treas.gov/',
32
+ external: true,
33
+ },
34
+ { label: 'UK Sanctions List', href: 'https://sanctionslist.fcdo.gov.uk/', external: true },
35
+ {
36
+ label: 'UN SC Consolidated List',
37
+ href: 'https://main.un.org/securitycouncil/en/content/un-sc-consolidated-list',
38
+ external: true,
39
+ },
40
+ { label: 'GLEIF', href: 'https://www.gleif.org/', external: true },
41
+ ],
42
+ },
43
+ setup() {
44
+ initScreeningService();
45
+ scheduleRefresh();
46
+ },
47
+ });
48
+ /**
49
+ * Schedule the daily mirror refresh on HTTP deployments only. stdio operators
50
+ * run refresh out-of-band via `bun run mirror:refresh`, so a cron there would be
51
+ * redundant and could collide with a manual run.
52
+ */
53
+ function scheduleRefresh() {
54
+ if (config.mcpTransportType !== 'http')
55
+ return;
56
+ const { refreshCron } = getServerConfig();
57
+ void schedulerService
58
+ .schedule('sanctions-mirror-refresh', refreshCron, async (ctx) => {
59
+ const svc = getScreeningService();
60
+ logger.info('Starting scheduled sanctions mirror refresh', ctx);
61
+ await svc.designations.runSync({ mode: 'refresh' });
62
+ await svc.rebuildNameIndex();
63
+ logger.info('Scheduled sanctions mirror refresh complete', ctx);
64
+ }, 'Refreshes the sanctions watchlists from their upstream sources.')
65
+ .then(() => schedulerService.start('sanctions-mirror-refresh'))
66
+ .catch((err) => {
67
+ logger.error('Failed to schedule sanctions mirror refresh', err, requestContextService.createRequestContext({ operation: 'scheduleRefresh' }));
68
+ });
69
+ }
70
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EACL,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,2CAA2C,CAAC;AAEnD,MAAM,SAAS,CAAC;IACd,IAAI,EAAE,gCAAgC;IACtC,KAAK,EAAE,gCAAgC;IACvC,KAAK,EAAE,kBAAkB;IACzB,SAAS,EAAE,sBAAsB;IACjC,OAAO,EAAE,oBAAoB;IAC7B,YAAY,EACV,omBAAomB;IACtmB,OAAO,EAAE;QACP,WAAW,EAAE,KAAK;QAClB,OAAO,EACL,+KAA+K;QACjL,KAAK,EAAE;YACL;gBACE,KAAK,EAAE,6BAA6B;gBACpC,IAAI,EAAE,8CAA8C;gBACpD,QAAQ,EAAE,IAAI;aACf;YACD,EAAE,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,oCAAoC,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC1F;gBACE,KAAK,EAAE,yBAAyB;gBAChC,IAAI,EAAE,wEAAwE;gBAC9E,QAAQ,EAAE,IAAI;aACf;YACD,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,wBAAwB,EAAE,QAAQ,EAAE,IAAI,EAAE;SACnE;KACF;IACD,KAAK;QACH,oBAAoB,EAAE,CAAC;QACvB,eAAe,EAAE,CAAC;IACpB,CAAC;CACF,CAAC,CAAC;AAEH;;;;GAIG;AACH,SAAS,eAAe;IACtB,IAAI,MAAM,CAAC,gBAAgB,KAAK,MAAM;QAAE,OAAO;IAC/C,MAAM,EAAE,WAAW,EAAE,GAAG,eAAe,EAAE,CAAC;IAC1C,KAAK,gBAAgB;SAClB,QAAQ,CACP,0BAA0B,EAC1B,WAAW,EACX,KAAK,EAAE,GAAG,EAAE,EAAE;QACZ,MAAM,GAAG,GAAG,mBAAmB,EAAE,CAAC;QAClC,MAAM,CAAC,IAAI,CAAC,6CAA6C,EAAE,GAAG,CAAC,CAAC;QAChE,MAAM,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;QACpD,MAAM,GAAG,CAAC,gBAAgB,EAAE,CAAC;QAC7B,MAAM,CAAC,IAAI,CAAC,6CAA6C,EAAE,GAAG,CAAC,CAAC;IAClE,CAAC,EACD,iEAAiE,CAClE;SACA,IAAI,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;SAC9D,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACb,MAAM,CAAC,KAAK,CACV,6CAA6C,EAC7C,GAAY,EACZ,qBAAqB,CAAC,oBAAoB,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC,CAC7E,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @fileoverview Barrel collecting all prompt definitions into
3
+ * `allPromptDefinitions` for `createApp()`.
4
+ * @module mcp-server/prompts/definitions/index
5
+ */
6
+ import { vetCounterpartyPrompt } from './vet-counterparty.prompt.js';
7
+ export declare const allPromptDefinitions: import("@cyanheads/mcp-ts-core").PromptDefinition<import("zod").ZodObject<{
8
+ name: import("zod").ZodString;
9
+ jurisdiction: import("zod").ZodOptional<import("zod").ZodString>;
10
+ }, import("zod/v4/core").$strip>>[];
11
+ export { vetCounterpartyPrompt };
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,eAAO,MAAM,oBAAoB;;;mCAA0B,CAAC;AAE5D,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @fileoverview Barrel collecting all prompt definitions into
3
+ * `allPromptDefinitions` for `createApp()`.
4
+ * @module mcp-server/prompts/definitions/index
5
+ */
6
+ import { vetCounterpartyPrompt } from './vet-counterparty.prompt.js';
7
+ export const allPromptDefinitions = [vetCounterpartyPrompt];
8
+ export { vetCounterpartyPrompt };
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,qBAAqB,CAAC,CAAC;AAE5D,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @fileoverview `sanctions_vet_counterparty` — frames the full counterparty
3
+ * due-diligence workflow over the existing tools: resolve the name to an LEI,
4
+ * pull the ownership tree, screen the named entity and every beneficial owner
5
+ * against all lists, and summarize hits with provenance and the decision-support
6
+ * caveat. No new capability — a reusable framing of the cross-tool workflow.
7
+ * @module mcp-server/prompts/definitions/vet-counterparty.prompt
8
+ */
9
+ import { z } from '@cyanheads/mcp-ts-core';
10
+ export declare const vetCounterpartyPrompt: import("@cyanheads/mcp-ts-core").PromptDefinition<z.ZodObject<{
11
+ name: z.ZodString;
12
+ jurisdiction: z.ZodOptional<z.ZodString>;
13
+ }, z.core.$strip>>;
14
+ //# sourceMappingURL=vet-counterparty.prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vet-counterparty.prompt.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/vet-counterparty.prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAU,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEnD,eAAO,MAAM,qBAAqB;;;kBAiChC,CAAC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @fileoverview `sanctions_vet_counterparty` — frames the full counterparty
3
+ * due-diligence workflow over the existing tools: resolve the name to an LEI,
4
+ * pull the ownership tree, screen the named entity and every beneficial owner
5
+ * against all lists, and summarize hits with provenance and the decision-support
6
+ * caveat. No new capability — a reusable framing of the cross-tool workflow.
7
+ * @module mcp-server/prompts/definitions/vet-counterparty.prompt
8
+ */
9
+ import { prompt, z } from '@cyanheads/mcp-ts-core';
10
+ export const vetCounterpartyPrompt = prompt('sanctions_vet_counterparty', {
11
+ title: 'sanctions-screening-mcp-server: vet counterparty',
12
+ description: 'Structure a full counterparty due-diligence pass: resolve the name to an LEI, pull the ownership tree, screen the named entity and every beneficial owner against all sanctions lists, and summarize hits with provenance and the decision-support caveat.',
13
+ args: z.object({
14
+ name: z.string().describe('The counterparty name to vet (person or organization).'),
15
+ jurisdiction: z
16
+ .string()
17
+ .optional()
18
+ .describe('Optional ISO 3166-1 alpha-2 jurisdiction to disambiguate the entity (e.g. "US").'),
19
+ }),
20
+ generate: (args) => {
21
+ const jurisdictionClause = args.jurisdiction
22
+ ? ` The entity is based in or registered in ${args.jurisdiction}; pass that as the jurisdiction filter when resolving.`
23
+ : '';
24
+ return [
25
+ {
26
+ role: 'user',
27
+ content: {
28
+ type: 'text',
29
+ text: `Run a counterparty due-diligence pass on "${args.name}".${jurisdictionClause}\n\n` +
30
+ 'Follow this workflow with the sanctions-screening tools, then summarize:\n\n' +
31
+ `1. Screen the name directly with sanctions_screen_name (matchMode "strict"; if it returns nothing, retry with matchMode "fuzzy").\n` +
32
+ `2. Resolve "${args.name}" to a GLEIF LEI with sanctions_resolve_entity. If there are multiple candidates, pick the best match and note the alternatives.\n` +
33
+ '3. If an LEI is found, call sanctions_trace_ownership on it with screen_nodes set to true and direction "both" — this screens every parent and subsidiary (the beneficial owners) against all watchlists.\n' +
34
+ '4. For any potential match surfaced in steps 1–3, call sanctions_get_designation to pull the full record (aliases, identifiers, program, designation date) so it can be verified.\n\n' +
35
+ 'Then write a summary that, for each potential match, names the entity, the source list and program, the match type and score, and the exact name that matched. Group by the entity in the ownership chain that was flagged.\n\n' +
36
+ 'Critically: present every result as a POTENTIAL MATCH TO VERIFY against the official source, never as a determination. State explicitly that this is a screening aid, not sanctions-compliance certification, and that an absence of matches is NOT a clearance — it only means nothing matched the names the mirror indexes as of its last refresh. Call sanctions_list_sources if the freshness of the data matters to the conclusion.',
37
+ },
38
+ },
39
+ ];
40
+ },
41
+ });
42
+ //# sourceMappingURL=vet-counterparty.prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vet-counterparty.prompt.js","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/vet-counterparty.prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,4BAA4B,EAAE;IACxE,KAAK,EAAE,kDAAkD;IACzD,WAAW,EACT,4PAA4P;IAC9P,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;QACb,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wDAAwD,CAAC;QACnF,YAAY,EAAE,CAAC;aACZ,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,kFAAkF,CAAC;KAChG,CAAC;IACF,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;QACjB,MAAM,kBAAkB,GAAG,IAAI,CAAC,YAAY;YAC1C,CAAC,CAAC,4CAA4C,IAAI,CAAC,YAAY,wDAAwD;YACvH,CAAC,CAAC,EAAE,CAAC;QACP,OAAO;YACL;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EACF,6CAA6C,IAAI,CAAC,IAAI,KAAK,kBAAkB,MAAM;wBACnF,8EAA8E;wBAC9E,qIAAqI;wBACrI,eAAe,IAAI,CAAC,IAAI,oIAAoI;wBAC5J,6MAA6M;wBAC7M,uLAAuL;wBACvL,iOAAiO;wBACjO,0aAA0a;iBAC7a;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @fileoverview `sanctions://designation/{source}/{entryId}` — read-only mirror
3
+ * of sanctions_get_designation for clients that inject context by URI. All data
4
+ * here is reachable via the tool, which is the primary path for tool-only
5
+ * clients.
6
+ * @module mcp-server/resources/definitions/designation.resource
7
+ */
8
+ import { z } from '@cyanheads/mcp-ts-core';
9
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
10
+ export declare const designationResource: import("@cyanheads/mcp-ts-core").ResourceDefinition<z.ZodObject<{
11
+ source: z.ZodEnum<{
12
+ ofac_sdn: "ofac_sdn";
13
+ ofac_consolidated: "ofac_consolidated";
14
+ eu: "eu";
15
+ uk: "uk";
16
+ un: "un";
17
+ }>;
18
+ entryId: z.ZodString;
19
+ }, z.core.$strip>, undefined, readonly [{
20
+ readonly reason: "designation_not_found";
21
+ readonly code: JsonRpcErrorCode.NotFound;
22
+ readonly when: "No designation exists for the given source + entry ID in the mirror.";
23
+ readonly recovery: "Use sanctions_screen_name to discover valid source/entryId pairs first.";
24
+ }]>;
25
+ //# sourceMappingURL=designation.resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"designation.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/designation.resource.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAKjE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;GAiD9B,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * @fileoverview `sanctions://designation/{source}/{entryId}` — read-only mirror
3
+ * of sanctions_get_designation for clients that inject context by URI. All data
4
+ * here is reachable via the tool, which is the primary path for tool-only
5
+ * clients.
6
+ * @module mcp-server/resources/definitions/designation.resource
7
+ */
8
+ import { resource, z } from '@cyanheads/mcp-ts-core';
9
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
10
+ import { SCREENING_CAVEAT } from '../../../mcp-server/tools/definitions/_shared.js';
11
+ import { getScreeningService } from '../../../services/screening/screening-service.js';
12
+ import { SOURCE_LABELS } from '../../../services/screening/types.js';
13
+ export const designationResource = resource('sanctions://designation/{source}/{entryId}', {
14
+ name: 'sanctions-screening-mcp-server: designation',
15
+ title: 'sanctions-screening-mcp-server: designation',
16
+ description: 'Fetch one sanctions designation by source list + entry ID — a read-only URI mirror of sanctions_get_designation. The record is what the source published; a screening aid, not a determination.',
17
+ mimeType: 'application/json',
18
+ params: z.object({
19
+ source: z
20
+ .enum(['ofac_sdn', 'ofac_consolidated', 'eu', 'uk', 'un'])
21
+ .describe('Source list the entry belongs to.'),
22
+ entryId: z.string().min(1).describe("The source list's own entry ID."),
23
+ }),
24
+ errors: [
25
+ {
26
+ reason: 'designation_not_found',
27
+ code: JsonRpcErrorCode.NotFound,
28
+ when: 'No designation exists for the given source + entry ID in the mirror.',
29
+ recovery: 'Use sanctions_screen_name to discover valid source/entryId pairs first.',
30
+ },
31
+ ],
32
+ async handler(params, ctx) {
33
+ const svc = getScreeningService();
34
+ const d = await svc.getDesignation(params.source, params.entryId);
35
+ if (!d) {
36
+ throw ctx.fail('designation_not_found', `No ${params.source} designation with entry ID "${params.entryId}".`, { ...ctx.recoveryFor('designation_not_found') });
37
+ }
38
+ return {
39
+ source: d.source,
40
+ sourceLabel: SOURCE_LABELS[d.source],
41
+ sourceEntryId: d.sourceEntryId,
42
+ entityType: d.entityType,
43
+ primaryName: d.primaryName,
44
+ program: d.program,
45
+ legalBasis: d.legalBasis,
46
+ designationDate: d.designationDate,
47
+ aliases: d.payload.aliases,
48
+ identifiers: d.payload.identifiers,
49
+ addresses: d.payload.addresses,
50
+ datesOfBirth: d.payload.datesOfBirth,
51
+ nationalities: d.payload.nationalities,
52
+ remarks: d.payload.remarks,
53
+ caveat: SCREENING_CAVEAT,
54
+ };
55
+ },
56
+ });
57
+ //# sourceMappingURL=designation.resource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"designation.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/designation.resource.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,aAAa,EAAmB,MAAM,+BAA+B,CAAC;AAE/E,MAAM,CAAC,MAAM,mBAAmB,GAAG,QAAQ,CAAC,4CAA4C,EAAE;IACxF,IAAI,EAAE,6CAA6C;IACnD,KAAK,EAAE,6CAA6C;IACpD,WAAW,EACT,iMAAiM;IACnM,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,MAAM,EAAE,CAAC;aACN,IAAI,CAAC,CAAC,UAAU,EAAE,mBAAmB,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;aACzD,QAAQ,CAAC,mCAAmC,CAAC;QAChD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,iCAAiC,CAAC;KACvE,CAAC;IACF,MAAM,EAAE;QACN;YACE,MAAM,EAAE,uBAAuB;YAC/B,IAAI,EAAE,gBAAgB,CAAC,QAAQ;YAC/B,IAAI,EAAE,sEAAsE;YAC5E,QAAQ,EAAE,yEAAyE;SACpF;KACF;IAED,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG;QACvB,MAAM,GAAG,GAAG,mBAAmB,EAAE,CAAC;QAClC,MAAM,CAAC,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,MAAoB,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QAChF,IAAI,CAAC,CAAC,EAAE,CAAC;YACP,MAAM,GAAG,CAAC,IAAI,CACZ,uBAAuB,EACvB,MAAM,MAAM,CAAC,MAAM,+BAA+B,MAAM,CAAC,OAAO,IAAI,EACpE,EAAE,GAAG,GAAG,CAAC,WAAW,CAAC,uBAAuB,CAAC,EAAE,CAChD,CAAC;QACJ,CAAC;QACD,OAAO;YACL,MAAM,EAAE,CAAC,CAAC,MAAM;YAChB,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC;YACpC,aAAa,EAAE,CAAC,CAAC,aAAa;YAC9B,UAAU,EAAE,CAAC,CAAC,UAAU;YACxB,WAAW,EAAE,CAAC,CAAC,WAAW;YAC1B,OAAO,EAAE,CAAC,CAAC,OAAO;YAClB,UAAU,EAAE,CAAC,CAAC,UAAU;YACxB,eAAe,EAAE,CAAC,CAAC,eAAe;YAClC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO;YAC1B,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW;YAClC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS;YAC9B,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY;YACpC,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa;YACtC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO;YAC1B,MAAM,EAAE,gBAAgB;SACzB,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @fileoverview `sanctions://entity/{lei}` — read-only mirror of
3
+ * sanctions_get_entity's GLEIF Level 1 payload (without the screening
4
+ * cross-reference, which is tool-only). For clients that inject context by URI.
5
+ * @module mcp-server/resources/definitions/entity.resource
6
+ */
7
+ import { z } from '@cyanheads/mcp-ts-core';
8
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
9
+ export declare const entityResource: import("@cyanheads/mcp-ts-core").ResourceDefinition<z.ZodObject<{
10
+ lei: z.ZodString;
11
+ }, z.core.$strip>, undefined, readonly [{
12
+ readonly reason: "lei_not_found";
13
+ readonly code: JsonRpcErrorCode.NotFound;
14
+ readonly when: "No GLEIF entity exists for the given LEI in the mirror.";
15
+ readonly recovery: "Resolve the entity name with sanctions_resolve_entity to obtain a valid LEI first.";
16
+ }]>;
17
+ //# sourceMappingURL=entity.resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/entity.resource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,cAAc;;;;;;;GAgCzB,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @fileoverview `sanctions://entity/{lei}` — read-only mirror of
3
+ * sanctions_get_entity's GLEIF Level 1 payload (without the screening
4
+ * cross-reference, which is tool-only). For clients that inject context by URI.
5
+ * @module mcp-server/resources/definitions/entity.resource
6
+ */
7
+ import { resource, z } from '@cyanheads/mcp-ts-core';
8
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
9
+ import { getScreeningService } from '../../../services/screening/screening-service.js';
10
+ export const entityResource = resource('sanctions://entity/{lei}', {
11
+ name: 'sanctions-screening-mcp-server: entity',
12
+ title: 'sanctions-screening-mcp-server: entity',
13
+ description: "Fetch one GLEIF Level 1 legal-entity record by LEI — a read-only URI mirror of sanctions_get_entity's entity payload. The sanctions cross-reference is available only via the tool.",
14
+ mimeType: 'application/json',
15
+ params: z.object({
16
+ lei: z
17
+ .string()
18
+ .regex(/^[A-Z0-9]{18}[0-9]{2}$/, 'LEI must be 20 chars: 18 alphanumerics + 2 check digits.')
19
+ .describe('The 20-character GLEIF Legal Entity Identifier.'),
20
+ }),
21
+ errors: [
22
+ {
23
+ reason: 'lei_not_found',
24
+ code: JsonRpcErrorCode.NotFound,
25
+ when: 'No GLEIF entity exists for the given LEI in the mirror.',
26
+ recovery: 'Resolve the entity name with sanctions_resolve_entity to obtain a valid LEI first.',
27
+ },
28
+ ],
29
+ async handler(params, ctx) {
30
+ const svc = getScreeningService();
31
+ const entity = await svc.getLeiEntity(params.lei);
32
+ if (!entity) {
33
+ throw ctx.fail('lei_not_found', `No GLEIF entity with LEI "${params.lei}".`, {
34
+ ...ctx.recoveryFor('lei_not_found'),
35
+ });
36
+ }
37
+ return entity;
38
+ },
39
+ });
40
+ //# sourceMappingURL=entity.resource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/entity.resource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAEhF,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC,0BAA0B,EAAE;IACjE,IAAI,EAAE,wCAAwC;IAC9C,KAAK,EAAE,wCAAwC;IAC/C,WAAW,EACT,qLAAqL;IACvL,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,GAAG,EAAE,CAAC;aACH,MAAM,EAAE;aACR,KAAK,CAAC,wBAAwB,EAAE,0DAA0D,CAAC;aAC3F,QAAQ,CAAC,iDAAiD,CAAC;KAC/D,CAAC;IACF,MAAM,EAAE;QACN;YACE,MAAM,EAAE,eAAe;YACvB,IAAI,EAAE,gBAAgB,CAAC,QAAQ;YAC/B,IAAI,EAAE,yDAAyD;YAC/D,QAAQ,EACN,oFAAoF;SACvF;KACF;IAED,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG;QACvB,MAAM,GAAG,GAAG,mBAAmB,EAAE,CAAC;QAClC,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAClD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,6BAA6B,MAAM,CAAC,GAAG,IAAI,EAAE;gBAC3E,GAAG,GAAG,CAAC,WAAW,CAAC,eAAe,CAAC;aACpC,CAAC,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC"}