@refkit/mcp 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-6JDNSEQM.js → chunk-DQHNPSDF.js} +20 -7
- package/dist/chunk-DQHNPSDF.js.map +1 -0
- package/dist/cli.d.ts +16 -8
- package/dist/cli.js +73 -30
- package/dist/cli.js.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +29 -20
- package/dist/chunk-6JDNSEQM.js.map +0 -1
|
@@ -3,7 +3,7 @@ import { readFileSync } from "fs";
|
|
|
3
3
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
4
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
import { LICENSE_IDS, INTENTS, evaluateUse, buildAttribution, ccVersionFor } from "@refkit/core";
|
|
6
|
+
import { LICENSE_IDS, INTENTS, evaluateUse, buildAttribution, ccVersionFor, lexicalReranker } from "@refkit/core";
|
|
7
7
|
var MODALITIES = ["image", "video", "audio", "text"];
|
|
8
8
|
var ORIENTATIONS = ["landscape", "portrait", "square"];
|
|
9
9
|
var SEARCH_CONTROL_KEYS = [
|
|
@@ -132,6 +132,7 @@ var searchMetaSchema = z.object({
|
|
|
132
132
|
after: z.number(),
|
|
133
133
|
dropped: z.number()
|
|
134
134
|
}).optional(),
|
|
135
|
+
nextCursor: z.string().optional().describe("opaque load-more cursor; pass back as `cursor` to fetch the next page with cross-page dedup"),
|
|
135
136
|
warnings: z.array(z.string())
|
|
136
137
|
});
|
|
137
138
|
function createRefkitMcpServer(refkit) {
|
|
@@ -147,14 +148,20 @@ function createRefkitMcpServer(refkit) {
|
|
|
147
148
|
filters: filtersSchema.optional().describe("compatibility alias for controls.orientation, controls.color, and controls.language"),
|
|
148
149
|
controls: searchControlsSchema.optional().describe("provider-neutral search controls; providers translate supported controls and report ignored controls in explain metadata"),
|
|
149
150
|
providerOptions: providerOptionsSchema.optional().describe("provider-specific search controls keyed by provider id; each provider whitelists supported keys"),
|
|
150
|
-
explain: z.boolean().optional().describe("include provider status, applied and ignored controls, warnings,
|
|
151
|
+
explain: z.boolean().optional().describe("include provider status, applied and ignored controls, warnings, gate/drop metadata, and the load-more cursor"),
|
|
151
152
|
limit: z.number().int().positive().optional(),
|
|
153
|
+
cursor: z.string().optional().describe("opaque cursor from a previous result's nextCursor \u2014 fetches the next batch, deduped against earlier batches"),
|
|
154
|
+
rerank: z.boolean().optional().describe("re-rank results by query relevance (term coverage incl. CJK, resolution, source diversity) instead of raw cross-source rank fusion"),
|
|
152
155
|
intent: z.enum(INTENTS).optional().describe("annotate each result with a use-verdict for this intended use (no filtering)"),
|
|
153
156
|
gateFor: z.enum(INTENTS).optional().describe("only return results whose license allows this intended use")
|
|
154
157
|
},
|
|
155
|
-
outputSchema: {
|
|
158
|
+
outputSchema: {
|
|
159
|
+
references: z.array(agentRefSchema),
|
|
160
|
+
nextCursor: z.string().optional().describe("pass back as `cursor` for the next batch; absent = exhausted"),
|
|
161
|
+
meta: searchMetaSchema.optional()
|
|
162
|
+
}
|
|
156
163
|
},
|
|
157
|
-
async ({ query, modalities, filters, controls, providerOptions, explain, limit, intent, gateFor }) => {
|
|
164
|
+
async ({ query, modalities, filters, controls, providerOptions, explain, limit, cursor, rerank, intent, gateFor }) => {
|
|
158
165
|
const searchInput = {
|
|
159
166
|
query,
|
|
160
167
|
modalities: modalities ?? ["image"],
|
|
@@ -162,9 +169,11 @@ function createRefkitMcpServer(refkit) {
|
|
|
162
169
|
controls,
|
|
163
170
|
providerOptions,
|
|
164
171
|
limit,
|
|
172
|
+
cursor,
|
|
173
|
+
...rerank ? { rerank: lexicalReranker() } : {},
|
|
165
174
|
gateFor
|
|
166
175
|
};
|
|
167
|
-
const result =
|
|
176
|
+
const result = await refkit.searchWithMeta(searchInput);
|
|
168
177
|
const refs = result.references;
|
|
169
178
|
const assessIntent = intent ?? gateFor;
|
|
170
179
|
const references = refs.map(
|
|
@@ -172,7 +181,11 @@ function createRefkitMcpServer(refkit) {
|
|
|
172
181
|
);
|
|
173
182
|
return {
|
|
174
183
|
content: [{ type: "text", text: `${references.length} reference(s) for "${query}".` }],
|
|
175
|
-
structuredContent: {
|
|
184
|
+
structuredContent: {
|
|
185
|
+
references,
|
|
186
|
+
...result.meta.nextCursor ? { nextCursor: result.meta.nextCursor } : {},
|
|
187
|
+
...explain ? { meta: result.meta } : {}
|
|
188
|
+
}
|
|
176
189
|
};
|
|
177
190
|
}
|
|
178
191
|
);
|
|
@@ -261,4 +274,4 @@ export {
|
|
|
261
274
|
createRefkitMcpServer,
|
|
262
275
|
serveStdio
|
|
263
276
|
};
|
|
264
|
-
//# sourceMappingURL=chunk-
|
|
277
|
+
//# sourceMappingURL=chunk-DQHNPSDF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { readFileSync } from 'node:fs'\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'\nimport { z } from 'zod'\nimport { LICENSE_IDS, INTENTS, evaluateUse, buildAttribution, ccVersionFor, lexicalReranker } from '@refkit/core'\nimport type { RefkitClient, Reference, Verdict, Attribution, SearchFilters, SearchControls, SearchControlKey, ProviderOptionsById, SearchMeta, RightsRecord } from '@refkit/core'\n\nconst MODALITIES = ['image', 'video', 'audio', 'text'] as const\nconst ORIENTATIONS = ['landscape', 'portrait', 'square'] as const\nconst SEARCH_CONTROL_KEYS = [\n 'orientation',\n 'color',\n 'language',\n 'sort',\n 'safety',\n 'license.commercial',\n 'license.modification',\n 'license.allowUnknown',\n 'media.kind',\n 'media.size',\n 'media.minWidth',\n 'media.minHeight',\n 'media.duration',\n 'creator.id',\n 'creator.name',\n 'text.copyright',\n 'page',\n] as const satisfies readonly SearchControlKey[]\n\nconst filtersSchema = z.object({\n color: z.string().optional(),\n orientation: z.enum(ORIENTATIONS).optional(),\n language: z.string().optional(),\n})\nconst searchControlKeySchema = z.enum(SEARCH_CONTROL_KEYS)\n\nconst searchControlsSchema = z.object({\n orientation: z.enum(ORIENTATIONS).optional(),\n color: z.string().optional(),\n language: z.string().optional(),\n sort: z.enum(['relevance', 'latest', 'popular', 'interesting']).optional(),\n safety: z.enum(['strict', 'moderate', 'off']).optional(),\n license: z.object({\n commercial: z.boolean().optional(),\n modification: z.boolean().optional(),\n allowUnknown: z.boolean().optional(),\n }).optional(),\n media: z.object({\n kind: z.enum(['photo', 'illustration', 'vector', 'film', 'animation']).optional(),\n size: z.enum(['small', 'medium', 'large']).optional(),\n minWidth: z.number().int().nonnegative().optional(),\n minHeight: z.number().int().nonnegative().optional(),\n duration: z.enum(['short', 'medium', 'long']).optional(),\n }).optional(),\n creator: z.object({\n id: z.string().optional(),\n name: z.string().optional(),\n }).optional(),\n text: z.object({\n copyright: z.enum(['public-domain', 'copyrighted', 'any']).optional(),\n }).optional(),\n page: z.number().int().positive().optional(),\n})\n\nconst providerOptionValueSchema = z.union([z.string(), z.number(), z.boolean(), z.array(z.string())])\nconst providerOptionsSchema = z.record(z.string(), z.record(z.string(), providerOptionValueSchema))\n\n// Reported in the MCP initialize handshake. Read the real version (the dist sits\n// next to package.json, which npm always ships) instead of a hardcoded placeholder.\nconst VERSION: string = (() => {\n try {\n return JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version\n } catch {\n return '0.0.0'\n }\n})()\n\n// Concise, agent-facing projection of a Reference (no raw provider dump). When an\n// intent is supplied the use-gate verdict + attribution ride along, so the agent\n// sees *whether it may use* each result — not just a bare license id it ignores.\nfunction toAgentRef(r: Reference, assessment?: { verdict: Verdict; attribution: Attribution }) {\n const base = {\n id: r.id,\n title: r.title,\n modality: r.modality,\n provider: r.source.providerId,\n canonicalUrl: r.canonicalUrl,\n license: r.rights.license,\n thumbnail: r.thumbnail?.url,\n excerpt: r.text?.excerpt,\n }\n if (!assessment) return base\n const { verdict, attribution } = assessment\n const reason = verdict.reasons.join('; ')\n const useExplanation = `${verdict.decision}: ${reason || 'license facts allow this use'}${attribution.required && attribution.text ? ` Attribution required: ${attribution.text}` : ''}`\n return {\n ...base,\n useVerdict: { decision: verdict.decision, reason: verdict.reasons.join('; '), confidence: verdict.confidence },\n useExplanation,\n ...(attribution.required && attribution.text ? { attribution: attribution.text } : {}),\n }\n}\n\nconst agentRefSchema = z.object({\n id: z.string(),\n title: z.string().optional(),\n modality: z.string(),\n provider: z.string(),\n canonicalUrl: z.string(),\n license: z.string(),\n thumbnail: z.string().optional(),\n excerpt: z.string().optional(),\n useVerdict: z\n .object({ decision: z.string(), reason: z.string(), confidence: z.string() })\n .optional()\n .describe('present when `intent` (or `gateFor`) is set: may this be used for that intent, and how confident'),\n useExplanation: z.string().optional().describe('plain-language use verdict summary for agents'),\n attribution: z.string().optional().describe('ready-to-use credit line; present when the license requires attribution'),\n})\n\nconst searchMetaSchema: z.ZodType<SearchMeta> = z.object({\n query: z.string(),\n modalities: z.array(z.enum(MODALITIES)),\n limit: z.number(),\n poolFactor: z.number(),\n fetchLimit: z.number(),\n appliedFilters: filtersSchema.optional(),\n controls: z.object({\n requested: z.array(searchControlKeySchema),\n appliedByProvider: z.record(z.string(), z.array(searchControlKeySchema)),\n ignoredByProvider: z.record(z.string(), z.array(searchControlKeySchema)),\n }).optional(),\n providerOptions: z.array(z.string()).optional(),\n providers: z.array(z.object({\n providerId: z.string(),\n status: z.enum(['fulfilled', 'failed', 'skipped']),\n returned: z.number().optional(),\n accepted: z.number().optional(),\n rejected: z.number().optional(),\n reason: z.enum(['unsupported-modality']).optional(),\n error: z.string().optional(),\n latencyMs: z.number().optional(),\n cached: z.boolean().optional(),\n })),\n gate: z.object({\n intent: z.enum(INTENTS),\n before: z.number(),\n after: z.number(),\n dropped: z.number(),\n }).optional(),\n nextCursor: z.string().optional().describe('opaque load-more cursor; pass back as `cursor` to fetch the next page with cross-page dedup'),\n warnings: z.array(z.string()),\n})\n\n/** Wrap a configured RefkitClient as an MCP server exposing `search_references`. */\nexport function createRefkitMcpServer(refkit: RefkitClient): McpServer {\n const server = new McpServer({ name: 'refkit', version: VERSION })\n\n server.registerTool(\n 'search_references',\n {\n title: 'Search creative references',\n description:\n 'Search license-normalized reference material (image / video / audio / text) across the configured sources. ' +\n 'Every result carries a license id + canonical source link. Pass `intent` to annotate each result with a ' +\n 'use-verdict (may I use this, is attribution required) WITHOUT filtering; pass `gateFor` to instead return ' +\n 'only results whose license allows that intent. Results are references, not rights clearance — not legal advice.',\n inputSchema: {\n query: z.string().describe('what to search for, e.g. \"cyberpunk alley at night\"'),\n modalities: z.array(z.enum(MODALITIES)).optional().describe('default [\"image\"]'),\n filters: filtersSchema.optional().describe('compatibility alias for controls.orientation, controls.color, and controls.language'),\n controls: searchControlsSchema.optional().describe('provider-neutral search controls; providers translate supported controls and report ignored controls in explain metadata'),\n providerOptions: providerOptionsSchema.optional().describe('provider-specific search controls keyed by provider id; each provider whitelists supported keys'),\n explain: z.boolean().optional().describe('include provider status, applied and ignored controls, warnings, gate/drop metadata, and the load-more cursor'),\n limit: z.number().int().positive().optional(),\n cursor: z.string().optional().describe('opaque cursor from a previous result\\'s nextCursor — fetches the next batch, deduped against earlier batches'),\n rerank: z.boolean().optional().describe('re-rank results by query relevance (term coverage incl. CJK, resolution, source diversity) instead of raw cross-source rank fusion'),\n intent: z.enum(INTENTS).optional().describe('annotate each result with a use-verdict for this intended use (no filtering)'),\n gateFor: z.enum(INTENTS).optional().describe('only return results whose license allows this intended use'),\n },\n outputSchema: {\n references: z.array(agentRefSchema),\n nextCursor: z.string().optional().describe('pass back as `cursor` for the next batch; absent = exhausted'),\n meta: searchMetaSchema.optional(),\n },\n },\n async ({ query, modalities, filters, controls, providerOptions, explain, limit, cursor, rerank, intent, gateFor }) => {\n const searchInput = {\n query,\n modalities: modalities ?? ['image'],\n filters: filters as SearchFilters | undefined,\n controls: controls as SearchControls | undefined,\n providerOptions: providerOptions as ProviderOptionsById | undefined,\n limit,\n cursor,\n ...(rerank ? { rerank: lexicalReranker() } : {}),\n gateFor,\n }\n // Always searchWithMeta: the continuation token (meta.nextCursor) must not\n // depend on the explain diagnostics flag — only the meta DUMP is gated.\n const result = await refkit.searchWithMeta(searchInput)\n const refs = result.references\n const assessIntent = intent ?? gateFor\n const references = refs.map(r =>\n assessIntent\n ? toAgentRef(r, { verdict: refkit.evaluateUse(r, assessIntent), attribution: refkit.buildAttribution(r) })\n : toAgentRef(r),\n )\n return {\n content: [{ type: 'text', text: `${references.length} reference(s) for \"${query}\".` }],\n structuredContent: {\n references,\n ...(result.meta.nextCursor ? { nextCursor: result.meta.nextCursor } : {}),\n ...(explain ? { meta: result.meta } : {}),\n },\n }\n },\n )\n\n const attributionOutputSchema = { required: z.boolean(), text: z.string().optional(), html: z.string().optional() }\n\n server.registerTool(\n 'evaluate_use',\n {\n title: 'Evaluate a license for an intended use',\n description:\n 'Stateless license/use-gate check: given a license id + intended use, returns a conservative-heuristic verdict ' +\n '(allowed / allowed-with-attribution / denied / needs-review) with reasons and confidence. ' +\n 'Not legal advice — a strict-deny heuristic over source-declared license facts.',\n inputSchema: {\n license: z.enum(LICENSE_IDS).describe('the reference\\'s license id'),\n licenseVersion: z.string().optional().describe('precise CC version, e.g. \"4.0\" — attribution only'),\n author: z.string().optional(),\n title: z.string().optional(),\n canonicalUrl: z.string().describe('canonical source link, for attribution and audit'),\n intent: z.enum(INTENTS).describe('the intended use to evaluate this license against'),\n editorialOnly: z.boolean().optional().describe('source marked editorial-only'),\n jurisdiction: z.string().optional().describe('source-declared jurisdiction of the PD/copyright status'),\n userJurisdiction: z.string().optional().describe('caller\\'s jurisdiction; mismatched jurisdictions default to needs-review'),\n },\n outputSchema: {\n decision: z.enum(['allowed', 'allowed-with-attribution', 'denied', 'needs-review']),\n reasons: z.array(z.string()),\n confidence: z.enum(['high', 'low']),\n disclaimer: z.string(),\n attribution: z.object(attributionOutputSchema).optional(),\n },\n },\n async ({ license, licenseVersion, author, title, canonicalUrl, intent, editorialOnly, jurisdiction, userJurisdiction }) => {\n const version = ccVersionFor(license, licenseVersion)\n const rights: RightsRecord = {\n license,\n licenseVersion: version,\n author,\n rehostPolicy: 'cache-allowed',\n jurisdiction,\n editorialOnly,\n raw: { sourceTerms: '', sourceUrl: canonicalUrl },\n }\n const verdict: Verdict = evaluateUse(rights, intent, { userJurisdiction })\n const attribution =\n verdict.decision === 'allowed-with-attribution'\n ? buildAttribution({ license, licenseVersion: version, author, title, canonicalUrl })\n : undefined\n const summary = `${verdict.decision}: ${verdict.reasons.join('; ') || 'license facts allow this use'}`\n return {\n content: [{ type: 'text', text: summary }],\n structuredContent: {\n decision: verdict.decision,\n reasons: verdict.reasons,\n confidence: verdict.confidence,\n disclaimer: verdict.disclaimer,\n ...(attribution ? { attribution } : {}),\n },\n }\n },\n )\n\n server.registerTool(\n 'build_attribution',\n {\n title: 'Build an attribution credit line',\n description:\n 'Mechanically derive an attribution credit line (plain text + HTML) from a license id + author + title + ' +\n 'canonicalUrl. `required` is false when the license needs no attribution (e.g. CC0, PD).',\n inputSchema: {\n license: z.enum(LICENSE_IDS),\n licenseVersion: z.string().optional().describe('precise CC version, e.g. \"4.0\" — appended to the license name'),\n author: z.string().optional(),\n title: z.string().optional(),\n canonicalUrl: z.string(),\n },\n outputSchema: attributionOutputSchema,\n },\n async ({ license, licenseVersion, author, title, canonicalUrl }) => {\n const version = ccVersionFor(license, licenseVersion)\n const attribution: Attribution = buildAttribution({ license, licenseVersion: version, author, title, canonicalUrl })\n return {\n content: [{ type: 'text', text: attribution.required ? (attribution.text ?? '') : 'No attribution required for this license.' }],\n structuredContent: { required: attribution.required, text: attribution.text, html: attribution.html },\n }\n },\n )\n\n return server\n}\n\n/** Run the refkit MCP server over stdio (host wires the RefkitClient + its providers/keys). */\nexport async function serveStdio(refkit: RefkitClient): Promise<void> {\n const server = createRefkitMcpServer(refkit)\n await server.connect(new StdioServerTransport())\n}\n"],"mappings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
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
/** One BYOK source: its unified + legacy env var names, and a lazy loader for its
|
|
5
|
+
* (optional) provider package. Loaded only when a key is present, so installs
|
|
6
|
+
* that omitted optionalDependencies still boot — the missing source is skipped
|
|
7
|
+
* with a stderr warning instead of crashing the server. */
|
|
8
|
+
interface ByokSource {
|
|
9
|
+
pkg: string;
|
|
10
|
+
key: (env: NodeJS.ProcessEnv) => string | undefined;
|
|
11
|
+
load: (key: string) => Promise<ReferenceProvider[]>;
|
|
12
|
+
}
|
|
13
|
+
declare const BYOK_SOURCES: ByokSource[];
|
|
14
|
+
/** Providers a zero-config server boots with: all keyless sources (hard deps,
|
|
15
|
+
* statically imported), plus any BYOK source whose key is present in `env`
|
|
16
|
+
* (optionalDependencies, dynamically imported on demand). Exported so the
|
|
17
|
+
* wiring is unit-testable. */
|
|
18
|
+
declare function defaultProviders(env?: NodeJS.ProcessEnv): Promise<ReferenceProvider[]>;
|
|
11
19
|
|
|
12
|
-
export { defaultProviders };
|
|
20
|
+
export { BYOK_SOURCES, defaultProviders };
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
serveStdio
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DQHNPSDF.js";
|
|
5
5
|
|
|
6
6
|
// src/cli.ts
|
|
7
7
|
import { realpathSync } from "fs";
|
|
@@ -13,19 +13,63 @@ import { met } from "@refkit/provider-met";
|
|
|
13
13
|
import { artic } from "@refkit/provider-artic";
|
|
14
14
|
import { gutendex } from "@refkit/provider-gutendex";
|
|
15
15
|
import { poetrydb } from "@refkit/provider-poetrydb";
|
|
16
|
-
import { unsplash } from "@refkit/provider-unsplash";
|
|
17
|
-
import { pexels, pexelsVideo } from "@refkit/provider-pexels";
|
|
18
|
-
import { pixabay, pixabayVideo } from "@refkit/provider-pixabay";
|
|
19
|
-
import { flickr } from "@refkit/provider-flickr";
|
|
20
|
-
import { smithsonian } from "@refkit/provider-smithsonian";
|
|
21
|
-
import { brave } from "@refkit/provider-brave";
|
|
22
16
|
import { rijksmuseum } from "@refkit/provider-rijksmuseum";
|
|
23
17
|
import { polyhaven, ambientcg } from "@refkit/provider-polyhaven";
|
|
24
|
-
import { freesound } from "@refkit/provider-freesound";
|
|
25
|
-
import { jamendo } from "@refkit/provider-jamendo";
|
|
26
|
-
import { europeana } from "@refkit/provider-europeana";
|
|
27
18
|
import { internetArchive } from "@refkit/provider-internet-archive";
|
|
28
|
-
|
|
19
|
+
var BYOK_SOURCES = [
|
|
20
|
+
{
|
|
21
|
+
pkg: "@refkit/provider-unsplash",
|
|
22
|
+
key: (env) => env.REFKIT_UNSPLASH_KEY ?? env.UNSPLASH_KEY,
|
|
23
|
+
load: async (accessKey) => [(await import("@refkit/provider-unsplash")).unsplash({ accessKey })]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
pkg: "@refkit/provider-pexels",
|
|
27
|
+
key: (env) => env.REFKIT_PEXELS_KEY ?? env.PEXELS_KEY,
|
|
28
|
+
load: async (apiKey) => {
|
|
29
|
+
const m = await import("@refkit/provider-pexels");
|
|
30
|
+
return [m.pexels({ apiKey }), m.pexelsVideo({ apiKey })];
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
pkg: "@refkit/provider-pixabay",
|
|
35
|
+
key: (env) => env.REFKIT_PIXABAY_KEY ?? env.PIXABAY_KEY,
|
|
36
|
+
load: async (key) => {
|
|
37
|
+
const m = await import("@refkit/provider-pixabay");
|
|
38
|
+
return [m.pixabay({ key }), m.pixabayVideo({ key })];
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
pkg: "@refkit/provider-flickr",
|
|
43
|
+
key: (env) => env.REFKIT_FLICKR_KEY ?? env.FLICKR_KEY,
|
|
44
|
+
load: async (apiKey) => [(await import("@refkit/provider-flickr")).flickr({ apiKey })]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
pkg: "@refkit/provider-smithsonian",
|
|
48
|
+
key: (env) => env.REFKIT_SMITHSONIAN_KEY ?? env.SI_KEY,
|
|
49
|
+
load: async (apiKey) => [(await import("@refkit/provider-smithsonian")).smithsonian({ apiKey })]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
pkg: "@refkit/provider-brave",
|
|
53
|
+
key: (env) => env.REFKIT_BRAVE_KEY ?? env.BRAVE_TOKEN,
|
|
54
|
+
load: async (token) => [(await import("@refkit/provider-brave")).brave({ token })]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
pkg: "@refkit/provider-freesound",
|
|
58
|
+
key: (env) => env.REFKIT_FREESOUND_KEY ?? env.FREESOUND_TOKEN,
|
|
59
|
+
load: async (apiKey) => [(await import("@refkit/provider-freesound")).freesound({ apiKey })]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
pkg: "@refkit/provider-jamendo",
|
|
63
|
+
key: (env) => env.REFKIT_JAMENDO_CLIENT_ID ?? env.JAMENDO_CLIENT_ID,
|
|
64
|
+
load: async (clientId) => [(await import("@refkit/provider-jamendo")).jamendo({ clientId })]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
pkg: "@refkit/provider-europeana",
|
|
68
|
+
key: (env) => env.REFKIT_EUROPEANA_KEY ?? env.EUROPEANA_KEY,
|
|
69
|
+
load: async (apiKey) => [(await import("@refkit/provider-europeana")).europeana({ apiKey })]
|
|
70
|
+
}
|
|
71
|
+
];
|
|
72
|
+
async function defaultProviders(env = process.env) {
|
|
29
73
|
const providers = [
|
|
30
74
|
openverse(),
|
|
31
75
|
openverseAudio(),
|
|
@@ -39,24 +83,22 @@ function defaultProviders(env = process.env) {
|
|
|
39
83
|
ambientcg(),
|
|
40
84
|
internetArchive()
|
|
41
85
|
];
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (jamendoClientId) providers.push(jamendo({ clientId: jamendoClientId }));
|
|
59
|
-
if (europeanaKey) providers.push(europeana({ apiKey: europeanaKey }));
|
|
86
|
+
const loaded = await Promise.all(BYOK_SOURCES.map(async (source) => {
|
|
87
|
+
const key = source.key(env);
|
|
88
|
+
if (!key) return [];
|
|
89
|
+
try {
|
|
90
|
+
return await source.load(key);
|
|
91
|
+
} catch (err) {
|
|
92
|
+
const code = err?.code;
|
|
93
|
+
if (code === "ERR_MODULE_NOT_FOUND" || code === "MODULE_NOT_FOUND") {
|
|
94
|
+
console.error(`[refkit-mcp] key for ${source.pkg} is set but the package is not installed \u2014 skipping this source. Reinstall @refkit/mcp with optional dependencies (or add ${source.pkg}) to enable it.`);
|
|
95
|
+
} else {
|
|
96
|
+
console.error(`[refkit-mcp] failed to initialize ${source.pkg} \u2014 skipping this source.`, err);
|
|
97
|
+
}
|
|
98
|
+
return [];
|
|
99
|
+
}
|
|
100
|
+
}));
|
|
101
|
+
for (const group of loaded) providers.push(...group);
|
|
60
102
|
return providers;
|
|
61
103
|
}
|
|
62
104
|
var isEntry = (() => {
|
|
@@ -68,9 +110,10 @@ var isEntry = (() => {
|
|
|
68
110
|
}
|
|
69
111
|
})();
|
|
70
112
|
if (isEntry) {
|
|
71
|
-
await serveStdio(createRefkit({ providers: defaultProviders() }));
|
|
113
|
+
await serveStdio(createRefkit({ providers: await defaultProviders() }));
|
|
72
114
|
}
|
|
73
115
|
export {
|
|
116
|
+
BYOK_SOURCES,
|
|
74
117
|
defaultProviders
|
|
75
118
|
};
|
|
76
119
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n// Zero-config entry: `npx @refkit/mcp` boots a working MCP server with the keyless\n// providers, plus any BYOK provider whose key is in the environment. No host code.\nimport { realpathSync } from 'node:fs'\nimport { fileURLToPath } from 'node:url'\nimport { createRefkit, type ReferenceProvider } from '@refkit/core'\nimport { openverse, openverseAudio } from '@refkit/provider-openverse'\nimport { wikimediaCommons } from '@refkit/provider-wikimedia-commons'\nimport { met } from '@refkit/provider-met'\nimport { artic } from '@refkit/provider-artic'\nimport { gutendex } from '@refkit/provider-gutendex'\nimport { poetrydb } from '@refkit/provider-poetrydb'\nimport {
|
|
1
|
+
{"version":3,"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n// Zero-config entry: `npx @refkit/mcp` boots a working MCP server with the keyless\n// providers, plus any BYOK provider whose key is in the environment. No host code.\nimport { realpathSync } from 'node:fs'\nimport { fileURLToPath } from 'node:url'\nimport { createRefkit, type ReferenceProvider } from '@refkit/core'\nimport { openverse, openverseAudio } from '@refkit/provider-openverse'\nimport { wikimediaCommons } from '@refkit/provider-wikimedia-commons'\nimport { met } from '@refkit/provider-met'\nimport { artic } from '@refkit/provider-artic'\nimport { gutendex } from '@refkit/provider-gutendex'\nimport { poetrydb } from '@refkit/provider-poetrydb'\nimport { rijksmuseum } from '@refkit/provider-rijksmuseum'\nimport { polyhaven, ambientcg } from '@refkit/provider-polyhaven'\nimport { internetArchive } from '@refkit/provider-internet-archive'\nimport { serveStdio } from './index'\n\n/** One BYOK source: its unified + legacy env var names, and a lazy loader for its\n * (optional) provider package. Loaded only when a key is present, so installs\n * that omitted optionalDependencies still boot — the missing source is skipped\n * with a stderr warning instead of crashing the server. */\ninterface ByokSource {\n pkg: string\n key: (env: NodeJS.ProcessEnv) => string | undefined\n load: (key: string) => Promise<ReferenceProvider[]>\n}\n\n// Env var convention: each BYOK key is read as `REFKIT_<PROVIDER>_KEY` first (the\n// unified name), falling back to the provider's legacy env var name — both are\n// honored indefinitely, the unified name is just preferred going forward.\n// Exported so tests can assert this table stays in sync with the package's\n// optionalDependencies — an entry in one but not the other ships a source that\n// either can never load or never installs.\nexport const BYOK_SOURCES: ByokSource[] = [\n {\n pkg: '@refkit/provider-unsplash',\n key: (env) => env.REFKIT_UNSPLASH_KEY ?? env.UNSPLASH_KEY,\n load: async (accessKey) => [(await import('@refkit/provider-unsplash')).unsplash({ accessKey })],\n },\n {\n pkg: '@refkit/provider-pexels',\n key: (env) => env.REFKIT_PEXELS_KEY ?? env.PEXELS_KEY,\n load: async (apiKey) => {\n const m = await import('@refkit/provider-pexels')\n return [m.pexels({ apiKey }), m.pexelsVideo({ apiKey })]\n },\n },\n {\n pkg: '@refkit/provider-pixabay',\n key: (env) => env.REFKIT_PIXABAY_KEY ?? env.PIXABAY_KEY,\n load: async (key) => {\n const m = await import('@refkit/provider-pixabay')\n return [m.pixabay({ key }), m.pixabayVideo({ key })]\n },\n },\n {\n pkg: '@refkit/provider-flickr',\n key: (env) => env.REFKIT_FLICKR_KEY ?? env.FLICKR_KEY,\n load: async (apiKey) => [(await import('@refkit/provider-flickr')).flickr({ apiKey })],\n },\n {\n pkg: '@refkit/provider-smithsonian',\n key: (env) => env.REFKIT_SMITHSONIAN_KEY ?? env.SI_KEY,\n load: async (apiKey) => [(await import('@refkit/provider-smithsonian')).smithsonian({ apiKey })],\n },\n {\n pkg: '@refkit/provider-brave',\n key: (env) => env.REFKIT_BRAVE_KEY ?? env.BRAVE_TOKEN,\n load: async (token) => [(await import('@refkit/provider-brave')).brave({ token })],\n },\n {\n pkg: '@refkit/provider-freesound',\n key: (env) => env.REFKIT_FREESOUND_KEY ?? env.FREESOUND_TOKEN,\n load: async (apiKey) => [(await import('@refkit/provider-freesound')).freesound({ apiKey })],\n },\n {\n pkg: '@refkit/provider-jamendo',\n key: (env) => env.REFKIT_JAMENDO_CLIENT_ID ?? env.JAMENDO_CLIENT_ID,\n load: async (clientId) => [(await import('@refkit/provider-jamendo')).jamendo({ clientId })],\n },\n {\n pkg: '@refkit/provider-europeana',\n key: (env) => env.REFKIT_EUROPEANA_KEY ?? env.EUROPEANA_KEY,\n load: async (apiKey) => [(await import('@refkit/provider-europeana')).europeana({ apiKey })],\n },\n]\n\n/** Providers a zero-config server boots with: all keyless sources (hard deps,\n * statically imported), plus any BYOK source whose key is present in `env`\n * (optionalDependencies, dynamically imported on demand). Exported so the\n * wiring is unit-testable. */\nexport async function defaultProviders(env: NodeJS.ProcessEnv = process.env): Promise<ReferenceProvider[]> {\n const providers: ReferenceProvider[] = [\n openverse(), openverseAudio(), wikimediaCommons(), met(), artic(), gutendex(), poetrydb(),\n rijksmuseum(), polyhaven(), ambientcg(), internetArchive(),\n ]\n // Independent module loads — run them concurrently (startup cost = max, not sum)\n // and keep BYOK_SOURCES order in the provider list.\n const loaded = await Promise.all(BYOK_SOURCES.map(async (source) => {\n const key = source.key(env)\n if (!key) return []\n try {\n return await source.load(key)\n } catch (err) {\n // stderr only — stdout is the MCP transport. Only a genuinely missing\n // module gets the \"not installed\" hint; anything else (factory throw,\n // broken transitive import) surfaces the REAL error so the operator\n // doesn't chase the wrong remediation.\n const code = (err as { code?: string } | null)?.code\n if (code === 'ERR_MODULE_NOT_FOUND' || code === 'MODULE_NOT_FOUND') {\n console.error(`[refkit-mcp] key for ${source.pkg} is set but the package is not installed — skipping this source. Reinstall @refkit/mcp with optional dependencies (or add ${source.pkg}) to enable it.`)\n } else {\n console.error(`[refkit-mcp] failed to initialize ${source.pkg} — skipping this source.`, err)\n }\n return []\n }\n }))\n for (const group of loaded) providers.push(...group)\n return providers\n}\n\n// Boot only when run as the CLI entry — not when imported (e.g. by tests). realpath\n// so an npm bin symlink resolves to this file.\nconst isEntry = (() => {\n if (!process.argv[1]) return false\n try {\n return realpathSync(process.argv[1]) === fileURLToPath(import.meta.url)\n } catch {\n return false\n }\n})()\n\nif (isEntry) {\n await serveStdio(createRefkit({ providers: await defaultProviders() }))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AClE,UAAM,MAAM,OAAO,IAAI,GAAG;AAC1B,QAAI,CAAC,IAAK,QAAO,CAAC;AAClB,QAAI;AACF,aAAO,MAAM,OAAO,KAAK,GAAG;AAAA,IAC9B,SAAS,KAAK;AAKZ,YAAM,OAAQ,KAAkC;AAChD,UAAI,SAAS,0BAA0B,SAAS,oBAAoB;AAClE,gBAAQ,MAAM,wBAAwB,OAAO,GAAG,kIAA6H,OAAO,GAAG,iBAAiB;AAAA,MAC1M,OAAO;AACL,gBAAQ,MAAM,qCAAqC,OAAO,GAAG,iCAA4B,GAAG;AAAA,MAC9F;AACA,aAAO,CAAC;AAAA,IACV;AAAA,EACF,CAAC,CAAC;AACF,aAAW,SAAS,OAAQ,WAAU,KAAK,GAAG,KAAK;AACnD,SAAO;AACT;AAIA,IAAM,WAAW,MAAM;AACrB,MAAI,CAAC,QAAQ,KAAK,CAAC,EAAG,QAAO;AAC7B,MAAI;AACF,WAAO,aAAa,QAAQ,KAAK,CAAC,CAAC,MAAM,cAAc,YAAY,GAAG;AAAA,EACxE,QAAQ;AACN,WAAO;AAAA,EACT;AACF,GAAG;AAEH,IAAI,SAAS;AACX,QAAM,WAAW,aAAa,EAAE,WAAW,MAAM,iBAAiB,EAAE,CAAC,CAAC;AACxE;","names":[]}
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@refkit/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "MCP server for refkit — exposes license-normalized reference search as an agent tool.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/refkitjs/refkit.git",
|
|
10
|
+
"directory": "packages/mcp"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/refkitjs/refkit/tree/main/packages/mcp#readme",
|
|
13
|
+
"bugs": "https://github.com/refkitjs/refkit/issues",
|
|
7
14
|
"keywords": [
|
|
8
15
|
"refkit",
|
|
9
16
|
"mcp",
|
|
@@ -27,30 +34,32 @@
|
|
|
27
34
|
"dependencies": {
|
|
28
35
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
29
36
|
"zod": "^4.3.6",
|
|
30
|
-
"@refkit/core": "0.
|
|
31
|
-
"@refkit/provider-artic": "0.2.
|
|
32
|
-
"@refkit/provider-
|
|
33
|
-
"@refkit/provider-
|
|
34
|
-
"@refkit/provider-
|
|
35
|
-
"@refkit/provider-
|
|
36
|
-
"@refkit/provider-
|
|
37
|
-
"@refkit/provider-
|
|
38
|
-
"@refkit/provider-
|
|
39
|
-
"@refkit/provider-
|
|
40
|
-
"@refkit/provider-openverse": "0.3.0",
|
|
41
|
-
"@refkit/provider-pexels": "0.2.2",
|
|
42
|
-
"@refkit/provider-pixabay": "0.2.2",
|
|
43
|
-
"@refkit/provider-poetrydb": "0.2.2",
|
|
44
|
-
"@refkit/provider-polyhaven": "0.2.1",
|
|
45
|
-
"@refkit/provider-rijksmuseum": "0.2.1",
|
|
46
|
-
"@refkit/provider-smithsonian": "0.2.2",
|
|
47
|
-
"@refkit/provider-unsplash": "0.2.2",
|
|
48
|
-
"@refkit/provider-wikimedia-commons": "0.3.0"
|
|
37
|
+
"@refkit/core": "0.7.0",
|
|
38
|
+
"@refkit/provider-artic": "0.2.4",
|
|
39
|
+
"@refkit/provider-gutendex": "0.2.4",
|
|
40
|
+
"@refkit/provider-internet-archive": "0.3.2",
|
|
41
|
+
"@refkit/provider-met": "0.2.4",
|
|
42
|
+
"@refkit/provider-openverse": "0.3.2",
|
|
43
|
+
"@refkit/provider-poetrydb": "0.2.4",
|
|
44
|
+
"@refkit/provider-polyhaven": "0.2.3",
|
|
45
|
+
"@refkit/provider-rijksmuseum": "0.2.3",
|
|
46
|
+
"@refkit/provider-wikimedia-commons": "0.3.2"
|
|
49
47
|
},
|
|
50
48
|
"files": [
|
|
51
49
|
"dist",
|
|
52
50
|
"LICENSE"
|
|
53
51
|
],
|
|
52
|
+
"optionalDependencies": {
|
|
53
|
+
"@refkit/provider-brave": "0.2.4",
|
|
54
|
+
"@refkit/provider-europeana": "0.3.2",
|
|
55
|
+
"@refkit/provider-flickr": "0.3.2",
|
|
56
|
+
"@refkit/provider-freesound": "0.3.2",
|
|
57
|
+
"@refkit/provider-jamendo": "0.3.2",
|
|
58
|
+
"@refkit/provider-pexels": "0.2.4",
|
|
59
|
+
"@refkit/provider-pixabay": "0.2.4",
|
|
60
|
+
"@refkit/provider-smithsonian": "0.2.4",
|
|
61
|
+
"@refkit/provider-unsplash": "0.2.4"
|
|
62
|
+
},
|
|
54
63
|
"scripts": {
|
|
55
64
|
"typecheck": "tsc --noEmit",
|
|
56
65
|
"test": "vitest run",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { readFileSync } from 'node:fs'\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'\nimport { z } from 'zod'\nimport { LICENSE_IDS, INTENTS, evaluateUse, buildAttribution, ccVersionFor } from '@refkit/core'\nimport type { RefkitClient, Reference, Verdict, Attribution, SearchFilters, SearchControls, SearchControlKey, ProviderOptionsById, SearchMeta, RightsRecord } from '@refkit/core'\n\nconst MODALITIES = ['image', 'video', 'audio', 'text'] as const\nconst ORIENTATIONS = ['landscape', 'portrait', 'square'] as const\nconst SEARCH_CONTROL_KEYS = [\n 'orientation',\n 'color',\n 'language',\n 'sort',\n 'safety',\n 'license.commercial',\n 'license.modification',\n 'license.allowUnknown',\n 'media.kind',\n 'media.size',\n 'media.minWidth',\n 'media.minHeight',\n 'media.duration',\n 'creator.id',\n 'creator.name',\n 'text.copyright',\n 'page',\n] as const satisfies readonly SearchControlKey[]\n\nconst filtersSchema = z.object({\n color: z.string().optional(),\n orientation: z.enum(ORIENTATIONS).optional(),\n language: z.string().optional(),\n})\nconst searchControlKeySchema = z.enum(SEARCH_CONTROL_KEYS)\n\nconst searchControlsSchema = z.object({\n orientation: z.enum(ORIENTATIONS).optional(),\n color: z.string().optional(),\n language: z.string().optional(),\n sort: z.enum(['relevance', 'latest', 'popular', 'interesting']).optional(),\n safety: z.enum(['strict', 'moderate', 'off']).optional(),\n license: z.object({\n commercial: z.boolean().optional(),\n modification: z.boolean().optional(),\n allowUnknown: z.boolean().optional(),\n }).optional(),\n media: z.object({\n kind: z.enum(['photo', 'illustration', 'vector', 'film', 'animation']).optional(),\n size: z.enum(['small', 'medium', 'large']).optional(),\n minWidth: z.number().int().nonnegative().optional(),\n minHeight: z.number().int().nonnegative().optional(),\n duration: z.enum(['short', 'medium', 'long']).optional(),\n }).optional(),\n creator: z.object({\n id: z.string().optional(),\n name: z.string().optional(),\n }).optional(),\n text: z.object({\n copyright: z.enum(['public-domain', 'copyrighted', 'any']).optional(),\n }).optional(),\n page: z.number().int().positive().optional(),\n})\n\nconst providerOptionValueSchema = z.union([z.string(), z.number(), z.boolean(), z.array(z.string())])\nconst providerOptionsSchema = z.record(z.string(), z.record(z.string(), providerOptionValueSchema))\n\n// Reported in the MCP initialize handshake. Read the real version (the dist sits\n// next to package.json, which npm always ships) instead of a hardcoded placeholder.\nconst VERSION: string = (() => {\n try {\n return JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version\n } catch {\n return '0.0.0'\n }\n})()\n\n// Concise, agent-facing projection of a Reference (no raw provider dump). When an\n// intent is supplied the use-gate verdict + attribution ride along, so the agent\n// sees *whether it may use* each result — not just a bare license id it ignores.\nfunction toAgentRef(r: Reference, assessment?: { verdict: Verdict; attribution: Attribution }) {\n const base = {\n id: r.id,\n title: r.title,\n modality: r.modality,\n provider: r.source.providerId,\n canonicalUrl: r.canonicalUrl,\n license: r.rights.license,\n thumbnail: r.thumbnail?.url,\n excerpt: r.text?.excerpt,\n }\n if (!assessment) return base\n const { verdict, attribution } = assessment\n const reason = verdict.reasons.join('; ')\n const useExplanation = `${verdict.decision}: ${reason || 'license facts allow this use'}${attribution.required && attribution.text ? ` Attribution required: ${attribution.text}` : ''}`\n return {\n ...base,\n useVerdict: { decision: verdict.decision, reason: verdict.reasons.join('; '), confidence: verdict.confidence },\n useExplanation,\n ...(attribution.required && attribution.text ? { attribution: attribution.text } : {}),\n }\n}\n\nconst agentRefSchema = z.object({\n id: z.string(),\n title: z.string().optional(),\n modality: z.string(),\n provider: z.string(),\n canonicalUrl: z.string(),\n license: z.string(),\n thumbnail: z.string().optional(),\n excerpt: z.string().optional(),\n useVerdict: z\n .object({ decision: z.string(), reason: z.string(), confidence: z.string() })\n .optional()\n .describe('present when `intent` (or `gateFor`) is set: may this be used for that intent, and how confident'),\n useExplanation: z.string().optional().describe('plain-language use verdict summary for agents'),\n attribution: z.string().optional().describe('ready-to-use credit line; present when the license requires attribution'),\n})\n\nconst searchMetaSchema: z.ZodType<SearchMeta> = z.object({\n query: z.string(),\n modalities: z.array(z.enum(MODALITIES)),\n limit: z.number(),\n poolFactor: z.number(),\n fetchLimit: z.number(),\n appliedFilters: filtersSchema.optional(),\n controls: z.object({\n requested: z.array(searchControlKeySchema),\n appliedByProvider: z.record(z.string(), z.array(searchControlKeySchema)),\n ignoredByProvider: z.record(z.string(), z.array(searchControlKeySchema)),\n }).optional(),\n providerOptions: z.array(z.string()).optional(),\n providers: z.array(z.object({\n providerId: z.string(),\n status: z.enum(['fulfilled', 'failed', 'skipped']),\n returned: z.number().optional(),\n accepted: z.number().optional(),\n rejected: z.number().optional(),\n reason: z.enum(['unsupported-modality']).optional(),\n error: z.string().optional(),\n latencyMs: z.number().optional(),\n cached: z.boolean().optional(),\n })),\n gate: z.object({\n intent: z.enum(INTENTS),\n before: z.number(),\n after: z.number(),\n dropped: z.number(),\n }).optional(),\n warnings: z.array(z.string()),\n})\n\n/** Wrap a configured RefkitClient as an MCP server exposing `search_references`. */\nexport function createRefkitMcpServer(refkit: RefkitClient): McpServer {\n const server = new McpServer({ name: 'refkit', version: VERSION })\n\n server.registerTool(\n 'search_references',\n {\n title: 'Search creative references',\n description:\n 'Search license-normalized reference material (image / video / audio / text) across the configured sources. ' +\n 'Every result carries a license id + canonical source link. Pass `intent` to annotate each result with a ' +\n 'use-verdict (may I use this, is attribution required) WITHOUT filtering; pass `gateFor` to instead return ' +\n 'only results whose license allows that intent. Results are references, not rights clearance — not legal advice.',\n inputSchema: {\n query: z.string().describe('what to search for, e.g. \"cyberpunk alley at night\"'),\n modalities: z.array(z.enum(MODALITIES)).optional().describe('default [\"image\"]'),\n filters: filtersSchema.optional().describe('compatibility alias for controls.orientation, controls.color, and controls.language'),\n controls: searchControlsSchema.optional().describe('provider-neutral search controls; providers translate supported controls and report ignored controls in explain metadata'),\n providerOptions: providerOptionsSchema.optional().describe('provider-specific search controls keyed by provider id; each provider whitelists supported keys'),\n explain: z.boolean().optional().describe('include provider status, applied and ignored controls, warnings, and gate/drop metadata'),\n limit: z.number().int().positive().optional(),\n intent: z.enum(INTENTS).optional().describe('annotate each result with a use-verdict for this intended use (no filtering)'),\n gateFor: z.enum(INTENTS).optional().describe('only return results whose license allows this intended use'),\n },\n outputSchema: { references: z.array(agentRefSchema), meta: searchMetaSchema.optional() },\n },\n async ({ query, modalities, filters, controls, providerOptions, explain, limit, intent, gateFor }) => {\n const searchInput = {\n query,\n modalities: modalities ?? ['image'],\n filters: filters as SearchFilters | undefined,\n controls: controls as SearchControls | undefined,\n providerOptions: providerOptions as ProviderOptionsById | undefined,\n limit,\n gateFor,\n }\n const result = explain ? await refkit.searchWithMeta(searchInput) : { references: await refkit.search(searchInput), meta: undefined }\n const refs = result.references\n const assessIntent = intent ?? gateFor\n const references = refs.map(r =>\n assessIntent\n ? toAgentRef(r, { verdict: refkit.evaluateUse(r, assessIntent), attribution: refkit.buildAttribution(r) })\n : toAgentRef(r),\n )\n return {\n content: [{ type: 'text', text: `${references.length} reference(s) for \"${query}\".` }],\n structuredContent: { references, ...(result.meta ? { meta: result.meta } : {}) },\n }\n },\n )\n\n const attributionOutputSchema = { required: z.boolean(), text: z.string().optional(), html: z.string().optional() }\n\n server.registerTool(\n 'evaluate_use',\n {\n title: 'Evaluate a license for an intended use',\n description:\n 'Stateless license/use-gate check: given a license id + intended use, returns a conservative-heuristic verdict ' +\n '(allowed / allowed-with-attribution / denied / needs-review) with reasons and confidence. ' +\n 'Not legal advice — a strict-deny heuristic over source-declared license facts.',\n inputSchema: {\n license: z.enum(LICENSE_IDS).describe('the reference\\'s license id'),\n licenseVersion: z.string().optional().describe('precise CC version, e.g. \"4.0\" — attribution only'),\n author: z.string().optional(),\n title: z.string().optional(),\n canonicalUrl: z.string().describe('canonical source link, for attribution and audit'),\n intent: z.enum(INTENTS).describe('the intended use to evaluate this license against'),\n editorialOnly: z.boolean().optional().describe('source marked editorial-only'),\n jurisdiction: z.string().optional().describe('source-declared jurisdiction of the PD/copyright status'),\n userJurisdiction: z.string().optional().describe('caller\\'s jurisdiction; mismatched jurisdictions default to needs-review'),\n },\n outputSchema: {\n decision: z.enum(['allowed', 'allowed-with-attribution', 'denied', 'needs-review']),\n reasons: z.array(z.string()),\n confidence: z.enum(['high', 'low']),\n disclaimer: z.string(),\n attribution: z.object(attributionOutputSchema).optional(),\n },\n },\n async ({ license, licenseVersion, author, title, canonicalUrl, intent, editorialOnly, jurisdiction, userJurisdiction }) => {\n const version = ccVersionFor(license, licenseVersion)\n const rights: RightsRecord = {\n license,\n licenseVersion: version,\n author,\n rehostPolicy: 'cache-allowed',\n jurisdiction,\n editorialOnly,\n raw: { sourceTerms: '', sourceUrl: canonicalUrl },\n }\n const verdict: Verdict = evaluateUse(rights, intent, { userJurisdiction })\n const attribution =\n verdict.decision === 'allowed-with-attribution'\n ? buildAttribution({ license, licenseVersion: version, author, title, canonicalUrl })\n : undefined\n const summary = `${verdict.decision}: ${verdict.reasons.join('; ') || 'license facts allow this use'}`\n return {\n content: [{ type: 'text', text: summary }],\n structuredContent: {\n decision: verdict.decision,\n reasons: verdict.reasons,\n confidence: verdict.confidence,\n disclaimer: verdict.disclaimer,\n ...(attribution ? { attribution } : {}),\n },\n }\n },\n )\n\n server.registerTool(\n 'build_attribution',\n {\n title: 'Build an attribution credit line',\n description:\n 'Mechanically derive an attribution credit line (plain text + HTML) from a license id + author + title + ' +\n 'canonicalUrl. `required` is false when the license needs no attribution (e.g. CC0, PD).',\n inputSchema: {\n license: z.enum(LICENSE_IDS),\n licenseVersion: z.string().optional().describe('precise CC version, e.g. \"4.0\" — appended to the license name'),\n author: z.string().optional(),\n title: z.string().optional(),\n canonicalUrl: z.string(),\n },\n outputSchema: attributionOutputSchema,\n },\n async ({ license, licenseVersion, author, title, canonicalUrl }) => {\n const version = ccVersionFor(license, licenseVersion)\n const attribution: Attribution = buildAttribution({ license, licenseVersion: version, author, title, canonicalUrl })\n return {\n content: [{ type: 'text', text: attribution.required ? (attribution.text ?? '') : 'No attribution required for this license.' }],\n structuredContent: { required: attribution.required, text: attribution.text, html: attribution.html },\n }\n },\n )\n\n return server\n}\n\n/** Run the refkit MCP server over stdio (host wires the RefkitClient + its providers/keys). */\nexport async function serveStdio(refkit: RefkitClient): Promise<void> {\n const server = createRefkitMcpServer(refkit)\n await server.connect(new StdioServerTransport())\n}\n"],"mappings":";AAAA,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;AACrC,SAAS,SAAS;AAClB,SAAS,aAAa,SAAS,aAAa,kBAAkB,oBAAoB;AAGlF,IAAM,aAAa,CAAC,SAAS,SAAS,SAAS,MAAM;AACrD,IAAM,eAAe,CAAC,aAAa,YAAY,QAAQ;AACvD,IAAM,sBAAsB;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,I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