ask-refined-element-mcp 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.
- package/LICENSE +21 -0
- package/README.md +235 -0
- package/dist/api.d.ts +101 -0
- package/dist/api.js +212 -0
- package/dist/api.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +12 -0
- package/dist/server.js +162 -0
- package/dist/server.js.map +1 -0
- package/dist/tools.d.ts +53 -0
- package/dist/tools.js +668 -0
- package/dist/tools.js.map +1 -0
- package/dist/types.d.ts +104 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +53 -0
package/dist/server.js
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP server wiring for Ask Refined Element.
|
|
3
|
+
*
|
|
4
|
+
* Registers six tools over a shared {@link AskReClient}. Tool descriptions
|
|
5
|
+
* are written for agent consumption (what you get, when to use it) and mirror
|
|
6
|
+
* the product's Agent Endpoints spec. The heavy lifting lives in tools.ts.
|
|
7
|
+
*/
|
|
8
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
import { AskReClient } from "./api.js";
|
|
11
|
+
import { getArticle, getChecklist, getPaidPlaybook, listArticles, requestConsultation, searchKnowledge, } from "./tools.js";
|
|
12
|
+
export const SERVER_NAME = "ask-refined-element";
|
|
13
|
+
export const SERVER_VERSION = "0.1.0";
|
|
14
|
+
/**
|
|
15
|
+
* Known taxonomy values, listed in the tool descriptions as EXAMPLES only.
|
|
16
|
+
* The knowledge pack is CMS-managed (Xperience by Kentico) and the filter is a
|
|
17
|
+
* plain client-side string match, so these are deliberately NOT baked into the
|
|
18
|
+
* schema as enums — new CMS values must keep working in already-installed
|
|
19
|
+
* copies of this package.
|
|
20
|
+
*/
|
|
21
|
+
const KNOWN_TOPICS = ["kentico-upgrades", "geo", "ai-development", "sentinel", "cms-architecture"];
|
|
22
|
+
const KNOWN_AUDIENCES = ["developer", "marketer", "decision-maker", "agent"];
|
|
23
|
+
const SEARCH_DESCRIPTION = "Full-text search over the Ask Refined Element knowledge pack — blog articles, FAQs, case " +
|
|
24
|
+
"studies, services, checklists, and premium playbooks covering Xperience by Kentico upgrades, " +
|
|
25
|
+
"GEO (generative engine optimization), AI-driven development, Sentinel for Xperience by Kentico, " +
|
|
26
|
+
"and CMS architecture. Returns ranked matches, each with an answer-first summary you can cite " +
|
|
27
|
+
"directly or use to decide which item to fetch in full. Blog articles, FAQs, case studies, and " +
|
|
28
|
+
"services are read in full with get_article. Free checklists are fetched in full with " +
|
|
29
|
+
"get_checklist. Premium items return a summary and slug only — retrieve their full body with " +
|
|
30
|
+
"get_paid_playbook. Use this as the entry point whenever you need Refined Element's expertise on " +
|
|
31
|
+
"Kentico, GEO, or agent-ready CMS.";
|
|
32
|
+
const LIST_ARTICLES_DESCRIPTION = "List the most recent posts from the Refined Element blog — each with its title, publish date, " +
|
|
33
|
+
"a one-line summary, and the slug to read it in full. Use this to see what Refined Element has " +
|
|
34
|
+
"published on Xperience by Kentico, GEO, AI-driven development, and agent commerce, then call " +
|
|
35
|
+
"get_article(slug) for the complete text. Returns newest-first, up to 50 (default 10).";
|
|
36
|
+
const GET_ARTICLE_DESCRIPTION = "Read one full Refined Element blog article by slug (get slugs from list_articles or " +
|
|
37
|
+
"search_refined_element_knowledge). Returns the title, publish date, summary, and the complete " +
|
|
38
|
+
"article body converted from HTML to readable text — headings, lists, and links preserved — plus " +
|
|
39
|
+
"the canonical URL. Unknown slugs return a not-found result.";
|
|
40
|
+
const REQUEST_CONSULTATION_DESCRIPTION = "Send a consultation request straight to Mike Rahel at Refined Element — for Xperience by Kentico " +
|
|
41
|
+
"upgrades, AI-driven development, or agent-first (GEO) work. Submit your name, email, and message; " +
|
|
42
|
+
"Mike reads every one personally, so include enough context (what you're building, your Kentico " +
|
|
43
|
+
"version, timeline) for him to act on it. Set priority: true to flag the request as urgent so Mike " +
|
|
44
|
+
"sees the urgency — priority is free, no payment required.";
|
|
45
|
+
const CHECKLIST_DESCRIPTION = "Fetch one full free checklist from the Ask Refined Element pack by slug " +
|
|
46
|
+
"(e.g. geo-readiness-checklist-basic). Returns the checklist's title, summary, topic, " +
|
|
47
|
+
"audience, and complete ordered steps — each with its one-line action and an explanatory " +
|
|
48
|
+
"sentence — ready to follow, quote, or hand to a user. If the slug names a premium checklist " +
|
|
49
|
+
"the response explains it is paid and points you to get_paid_playbook. Unknown slugs return a " +
|
|
50
|
+
"not-found result. Get valid slugs from search_refined_element_knowledge.";
|
|
51
|
+
const PLAYBOOK_DESCRIPTION = "Retrieve one premium item from the Ask Refined Element pack by slug. Premium items are " +
|
|
52
|
+
"L402-gated (typically 100 sats); discover them and their slugs with " +
|
|
53
|
+
"search_refined_element_knowledge — they are marked [PREMIUM]. Call this tool FIRST with only " +
|
|
54
|
+
"the slug: the endpoint answers HTTP 402 Payment Required with a Lightning invoice and a " +
|
|
55
|
+
"macaroon, which this tool returns as structured payment instructions. Pay the invoice (the " +
|
|
56
|
+
"free Lightning Enable MCP server can do this automatically " +
|
|
57
|
+
"— github.com/refined-element/lightning-enable-mcp), then call this tool AGAIN with the same " +
|
|
58
|
+
"slug plus the macaroon and the payment preimage to receive the full content.";
|
|
59
|
+
export function createServer(clientOptions = {}) {
|
|
60
|
+
const client = new AskReClient(clientOptions);
|
|
61
|
+
const server = new McpServer({ name: SERVER_NAME, version: SERVER_VERSION });
|
|
62
|
+
server.registerTool("search_refined_element_knowledge", {
|
|
63
|
+
title: "Search Refined Element knowledge",
|
|
64
|
+
description: SEARCH_DESCRIPTION,
|
|
65
|
+
inputSchema: {
|
|
66
|
+
query: z.string().min(1).describe("Search terms (required)."),
|
|
67
|
+
topic: z
|
|
68
|
+
.string()
|
|
69
|
+
.optional()
|
|
70
|
+
.describe("Optional topic filter applied to the returned matches (exact string match). " +
|
|
71
|
+
`Known topics include: ${KNOWN_TOPICS.join(", ")}. ` +
|
|
72
|
+
"The pack is CMS-managed, so new topics may appear — any string is accepted."),
|
|
73
|
+
audience: z
|
|
74
|
+
.string()
|
|
75
|
+
.optional()
|
|
76
|
+
.describe("Optional audience filter applied to the returned matches (exact string match). " +
|
|
77
|
+
`Known audiences include: ${KNOWN_AUDIENCES.join(", ")}. ` +
|
|
78
|
+
"The pack is CMS-managed, so new audiences may appear — any string is accepted."),
|
|
79
|
+
limit: z
|
|
80
|
+
.number()
|
|
81
|
+
.int()
|
|
82
|
+
.min(1)
|
|
83
|
+
.max(20)
|
|
84
|
+
.optional()
|
|
85
|
+
.describe("Maximum number of matches to return (default 5, max 20)."),
|
|
86
|
+
},
|
|
87
|
+
}, async (args) => searchKnowledge(client, args));
|
|
88
|
+
server.registerTool("get_checklist", {
|
|
89
|
+
title: "Get a free checklist",
|
|
90
|
+
description: CHECKLIST_DESCRIPTION,
|
|
91
|
+
inputSchema: {
|
|
92
|
+
slug: z
|
|
93
|
+
.string()
|
|
94
|
+
.min(1)
|
|
95
|
+
.describe("Checklist slug, e.g. geo-readiness-checklist-basic."),
|
|
96
|
+
},
|
|
97
|
+
}, async ({ slug }) => getChecklist(client, slug));
|
|
98
|
+
server.registerTool("get_paid_playbook", {
|
|
99
|
+
title: "Get a premium (L402-paid) playbook",
|
|
100
|
+
description: PLAYBOOK_DESCRIPTION,
|
|
101
|
+
inputSchema: {
|
|
102
|
+
slug: z
|
|
103
|
+
.string()
|
|
104
|
+
.min(1)
|
|
105
|
+
.describe("Premium item slug, as discovered via search_refined_element_knowledge " +
|
|
106
|
+
"(premium matches are marked [PREMIUM] and include their slug)."),
|
|
107
|
+
macaroon: z
|
|
108
|
+
.string()
|
|
109
|
+
.optional()
|
|
110
|
+
.describe("The macaroon from the 402 challenge. Omit on the first call."),
|
|
111
|
+
preimage: z
|
|
112
|
+
.string()
|
|
113
|
+
.optional()
|
|
114
|
+
.describe("The Lightning payment preimage proving you settled the invoice. Omit on the first call."),
|
|
115
|
+
},
|
|
116
|
+
}, async (args) => getPaidPlaybook(client, args));
|
|
117
|
+
server.registerTool("list_articles", {
|
|
118
|
+
title: "List recent blog articles",
|
|
119
|
+
description: LIST_ARTICLES_DESCRIPTION,
|
|
120
|
+
inputSchema: {
|
|
121
|
+
limit: z
|
|
122
|
+
.number()
|
|
123
|
+
.int()
|
|
124
|
+
.min(1)
|
|
125
|
+
.max(50)
|
|
126
|
+
.optional()
|
|
127
|
+
.describe("Maximum number of articles to return (default 10, max 50, newest first)."),
|
|
128
|
+
},
|
|
129
|
+
}, async (args) => listArticles(client, args));
|
|
130
|
+
server.registerTool("get_article", {
|
|
131
|
+
title: "Read a full blog article",
|
|
132
|
+
description: GET_ARTICLE_DESCRIPTION,
|
|
133
|
+
inputSchema: {
|
|
134
|
+
slug: z
|
|
135
|
+
.string()
|
|
136
|
+
.min(1)
|
|
137
|
+
.describe("Article slug, as discovered via list_articles or search_refined_element_knowledge."),
|
|
138
|
+
},
|
|
139
|
+
}, async ({ slug }) => getArticle(client, slug));
|
|
140
|
+
server.registerTool("request_consultation", {
|
|
141
|
+
title: "Request a consultation from Refined Element",
|
|
142
|
+
description: REQUEST_CONSULTATION_DESCRIPTION,
|
|
143
|
+
inputSchema: {
|
|
144
|
+
name: z.string().min(1).describe("Your name (required)."),
|
|
145
|
+
email: z
|
|
146
|
+
.string()
|
|
147
|
+
.min(1)
|
|
148
|
+
.describe("Reply-to email address (required). Shape-checked locally; validated by the API."),
|
|
149
|
+
message: z
|
|
150
|
+
.string()
|
|
151
|
+
.min(1)
|
|
152
|
+
.describe("What you need help with (required). Include enough context for Mike to act on."),
|
|
153
|
+
company: z.string().optional().describe("Your company or project name (optional)."),
|
|
154
|
+
priority: z
|
|
155
|
+
.boolean()
|
|
156
|
+
.optional()
|
|
157
|
+
.describe("Set true to flag the request as urgent (free — no payment). Omit or false for a normal request."),
|
|
158
|
+
},
|
|
159
|
+
}, async (args) => requestConsultation(client, args));
|
|
160
|
+
return server;
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,WAAW,EAA2B,MAAM,UAAU,CAAC;AAChE,OAAO,EACL,UAAU,EACV,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,MAAM,CAAC,MAAM,WAAW,GAAG,qBAAqB,CAAC;AACjD,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC;AAEtC;;;;;;GAMG;AACH,MAAM,YAAY,GAAG,CAAC,kBAAkB,EAAE,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,kBAAkB,CAAC,CAAC;AACnG,MAAM,eAAe,GAAG,CAAC,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAE,OAAO,CAAC,CAAC;AAE7E,MAAM,kBAAkB,GACtB,2FAA2F;IAC3F,+FAA+F;IAC/F,kGAAkG;IAClG,+FAA+F;IAC/F,gGAAgG;IAChG,uFAAuF;IACvF,8FAA8F;IAC9F,kGAAkG;IAClG,mCAAmC,CAAC;AAEtC,MAAM,yBAAyB,GAC7B,gGAAgG;IAChG,gGAAgG;IAChG,+FAA+F;IAC/F,uFAAuF,CAAC;AAE1F,MAAM,uBAAuB,GAC3B,sFAAsF;IACtF,gGAAgG;IAChG,kGAAkG;IAClG,6DAA6D,CAAC;AAEhE,MAAM,gCAAgC,GACpC,mGAAmG;IACnG,oGAAoG;IACpG,iGAAiG;IACjG,oGAAoG;IACpG,2DAA2D,CAAC;AAE9D,MAAM,qBAAqB,GACzB,0EAA0E;IAC1E,uFAAuF;IACvF,0F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.
|
|
3
|
+
*
|
|
4
|
+
* Each exported function takes an {@link AskReClient} plus validated input and
|
|
5
|
+
* resolves to an MCP tool result ({ content, isError }). The logic is kept out
|
|
6
|
+
* of the transport wiring in server.ts so it can be unit-tested by driving a
|
|
7
|
+
* client backed by a mock fetch.
|
|
8
|
+
*/
|
|
9
|
+
import type { AskReClient } from "./api.js";
|
|
10
|
+
export interface ToolResult {
|
|
11
|
+
content: Array<{
|
|
12
|
+
type: "text";
|
|
13
|
+
text: string;
|
|
14
|
+
}>;
|
|
15
|
+
isError?: boolean;
|
|
16
|
+
/** Present so the shape stays assignable to the MCP SDK's CallToolResult. */
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
export interface SearchInput {
|
|
20
|
+
query: string;
|
|
21
|
+
topic?: string;
|
|
22
|
+
audience?: string;
|
|
23
|
+
limit?: number;
|
|
24
|
+
}
|
|
25
|
+
export declare function searchKnowledge(client: AskReClient, input: SearchInput): Promise<ToolResult>;
|
|
26
|
+
export declare function getChecklist(client: AskReClient, slug: string): Promise<ToolResult>;
|
|
27
|
+
export interface PlaybookInput {
|
|
28
|
+
slug: string;
|
|
29
|
+
macaroon?: string;
|
|
30
|
+
preimage?: string;
|
|
31
|
+
}
|
|
32
|
+
export declare function getPaidPlaybook(client: AskReClient, input: PlaybookInput): Promise<ToolResult>;
|
|
33
|
+
export interface ListArticlesInput {
|
|
34
|
+
limit?: number;
|
|
35
|
+
}
|
|
36
|
+
export declare function listArticles(client: AskReClient, input: ListArticlesInput): Promise<ToolResult>;
|
|
37
|
+
export declare function getArticle(client: AskReClient, slug: string): Promise<ToolResult>;
|
|
38
|
+
export interface ConsultationInput {
|
|
39
|
+
name: string;
|
|
40
|
+
email: string;
|
|
41
|
+
message: string;
|
|
42
|
+
company?: string;
|
|
43
|
+
priority?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export declare function requestConsultation(client: AskReClient, input: ConsultationInput): Promise<ToolResult>;
|
|
46
|
+
/**
|
|
47
|
+
* Converts an HTML article body to readable plain text / lightweight Markdown:
|
|
48
|
+
* headings become `#`-prefixed lines, list items become `-` bullets, links
|
|
49
|
+
* become `text (href)`, and paragraph/`<br>` boundaries become blank lines.
|
|
50
|
+
* Everything else is stripped and common HTML entities are decoded. Anchors are
|
|
51
|
+
* resolved BEFORE headings/list items so links survive inside them.
|
|
52
|
+
*/
|
|
53
|
+
export declare function htmlToText(html: string): string;
|