fluentcart-developer 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +37 -1
- package/dist/server.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAGzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAGzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAuE7C,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAqChF"}
|
package/dist/server.js
CHANGED
|
@@ -29,11 +29,47 @@ function skillsCatalog() {
|
|
|
29
29
|
});
|
|
30
30
|
return catalogPromise;
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Sent in the `initialize` handshake and injected into the system prompt by
|
|
34
|
+
* every client that supports the field — Claude Code, OpenCode and DeepSeek
|
|
35
|
+
* Harness all do.
|
|
36
|
+
*
|
|
37
|
+
* This exists because a skill is advisory. A skill file says how to work, but
|
|
38
|
+
* nothing makes a model read it: one that goes straight to the tools gets
|
|
39
|
+
* twelve tools and no rules, which is exactly how a wrong endpoint or an
|
|
40
|
+
* invented hook signature gets written. These instructions arrive before the
|
|
41
|
+
* first turn, so they cannot be skipped.
|
|
42
|
+
*
|
|
43
|
+
* Keep this to what prevents a wrong answer. Every line costs tokens on every
|
|
44
|
+
* session, and the 588 documentation pages stay out deliberately — the tools
|
|
45
|
+
* fetch those on demand.
|
|
46
|
+
*/
|
|
47
|
+
const INSTRUCTIONS = `FluentCart is a WordPress e-commerce plugin with its own REST API, Eloquent models, and 315+ action and filter hooks. None of it can be recalled from general WordPress knowledge: every endpoint path, hook signature and wp_fct_ table is specific to this plugin and changes between versions.
|
|
48
|
+
|
|
49
|
+
Do not answer a FluentCart question from memory. Look it up.
|
|
50
|
+
|
|
51
|
+
Tools:
|
|
52
|
+
- fc_search_docs — find the page. Every query word must match; an optional prefix scopes to restapi/, database/, hooks/ or modules/.
|
|
53
|
+
- fc_get_reference — read one page by path, or one heading inside it.
|
|
54
|
+
- fc_search_hooks — an action or filter, by name or domain.
|
|
55
|
+
- fc_get_db_schema — one wp_fct_* table.
|
|
56
|
+
- fc_generate_payment_gateway_boilerplate, fc_generate_licensing_boilerplate, fc_generate_customer_endpoint_boilerplate, fc_generate_device_licensing_boilerplate, fc_generate_trial_guard_boilerplate, fc_generate_client_sdk, fc_generate_native_client — working code. Prefer these to hand-writing: they already encode the hooks, the order they fire in, and the response shapes.
|
|
57
|
+
|
|
58
|
+
Read the page before writing code that depends on it. A signature you did not read is a signature you invented. Cite the page you used, for example restapi/operations/orders/get-orders.md.
|
|
59
|
+
|
|
60
|
+
Rules that keep the generated code correct:
|
|
61
|
+
- Never modify FluentCart core. Extend through hooks, filters and documented extension points. A core edit is lost on update and is not a supported integration.
|
|
62
|
+
- Prefix every function and hook with your own plugin prefix, never fluentcart_ or fct_.
|
|
63
|
+
- Every PHP file starts with: defined('ABSPATH') || exit;
|
|
64
|
+
- Sanitize input, escape all output, and check current_user_can on every admin action and REST route.
|
|
65
|
+
- Ask the user for the productId, class prefix and namespace. Do not guess them.
|
|
66
|
+
|
|
67
|
+
When the documentation and the user's existing code disagree, say so instead of silently picking one.`;
|
|
32
68
|
export async function createServerInstance(auth) {
|
|
33
69
|
const server = new McpServer({
|
|
34
70
|
name: 'fluentcart-developer',
|
|
35
71
|
version: SERVER_VERSION
|
|
36
|
-
});
|
|
72
|
+
}, { instructions: INSTRUCTIONS });
|
|
37
73
|
// 1. Attach the official MCP skills catalog so the client can load SKILL.md.
|
|
38
74
|
try {
|
|
39
75
|
const catalog = await skillsCatalog();
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAI9C;;;;;;;;;GASG;AACH,IAAI,cAAwD,CAAC;AAE7D,SAAS,aAAa;IACpB,cAAc,KAAK,UAAU,CAAC,UAAU,EAAE,EAAE;QAC1C,wEAAwE;QACxE,sEAAsE;QACtE,0EAA0E;QAC1E,yDAAyD;QACzD,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI,EAAE;KACjD,CAAC,CAAC,KAAK,CAAC,CAAC,GAAQ,EAAE,EAAE;QACpB,OAAO,CAAC,KAAK,CAAC,4CAA4C,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QACzE,cAAc,GAAG,SAAS,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;IACH,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,IAAiB;IAC1D,MAAM,MAAM,GAAG,IAAI,SAAS,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"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;QACd,OAAO,EAAE;YACP,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,SAAS,EAAE,IAAI,CAAC,MAAM;YACtB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB;QACD,IAAI,EAAE,YAAY;QAClB,MAAM,EAAE,CAAC,sBAAsB,CAAC;QAChC,KAAK,EAAE;YACL,KAAK,EAAE,GAAG,CAAC,MAAM;YACjB,MAAM,EAAE,KAAK;YACb,aAAa,EAAE,CAAC,UAAU,CAAC;YAC3B,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,uBAAuB,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACrD;KACF,CAAC;AACJ,CAAC"}
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fluentcart-developer",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "MCP server for FluentCart developer knowledge: documentation search, database schema lookup, hook discovery, reference reading, and boilerplate generation for gateways, licensing, customers, device licensing, trial guards and client SDKs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|