@ratio-mcp/docs-server 1.4.0 → 1.4.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.
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAMpE;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,SAAS,CAuD5C"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AA0BpE;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,SAAS,CA4D5C"}
package/dist/server.js CHANGED
@@ -2,6 +2,25 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import { DOCS_SERVER_NAME, DOCS_SERVER_VERSION } from '@ratio-mcp/shared';
3
3
  import { docsTools } from './tools/index.js';
4
4
  import { logger } from './utils/logger.js';
5
+ const DOCS_SERVER_INSTRUCTIONS = `You are connected to the Ratio Docs MCP Server — the authoritative reference for the Ratio/OpenStore platform API.
6
+
7
+ CRITICAL RULES:
8
+ 1. ALWAYS use these tools BEFORE answering any question about the Ratio platform API, scopes, webhooks, or endpoints. NEVER answer from memory.
9
+ 2. If lookup_docs returns found=false, tell the user the information is not available. NEVER guess or hallucinate.
10
+ 3. ALWAYS call validate_api_code after generating any code that calls Ratio APIs, before presenting it to the developer.
11
+ 4. ALWAYS call get_available_scopes before answering scope-related questions.
12
+ 5. ALWAYS call get_api_reference before answering API endpoint questions.
13
+ 6. ALWAYS call get_webhook_events before answering webhook questions.
14
+
15
+ TOOL USAGE:
16
+ - lookup_docs: Unified search across all documentation. Use as the MANDATORY fallback when unsure about ANY platform detail.
17
+ - get_available_scopes: Returns all 78 resources with their scopes. Use before discussing scope selection.
18
+ - get_api_reference: Returns endpoints for a specific resource. Use before generating or discussing API calls.
19
+ - get_scope_endpoint_map: Maps scopes to their endpoints. Use before code generation.
20
+ - validate_api_code: Validates generated NestJS code against real API schemas. Use AFTER code generation.
21
+ - get_webhook_events: Returns webhook event topics and verification details. Use before discussing webhooks.
22
+
23
+ These tools exist to PREVENT hallucination. The Ratio platform has specific APIs, scopes, and patterns — do not assume you know them. Always verify.`;
5
24
  /**
6
25
  * Create and configure the Ratio Docs MCP Server
7
26
  */
@@ -9,6 +28,8 @@ export function createDocsServer() {
9
28
  const server = new McpServer({
10
29
  name: DOCS_SERVER_NAME,
11
30
  version: DOCS_SERVER_VERSION,
31
+ }, {
32
+ instructions: DOCS_SERVER_INSTRUCTIONS,
12
33
  });
13
34
  // Register all tools
14
35
  for (const tool of docsTools) {
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,mBAAmB;KAC7B,CAAC,CAAC;IAEH,qBAAqB;IACrB,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC7B,8EAA8E;QAC9E,MAAM,KAAK,GAAI,IAAI,CAAC,WAA0C,CAAC,KAAK,CAAC;QAErE,MAAM,CAAC,IAAI,CACT,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,WAAW,EAChB,KAAK,EACL,KAAK,EAAE,IAA6B,EAAE,EAAE;YACtC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAA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E/C,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAe;4BACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;yBACtC;qBACF;iBACF,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;gBACxC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;gBAE7C,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACvE,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAe;4BACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;yBACxD;qBACF;oBACD,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;QACH,CAAC,CACF,CAAC;QAEF,MAAM,CAAC,KAAK,CAAC,oBAAoB,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,GAAG,gBAAgB,qBAAqB,SAAS,CAAC,MAAM,QAAQ,CAAC,CAAC;IAC9E,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ratio-mcp/docs-server",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "files": ["dist"],
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@modelcontextprotocol/sdk": "^1.12.1",
19
- "@ratio-mcp/shared": "^1.4.0",
19
+ "@ratio-mcp/shared": "^1.4.1",
20
20
  "zod": "^3.23.0"
21
21
  },
22
22
  "devDependencies": {