@cyanheads/eur-lex-mcp-server 0.1.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/AGENTS.md +383 -0
- package/CLAUDE.md +383 -0
- package/Dockerfile +99 -0
- package/LICENSE +201 -0
- package/README.md +343 -0
- package/changelog/0.1.x/0.1.1.md +31 -0
- package/changelog/template.md +127 -0
- package/dist/config/server-config.d.ts +16 -0
- package/dist/config/server-config.d.ts.map +1 -0
- package/dist/config/server-config.js +43 -0
- package/dist/config/server-config.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-server/prompts/definitions/eurlex-comparative-analysis.prompt.d.ts +10 -0
- package/dist/mcp-server/prompts/definitions/eurlex-comparative-analysis.prompt.d.ts.map +1 -0
- package/dist/mcp-server/prompts/definitions/eurlex-comparative-analysis.prompt.js +60 -0
- package/dist/mcp-server/prompts/definitions/eurlex-comparative-analysis.prompt.js.map +1 -0
- package/dist/mcp-server/prompts/definitions/index.d.ts +9 -0
- package/dist/mcp-server/prompts/definitions/index.d.ts.map +1 -0
- package/dist/mcp-server/prompts/definitions/index.js +7 -0
- package/dist/mcp-server/prompts/definitions/index.js.map +1 -0
- package/dist/mcp-server/resources/definitions/eurlex-document-relations.resource.d.ts +9 -0
- package/dist/mcp-server/resources/definitions/eurlex-document-relations.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/eurlex-document-relations.resource.js +91 -0
- package/dist/mcp-server/resources/definitions/eurlex-document-relations.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/eurlex-document.resource.d.ts +9 -0
- package/dist/mcp-server/resources/definitions/eurlex-document.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/eurlex-document.resource.js +61 -0
- package/dist/mcp-server/resources/definitions/eurlex-document.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/index.d.ts +8 -0
- package/dist/mcp-server/resources/definitions/index.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/index.js +11 -0
- package/dist/mcp-server/resources/definitions/index.js.map +1 -0
- package/dist/mcp-server/tools/definitions/eurlex-browse-subjects.tool.d.ts +25 -0
- package/dist/mcp-server/tools/definitions/eurlex-browse-subjects.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/eurlex-browse-subjects.tool.js +121 -0
- package/dist/mcp-server/tools/definitions/eurlex-browse-subjects.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/eurlex-get-cases.tool.d.ts +44 -0
- package/dist/mcp-server/tools/definitions/eurlex-get-cases.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/eurlex-get-cases.tool.js +189 -0
- package/dist/mcp-server/tools/definitions/eurlex-get-cases.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/eurlex-get-document.tool.d.ts +46 -0
- package/dist/mcp-server/tools/definitions/eurlex-get-document.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/eurlex-get-document.tool.js +222 -0
- package/dist/mcp-server/tools/definitions/eurlex-get-document.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/eurlex-get-relations.tool.d.ts +38 -0
- package/dist/mcp-server/tools/definitions/eurlex-get-relations.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/eurlex-get-relations.tool.js +203 -0
- package/dist/mcp-server/tools/definitions/eurlex-get-relations.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/eurlex-lookup-celex.tool.d.ts +32 -0
- package/dist/mcp-server/tools/definitions/eurlex-lookup-celex.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/eurlex-lookup-celex.tool.js +152 -0
- package/dist/mcp-server/tools/definitions/eurlex-lookup-celex.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/eurlex-query-sparql.tool.d.ts +25 -0
- package/dist/mcp-server/tools/definitions/eurlex-query-sparql.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/eurlex-query-sparql.tool.js +104 -0
- package/dist/mcp-server/tools/definitions/eurlex-query-sparql.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/eurlex-search-documents.tool.d.ts +47 -0
- package/dist/mcp-server/tools/definitions/eurlex-search-documents.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/eurlex-search-documents.tool.js +203 -0
- package/dist/mcp-server/tools/definitions/eurlex-search-documents.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/index.d.ts +207 -0
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/index.js +21 -0
- package/dist/mcp-server/tools/definitions/index.js.map +1 -0
- package/dist/services/cellar-sparql/cellar-sparql-service.d.ts +27 -0
- package/dist/services/cellar-sparql/cellar-sparql-service.d.ts.map +1 -0
- package/dist/services/cellar-sparql/cellar-sparql-service.js +123 -0
- package/dist/services/cellar-sparql/cellar-sparql-service.js.map +1 -0
- package/dist/services/cellar-sparql/types.d.ts +62 -0
- package/dist/services/cellar-sparql/types.d.ts.map +1 -0
- package/dist/services/cellar-sparql/types.js +6 -0
- package/dist/services/cellar-sparql/types.js.map +1 -0
- package/dist/services/eurlex-content/eurlex-content-service.d.ts +45 -0
- package/dist/services/eurlex-content/eurlex-content-service.d.ts.map +1 -0
- package/dist/services/eurlex-content/eurlex-content-service.js +93 -0
- package/dist/services/eurlex-content/eurlex-content-service.js.map +1 -0
- package/package.json +105 -0
- package/server.json +161 -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,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Server-specific configuration for eur-lex-mcp-server.
|
|
3
|
+
* Parses environment variables for CELLAR SPARQL and EUR-Lex content API settings.
|
|
4
|
+
* @module config/server-config
|
|
5
|
+
*/
|
|
6
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
7
|
+
declare const ServerConfigSchema: z.ZodObject<{
|
|
8
|
+
cellarSparqlEndpoint: z.ZodDefault<z.ZodString>;
|
|
9
|
+
eurLexContentBaseUrl: z.ZodDefault<z.ZodString>;
|
|
10
|
+
sparqlQueryTimeoutMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
11
|
+
maxSparqlResults: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export type ServerConfig = z.infer<typeof ServerConfigSchema>;
|
|
14
|
+
export declare function getServerConfig(): ServerConfig;
|
|
15
|
+
export {};
|
|
16
|
+
//# 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;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAG3C,QAAA,MAAM,kBAAkB;;;;;iBAwBtB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D,wBAAgB,eAAe,IAAI,YAAY,CAQ9C"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Server-specific configuration for eur-lex-mcp-server.
|
|
3
|
+
* Parses environment variables for CELLAR SPARQL and EUR-Lex content API settings.
|
|
4
|
+
* @module config/server-config
|
|
5
|
+
*/
|
|
6
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
7
|
+
import { parseEnvConfig } from '@cyanheads/mcp-ts-core/config';
|
|
8
|
+
const ServerConfigSchema = z.object({
|
|
9
|
+
cellarSparqlEndpoint: z
|
|
10
|
+
.string()
|
|
11
|
+
.url()
|
|
12
|
+
.default('http://publications.europa.eu/webapi/rdf/sparql')
|
|
13
|
+
.describe('CELLAR SPARQL endpoint URL (Virtuoso)'),
|
|
14
|
+
eurLexContentBaseUrl: z
|
|
15
|
+
.string()
|
|
16
|
+
.url()
|
|
17
|
+
.default('https://eur-lex.europa.eu')
|
|
18
|
+
.describe('EUR-Lex content API base URL'),
|
|
19
|
+
sparqlQueryTimeoutMs: z.coerce
|
|
20
|
+
.number()
|
|
21
|
+
.int()
|
|
22
|
+
.positive()
|
|
23
|
+
.default(55_000)
|
|
24
|
+
.describe('Client-side timeout for SPARQL requests in milliseconds'),
|
|
25
|
+
maxSparqlResults: z.coerce
|
|
26
|
+
.number()
|
|
27
|
+
.int()
|
|
28
|
+
.positive()
|
|
29
|
+
.max(100)
|
|
30
|
+
.default(100)
|
|
31
|
+
.describe('Enforced ceiling on LIMIT in all generated SPARQL queries'),
|
|
32
|
+
});
|
|
33
|
+
let _config;
|
|
34
|
+
export function getServerConfig() {
|
|
35
|
+
_config ??= parseEnvConfig(ServerConfigSchema, {
|
|
36
|
+
cellarSparqlEndpoint: 'CELLAR_SPARQL_ENDPOINT',
|
|
37
|
+
eurLexContentBaseUrl: 'EURLEX_CONTENT_BASE_URL',
|
|
38
|
+
sparqlQueryTimeoutMs: 'SPARQL_QUERY_TIMEOUT_MS',
|
|
39
|
+
maxSparqlResults: 'MAX_SPARQL_RESULTS',
|
|
40
|
+
});
|
|
41
|
+
return _config;
|
|
42
|
+
}
|
|
43
|
+
//# 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;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,oBAAoB,EAAE,CAAC;SACpB,MAAM,EAAE;SACR,GAAG,EAAE;SACL,OAAO,CAAC,iDAAiD,CAAC;SAC1D,QAAQ,CAAC,uCAAuC,CAAC;IACpD,oBAAoB,EAAE,CAAC;SACpB,MAAM,EAAE;SACR,GAAG,EAAE;SACL,OAAO,CAAC,2BAA2B,CAAC;SACpC,QAAQ,CAAC,8BAA8B,CAAC;IAC3C,oBAAoB,EAAE,CAAC,CAAC,MAAM;SAC3B,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,OAAO,CAAC,MAAM,CAAC;SACf,QAAQ,CAAC,yDAAyD,CAAC;IACtE,gBAAgB,EAAE,CAAC,CAAC,MAAM;SACvB,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,GAAG,CAAC,GAAG,CAAC;SACR,OAAO,CAAC,GAAG,CAAC;SACZ,QAAQ,CAAC,2DAA2D,CAAC;CACzE,CAAC,CAAC;AAIH,IAAI,OAAiC,CAAC;AAEtC,MAAM,UAAU,eAAe;IAC7B,OAAO,KAAK,cAAc,CAAC,kBAAkB,EAAE;QAC7C,oBAAoB,EAAE,wBAAwB;QAC9C,oBAAoB,EAAE,yBAAyB;QAC/C,oBAAoB,EAAE,yBAAyB;QAC/C,gBAAgB,EAAE,oBAAoB;KACvC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;GAIG"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview eur-lex-mcp-server MCP server entry point.
|
|
4
|
+
* Provides access to the EU CELLAR repository and EUR-Lex content API.
|
|
5
|
+
* @module index
|
|
6
|
+
*/
|
|
7
|
+
import { createApp } from '@cyanheads/mcp-ts-core';
|
|
8
|
+
import { getServerConfig } from './config/server-config.js';
|
|
9
|
+
import { allPromptDefinitions } from './mcp-server/prompts/definitions/index.js';
|
|
10
|
+
import { allResourceDefinitions } from './mcp-server/resources/definitions/index.js';
|
|
11
|
+
import { allToolDefinitions } from './mcp-server/tools/definitions/index.js';
|
|
12
|
+
import { initCellarSparqlService } from './services/cellar-sparql/cellar-sparql-service.js';
|
|
13
|
+
import { initEurLexContentService } from './services/eurlex-content/eurlex-content-service.js';
|
|
14
|
+
await createApp({
|
|
15
|
+
tools: allToolDefinitions,
|
|
16
|
+
resources: allResourceDefinitions,
|
|
17
|
+
prompts: allPromptDefinitions,
|
|
18
|
+
instructions: 'EUR-Lex MCP server provides access to the EU CELLAR semantic repository (2.7M+ EU legal works).\n' +
|
|
19
|
+
'- Use eurlex_browse_subjects first to resolve subject keywords to EuroVoc concept URIs before filtering searches.\n' +
|
|
20
|
+
'- Use eurlex_lookup_celex to validate an identifier before calling eurlex_get_document.\n' +
|
|
21
|
+
'- CELEX format: {sector}{year}{type}{number} — e.g. 32016R0679 (GDPR), 62024CJ0629 (case).\n' +
|
|
22
|
+
'- Document text comes from the EUR-Lex REST API; metadata and relations come from CELLAR SPARQL.\n' +
|
|
23
|
+
'- eurlex_query_sparql is an escape hatch for CDM ontology traversal not covered by curated tools.',
|
|
24
|
+
setup(core) {
|
|
25
|
+
const serverConfig = getServerConfig();
|
|
26
|
+
initCellarSparqlService(core.config, core.storage, serverConfig);
|
|
27
|
+
initEurLexContentService(core.config, core.storage, serverConfig);
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,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,EAAE,uBAAuB,EAAE,MAAM,mDAAmD,CAAC;AAC5F,OAAO,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AAE/F,MAAM,SAAS,CAAC;IACd,KAAK,EAAE,kBAAkB;IACzB,SAAS,EAAE,sBAAsB;IACjC,OAAO,EAAE,oBAAoB;IAC7B,YAAY,EACV,mGAAmG;QACnG,qHAAqH;QACrH,2FAA2F;QAC3F,8FAA8F;QAC9F,oGAAoG;QACpG,mGAAmG;IACrG,KAAK,CAAC,IAAI;QACR,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;QACvC,uBAAuB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QACjE,wBAAwB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACpE,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview eurlex_comparative_analysis — Comparative EU ↔ US legal analysis prompt.
|
|
3
|
+
* @module mcp-server/prompts/definitions/eurlex-comparative-analysis
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
export declare const eurlex_comparative_analysis: import("@cyanheads/mcp-ts-core").PromptDefinition<z.ZodObject<{
|
|
7
|
+
domain: z.ZodString;
|
|
8
|
+
focus: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, z.core.$strip>>;
|
|
10
|
+
//# sourceMappingURL=eurlex-comparative-analysis.prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eurlex-comparative-analysis.prompt.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/eurlex-comparative-analysis.prompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAU,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEnD,eAAO,MAAM,2BAA2B;;;kBA4DtC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview eurlex_comparative_analysis — Comparative EU ↔ US legal analysis prompt.
|
|
3
|
+
* @module mcp-server/prompts/definitions/eurlex-comparative-analysis
|
|
4
|
+
*/
|
|
5
|
+
import { prompt, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
export const eurlex_comparative_analysis = prompt('eurlex_comparative_analysis', {
|
|
7
|
+
description: 'Frames a comparative legal analysis across EU and US law for a given policy domain. ' +
|
|
8
|
+
'Structures the inquiry to use eurlex_search_documents and eurlex_get_document for the EU side, ' +
|
|
9
|
+
'and courtlistener_search_opinions for the US counterpart. ' +
|
|
10
|
+
'Useful for policy analysts, legal researchers, and practitioners needing a cross-jurisdictional overview.',
|
|
11
|
+
args: z.object({
|
|
12
|
+
domain: z
|
|
13
|
+
.string()
|
|
14
|
+
.min(1)
|
|
15
|
+
.describe('Policy domain for the comparison (e.g. "data privacy", "antitrust", "AI regulation", "food safety").'),
|
|
16
|
+
focus: z
|
|
17
|
+
.string()
|
|
18
|
+
.optional()
|
|
19
|
+
.describe('Optional sub-topic or specific aspect to focus on (e.g. "enforcement mechanisms", "data subject rights", "remedies").'),
|
|
20
|
+
}),
|
|
21
|
+
generate: (args) => {
|
|
22
|
+
const focusLine = args.focus ? ` with emphasis on **${args.focus}**` : '';
|
|
23
|
+
const domain = args.domain;
|
|
24
|
+
return [
|
|
25
|
+
{
|
|
26
|
+
role: 'user',
|
|
27
|
+
content: {
|
|
28
|
+
type: 'text',
|
|
29
|
+
text: `Please provide a comparative legal analysis of **${domain}**${focusLine} across EU and US jurisdictions.
|
|
30
|
+
|
|
31
|
+
## Research Plan
|
|
32
|
+
|
|
33
|
+
### EU Side
|
|
34
|
+
1. Call **eurlex_browse_subjects** with keyword "${domain}" to identify relevant EuroVoc concept URIs.
|
|
35
|
+
2. Call **eurlex_search_documents** filtered by the EuroVoc concept(s) found, document_type REG or DIR, to find key legislative acts.
|
|
36
|
+
3. Call **eurlex_get_document** on the most significant act(s) to retrieve full text and metadata.
|
|
37
|
+
4. Call **eurlex_get_relations** on key acts to understand the legislative history and amendments.
|
|
38
|
+
|
|
39
|
+
### US Side
|
|
40
|
+
5. Call **courtlistener_search_opinions** with query "${domain}" to find significant US court decisions.
|
|
41
|
+
6. Supplement with relevant federal statutes or regulations where applicable.
|
|
42
|
+
|
|
43
|
+
## Analysis Framework
|
|
44
|
+
|
|
45
|
+
After gathering sources, structure your analysis around:
|
|
46
|
+
|
|
47
|
+
1. **Regulatory scope** — What conduct or activity is covered? Who are the regulated entities?
|
|
48
|
+
2. **Core obligations** — What must regulated parties do or refrain from?
|
|
49
|
+
3. ${args.focus ? `**${args.focus}** — Deep dive into this specific aspect` : '**Key differences** — Where do the EU and US approaches diverge most significantly?'}
|
|
50
|
+
4. **Enforcement** — Who enforces the rules and what are the penalties?
|
|
51
|
+
5. **Recent developments** — Recent legislation, court decisions, or regulatory guidance.
|
|
52
|
+
6. **Practical implications** — For a multinational entity operating in both jurisdictions.
|
|
53
|
+
|
|
54
|
+
Please cite specific EU acts (with CELEX numbers) and US cases/statutes as you go.`,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=eurlex-comparative-analysis.prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eurlex-comparative-analysis.prompt.js","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/eurlex-comparative-analysis.prompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC,6BAA6B,EAAE;IAC/E,WAAW,EACT,sFAAsF;QACtF,iGAAiG;QACjG,4DAA4D;QAC5D,2GAA2G;IAC7G,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;QACb,MAAM,EAAE,CAAC;aACN,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,sGAAsG,CACvG;QACH,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,uHAAuH,CACxH;KACJ,CAAC;IAEF,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;QACjB,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,uBAAuB,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1E,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAE3B,OAAO;YACL;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,oDAAoD,MAAM,KAAK,SAAS;;;;;mDAKrC,MAAM;;;;;;wDAMD,MAAM;;;;;;;;;KASzD,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,KAAK,0CAA0C,CAAC,CAAC,CAAC,qFAAqF;;;;;mFAKhF;iBAC1E;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Barrel export for all EUR-Lex MCP prompt definitions.
|
|
3
|
+
* @module mcp-server/prompts/definitions/index
|
|
4
|
+
*/
|
|
5
|
+
export declare const allPromptDefinitions: import("@cyanheads/mcp-ts-core").PromptDefinition<import("zod").ZodObject<{
|
|
6
|
+
domain: import("zod").ZodString;
|
|
7
|
+
focus: import("zod").ZodOptional<import("zod").ZodString>;
|
|
8
|
+
}, import("zod/v4/core").$strip>>[];
|
|
9
|
+
//# 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;;;GAGG;AAIH,eAAO,MAAM,oBAAoB;;;mCAAgC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Barrel export for all EUR-Lex MCP prompt definitions.
|
|
3
|
+
* @module mcp-server/prompts/definitions/index
|
|
4
|
+
*/
|
|
5
|
+
import { eurlex_comparative_analysis } from './eurlex-comparative-analysis.prompt.js';
|
|
6
|
+
export const allPromptDefinitions = [eurlex_comparative_analysis];
|
|
7
|
+
//# 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;;;GAGG;AAEH,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AAEtF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,2BAA2B,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview eurlex://document/{celexNumber}/relations — Relationship summary for a CELLAR work.
|
|
3
|
+
* @module mcp-server/resources/definitions/eurlex-document-relations
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
export declare const eurlex_document_relations_resource: import("@cyanheads/mcp-ts-core").ResourceDefinition<z.ZodObject<{
|
|
7
|
+
celexNumber: z.ZodString;
|
|
8
|
+
}, z.core.$strip>, undefined, undefined>;
|
|
9
|
+
//# sourceMappingURL=eurlex-document-relations.resource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eurlex-document-relations.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/eurlex-document-relations.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AA2BrD,eAAO,MAAM,kCAAkC;;wCAqF9C,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview eurlex://document/{celexNumber}/relations — Relationship summary for a CELLAR work.
|
|
3
|
+
* @module mcp-server/resources/definitions/eurlex-document-relations
|
|
4
|
+
*/
|
|
5
|
+
import { resource, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { notFound } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
import { CellarSparqlService, getCellarSparqlService, } from '../../../services/cellar-sparql/cellar-sparql-service.js';
|
|
8
|
+
/** CDM relation predicates for the summary resource. */
|
|
9
|
+
const RELATION_PREDICATES = [
|
|
10
|
+
'cdm:work_cites_work',
|
|
11
|
+
'cdm:resource_legal_amends_resource_legal',
|
|
12
|
+
'cdm:resource_legal_amended_by_resource_legal',
|
|
13
|
+
'cdm:resource_legal_based_on_resource_legal',
|
|
14
|
+
'cdm:resource_legal_has_consolidated_version',
|
|
15
|
+
];
|
|
16
|
+
const PREDICATE_TO_TYPE = {
|
|
17
|
+
'http://publications.europa.eu/ontology/cdm#work_cites_work': 'cites',
|
|
18
|
+
'http://publications.europa.eu/ontology/cdm#resource_legal_amends_resource_legal': 'amends',
|
|
19
|
+
'http://publications.europa.eu/ontology/cdm#resource_legal_amended_by_resource_legal': 'amended_by',
|
|
20
|
+
'http://publications.europa.eu/ontology/cdm#resource_legal_based_on_resource_legal': 'legal_basis',
|
|
21
|
+
'http://publications.europa.eu/ontology/cdm#resource_legal_has_consolidated_version': 'consolidated_version',
|
|
22
|
+
};
|
|
23
|
+
export const eurlex_document_relations_resource = resource('eurlex://document/{celexNumber}/relations', {
|
|
24
|
+
name: 'EUR-Lex document relations',
|
|
25
|
+
description: 'Relationship summary for a CELLAR work: amendment chain, consolidations, legal basis, and cited-by information. ' +
|
|
26
|
+
'Returns direct one-hop CDM relations for the work identified by CELEX number. ' +
|
|
27
|
+
'For deeper traversal or additional relation types, use the eurlex_get_relations tool.',
|
|
28
|
+
mimeType: 'application/json',
|
|
29
|
+
params: z.object({
|
|
30
|
+
celexNumber: z.string().describe('CELEX number of the EU act (e.g. 32016R0679 for GDPR).'),
|
|
31
|
+
}),
|
|
32
|
+
async handler(params, ctx) {
|
|
33
|
+
const svc = getCellarSparqlService();
|
|
34
|
+
const celexNumber = params.celexNumber.trim();
|
|
35
|
+
const safeCelexNumber = celexNumber.replace(/"/g, '\\"');
|
|
36
|
+
// Resolve to work URI first
|
|
37
|
+
const resolveSparql = `
|
|
38
|
+
SELECT ?work WHERE {
|
|
39
|
+
?work cdm:resource_legal_id_celex ?celex .
|
|
40
|
+
FILTER(STR(?celex) = "${safeCelexNumber}")
|
|
41
|
+
} LIMIT 1`;
|
|
42
|
+
const resolveBindings = await svc.query(resolveSparql, ctx);
|
|
43
|
+
if (resolveBindings.length === 0) {
|
|
44
|
+
throw notFound(`No CELLAR work found for CELEX: ${celexNumber}`, { celexNumber });
|
|
45
|
+
}
|
|
46
|
+
const workUri = CellarSparqlService.bindingValue(resolveBindings[0], 'work') ?? '';
|
|
47
|
+
// Fetch relations
|
|
48
|
+
const relSparql = `
|
|
49
|
+
SELECT ?relatedWork ?relatedCelex ?relationType ?direction WHERE {
|
|
50
|
+
{
|
|
51
|
+
<${workUri}> ?relationType ?relatedWork .
|
|
52
|
+
OPTIONAL { ?relatedWork cdm:resource_legal_id_celex ?relatedCelex . }
|
|
53
|
+
BIND("outgoing" AS ?direction)
|
|
54
|
+
FILTER(?relationType IN (${RELATION_PREDICATES.join(', ')}))
|
|
55
|
+
} UNION {
|
|
56
|
+
?relatedWork ?relationType <${workUri}> .
|
|
57
|
+
OPTIONAL { ?relatedWork cdm:resource_legal_id_celex ?relatedCelex . }
|
|
58
|
+
BIND("incoming" AS ?direction)
|
|
59
|
+
FILTER(?relationType IN (${RELATION_PREDICATES.join(', ')}))
|
|
60
|
+
}
|
|
61
|
+
} LIMIT 50`;
|
|
62
|
+
const relBindings = await svc.query(relSparql, ctx);
|
|
63
|
+
const relations = [];
|
|
64
|
+
const seen = new Set();
|
|
65
|
+
for (const b of relBindings) {
|
|
66
|
+
const relatedWorkUri = CellarSparqlService.bindingValue(b, 'relatedWork') ?? '';
|
|
67
|
+
const predicateUri = CellarSparqlService.bindingValue(b, 'relationType') ?? '';
|
|
68
|
+
const direction = CellarSparqlService.bindingValue(b, 'direction') ?? 'outgoing';
|
|
69
|
+
const key = `${predicateUri}|${relatedWorkUri}|${direction}`;
|
|
70
|
+
if (seen.has(key))
|
|
71
|
+
continue;
|
|
72
|
+
seen.add(key);
|
|
73
|
+
const entry = {
|
|
74
|
+
relation_type: PREDICATE_TO_TYPE[predicateUri] ?? predicateUri,
|
|
75
|
+
direction,
|
|
76
|
+
related_work_uri: relatedWorkUri,
|
|
77
|
+
};
|
|
78
|
+
const relatedCelex = CellarSparqlService.bindingValue(b, 'relatedCelex');
|
|
79
|
+
if (relatedCelex)
|
|
80
|
+
entry.related_celex_number = relatedCelex;
|
|
81
|
+
relations.push(entry);
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
celex_number: celexNumber,
|
|
85
|
+
work_uri: workUri,
|
|
86
|
+
relations,
|
|
87
|
+
total: relations.length,
|
|
88
|
+
};
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
//# sourceMappingURL=eurlex-document-relations.resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eurlex-document-relations.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/eurlex-document-relations.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EACL,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,mDAAmD,CAAC;AAE3D,wDAAwD;AACxD,MAAM,mBAAmB,GAAG;IAC1B,qBAAqB;IAC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O;YACjB,SAAS;YACT,KAAK,EAAE,SAAS,CAAC,MAAM;SACxB,CAAC;IACJ,CAAC;CACF,CACF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview eurlex://document/{celexNumber} — Metadata snapshot for a CELLAR work.
|
|
3
|
+
* @module mcp-server/resources/definitions/eurlex-document
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
export declare const eurlex_document_resource: import("@cyanheads/mcp-ts-core").ResourceDefinition<z.ZodObject<{
|
|
7
|
+
celexNumber: z.ZodString;
|
|
8
|
+
}, z.core.$strip>, undefined, undefined>;
|
|
9
|
+
//# sourceMappingURL=eurlex-document.resource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eurlex-document.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/eurlex-document.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAOrD,eAAO,MAAM,wBAAwB;;wCAsDnC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview eurlex://document/{celexNumber} — Metadata snapshot for a CELLAR work.
|
|
3
|
+
* @module mcp-server/resources/definitions/eurlex-document
|
|
4
|
+
*/
|
|
5
|
+
import { resource, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { notFound } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
import { CellarSparqlService, getCellarSparqlService, } from '../../../services/cellar-sparql/cellar-sparql-service.js';
|
|
8
|
+
export const eurlex_document_resource = resource('eurlex://document/{celexNumber}', {
|
|
9
|
+
name: 'EUR-Lex document metadata',
|
|
10
|
+
description: 'Metadata snapshot for a CELLAR work identified by CELEX number. ' +
|
|
11
|
+
'Returns document type, date, title (where available), author institution, and in-force flag. ' +
|
|
12
|
+
'Read-only, stable-URI injectable context for EU acts. ' +
|
|
13
|
+
'Full content and relations are available via the eurlex_get_document and eurlex_get_relations tools.',
|
|
14
|
+
mimeType: 'application/json',
|
|
15
|
+
params: z.object({
|
|
16
|
+
celexNumber: z.string().describe('CELEX number of the EU act (e.g. 32016R0679 for GDPR).'),
|
|
17
|
+
}),
|
|
18
|
+
async handler(params, ctx) {
|
|
19
|
+
const svc = getCellarSparqlService();
|
|
20
|
+
const celexNumber = params.celexNumber.trim();
|
|
21
|
+
const safeCelexNumber = celexNumber.replace(/"/g, '\\"');
|
|
22
|
+
const sparql = `
|
|
23
|
+
SELECT ?work ?celexNumber ?type ?date ?title ?inForce ?author WHERE {
|
|
24
|
+
?work cdm:resource_legal_id_celex ?celexNumber .
|
|
25
|
+
FILTER(STR(?celexNumber) = "${safeCelexNumber}")
|
|
26
|
+
OPTIONAL { ?work cdm:work_has_resource-type ?type . }
|
|
27
|
+
OPTIONAL { ?work cdm:work_date_document ?date . }
|
|
28
|
+
OPTIONAL { ?work cdm:work_title ?titleNode . ?titleNode cdm:expression_title ?title . FILTER(LANG(?title) = "en") }
|
|
29
|
+
OPTIONAL { ?work cdm:resource_legal_in-force ?inForce . }
|
|
30
|
+
OPTIONAL { ?work cdm:work_created_by_agent ?author . }
|
|
31
|
+
} LIMIT 5`;
|
|
32
|
+
const bindings = await svc.query(sparql, ctx);
|
|
33
|
+
if (bindings.length === 0) {
|
|
34
|
+
throw notFound(`No CELLAR work found for CELEX: ${celexNumber}`, { celexNumber });
|
|
35
|
+
}
|
|
36
|
+
const first = bindings[0];
|
|
37
|
+
const result = {
|
|
38
|
+
celex_number: CellarSparqlService.bindingValue(first, 'celexNumber') ?? celexNumber,
|
|
39
|
+
};
|
|
40
|
+
const workUri = CellarSparqlService.bindingValue(first, 'work');
|
|
41
|
+
if (workUri)
|
|
42
|
+
result.work_uri = workUri;
|
|
43
|
+
const resourceType = CellarSparqlService.bindingValue(first, 'type');
|
|
44
|
+
if (resourceType)
|
|
45
|
+
result.resource_type = resourceType;
|
|
46
|
+
const date = CellarSparqlService.bindingValue(first, 'date');
|
|
47
|
+
if (date)
|
|
48
|
+
result.date = date;
|
|
49
|
+
const title = CellarSparqlService.bindingValue(first, 'title');
|
|
50
|
+
if (title)
|
|
51
|
+
result.title = title;
|
|
52
|
+
const inForceStr = CellarSparqlService.bindingValue(first, 'inForce');
|
|
53
|
+
if (inForceStr !== undefined)
|
|
54
|
+
result.in_force = inForceStr === 'true';
|
|
55
|
+
const author = CellarSparqlService.bindingValue(first, 'author');
|
|
56
|
+
if (author)
|
|
57
|
+
result.author_institution = author;
|
|
58
|
+
return result;
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=eurlex-document.resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eurlex-document.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/eurlex-document.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EACL,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,mDAAmD,CAAC;AAE3D,MAAM,CAAC,MAAM,wBAAwB,GAAG,QAAQ,CAAC,iCAAiC,EAAE;IAClF,IAAI,EAAE,2BAA2B;IACjC,WAAW,EACT,kEAAkE;QAClE,+FAA+F;QAC/F,wDAAwD;QACxD,sGAAsG;IACxG,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wDAAwD,CAAC;KAC3F,CAAC;IAEF,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG;QACvB,MAAM,GAAG,GAAG,sBAAsB,EAAE,CAAC;QACrC,MAAM,WAAW,GAA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AAC,CAAC;QACtE,IAAI,UAAU,KAAK,SAAS;YAAE,MAAM,CAAC,QAAQ,GAAG,UAAU,KAAK,MAAM,CAAC;QACtE,MAAM,MAAM,GAAG,mBAAmB,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QACjE,IAAI,MAAM;YAAE,MAAM,CAAC,kBAAkB,GAAG,MAAM,CAAC;QAE/C,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Barrel export for all EUR-Lex MCP resource definitions.
|
|
3
|
+
* @module mcp-server/resources/definitions/index
|
|
4
|
+
*/
|
|
5
|
+
export declare const allResourceDefinitions: import("@cyanheads/mcp-ts-core").ResourceDefinition<import("zod").ZodObject<{
|
|
6
|
+
celexNumber: import("zod").ZodString;
|
|
7
|
+
}, import("zod/v4/core").$strip>, undefined, undefined>[];
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,eAAO,MAAM,sBAAsB;;yDAGlC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Barrel export for all EUR-Lex MCP resource definitions.
|
|
3
|
+
* @module mcp-server/resources/definitions/index
|
|
4
|
+
*/
|
|
5
|
+
import { eurlex_document_resource } from './eurlex-document.resource.js';
|
|
6
|
+
import { eurlex_document_relations_resource } from './eurlex-document-relations.resource.js';
|
|
7
|
+
export const allResourceDefinitions = [
|
|
8
|
+
eurlex_document_resource,
|
|
9
|
+
eurlex_document_relations_resource,
|
|
10
|
+
];
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAE7F,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,wBAAwB;IACxB,kCAAkC;CACnC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview eurlex_browse_subjects — Search the EuroVoc multilingual thesaurus.
|
|
3
|
+
* @module mcp-server/tools/definitions/eurlex-browse-subjects
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
export declare const eurlex_browse_subjects: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
8
|
+
keyword: z.ZodString;
|
|
9
|
+
language: z.ZodDefault<z.ZodString>;
|
|
10
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
11
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
12
|
+
concepts: z.ZodArray<z.ZodObject<{
|
|
13
|
+
concept_uri: z.ZodString;
|
|
14
|
+
pref_label: z.ZodString;
|
|
15
|
+
concept_code: z.ZodOptional<z.ZodString>;
|
|
16
|
+
broader_label: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
total: z.ZodNumber;
|
|
19
|
+
}, z.core.$strip>, readonly [{
|
|
20
|
+
readonly reason: "no_concepts";
|
|
21
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
22
|
+
readonly when: "No EuroVoc concepts matched the keyword in the requested language.";
|
|
23
|
+
readonly recovery: "Try a broader or simpler term, or retry with language \"en\" for wider coverage.";
|
|
24
|
+
}], undefined>;
|
|
25
|
+
//# sourceMappingURL=eurlex-browse-subjects.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eurlex-browse-subjects.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/eurlex-browse-subjects.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAMjE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;cAkIjC,CAAC"}
|