@myatkyawthu/mcp-connect 0.3.2 → 0.3.3

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/CHANGELOG.md CHANGED
@@ -4,6 +4,17 @@ All notable changes to `@myatkyawthu/mcp-connect` are documented here.
4
4
 
5
5
  ---
6
6
 
7
+ ## [0.3.3] — 2026-07-22
8
+
9
+ ### Bug Fixes
10
+
11
+ - **Fixed double-validation bug wiping tool schemas at runtime**
12
+ When a config file exported the result of `defineMCP()`, the CLI was executing `defineMCP()` a second time. This second invocation parsed the normalized tools and wiped out the `schema` metadata because it was already converted to `inputSchema` in the first run, rendering runtime schema validation inactive.
13
+ - Added early return guard (`_isMCPConfig` flag) in `defineMCP` to prevent double processing.
14
+ - Added fallback check to parse `inputSchema` keys if already normalized.
15
+
16
+ ---
17
+
7
18
  ## [0.3.2] — 2026-07-22
8
19
 
9
20
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myatkyawthu/mcp-connect",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Dead simple MCP (Model Context Protocol) server for exposing your app functions to AI agents",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
package/src/defineMCP.js CHANGED
@@ -2,6 +2,10 @@ import { formatValidationErrors, validateConfig } from './utils/configValidation
2
2
  import { logger } from './utils/logger.js';
3
3
 
4
4
  export function defineMCP(config) {
5
+ if (config && config._isMCPConfig) {
6
+ return config;
7
+ }
8
+
5
9
  const validationResult = validateConfig(config);
6
10
 
7
11
  if (!validationResult.isValid) {
@@ -33,11 +37,11 @@ export function defineMCP(config) {
33
37
  handler,
34
38
  };
35
39
  } else {
36
- const { name, handler, description, schema, confirm } = tool;
40
+ const { name, handler, description, schema, inputSchema, confirm } = tool;
37
41
  return {
38
42
  name: name.trim(),
39
43
  description: description || `Tool: ${name}`,
40
- inputSchema: schema || {
44
+ inputSchema: schema || inputSchema || {
41
45
  type: 'object',
42
46
  properties: {},
43
47
  additionalProperties: true,
@@ -54,5 +58,6 @@ export function defineMCP(config) {
54
58
  description: config.description,
55
59
  server: config.server || {},
56
60
  tools: mcpTools,
61
+ _isMCPConfig: true,
57
62
  };
58
63
  }