@mentagen/mcp 0.3.0 → 0.4.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.
@@ -48,10 +48,11 @@ export const createSchema = z.object({
48
48
  .string()
49
49
  .optional()
50
50
  .describe('File extension to append to name (e.g., ".ts", ".py"). Only applies to code nodes. Defaults to .js.'),
51
- content: z
51
+ content: z.string().optional().describe('Content for text/markdown nodes.'),
52
+ code: z
52
53
  .string()
53
54
  .optional()
54
- .describe('Content for text/markdown nodes. Use "url" field for url-type nodes.'),
55
+ .describe('Code content for code-type nodes. Takes precedence over content.'),
55
56
  url: z
56
57
  .string()
57
58
  .optional()
@@ -105,7 +106,7 @@ function buildNodeFields(params, color, position) {
105
106
  ...position,
106
107
  };
107
108
  if (params.type === 'code') {
108
- nodeFields.code = params.content || '';
109
+ nodeFields.code = params.code ?? params.content ?? '';
109
110
  }
110
111
  else if (params.type === 'url') {
111
112
  if (!params.url) {
@@ -7,10 +7,11 @@ export const updateSchema = z.object({
7
7
  boardId: z.string().describe('The board ID containing the node'),
8
8
  nodeId: z.string().describe('The node ID to update'),
9
9
  name: z.string().optional().describe('New name for the node'),
10
- content: z
10
+ content: z.string().optional().describe('Content for text/markdown nodes.'),
11
+ code: z
11
12
  .string()
12
13
  .optional()
13
- .describe('Content for text/markdown nodes. Use "url" field for url-type nodes.'),
14
+ .describe('Code content for code-type nodes. Takes precedence over content.'),
14
15
  url: z
15
16
  .string()
16
17
  .optional()
@@ -46,8 +47,11 @@ const POSITION_FIELDS = ['x', 'y', 'width', 'height'];
46
47
  * Add content fields to update data based on node type.
47
48
  */
48
49
  function addContentFields(data, params, nodeType) {
49
- if (nodeType === NodeType.Code && params.content !== undefined) {
50
- data.code = params.content;
50
+ if (nodeType === NodeType.Code) {
51
+ const codeContent = params.code ?? params.content;
52
+ if (codeContent !== undefined) {
53
+ data.code = codeContent;
54
+ }
51
55
  }
52
56
  else if (nodeType === NodeType.URL) {
53
57
  if (params.url !== undefined) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mentagen/mcp",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "MCP server for Mentagen knowledge base integration with Cursor",
5
5
  "type": "module",
6
6
  "bin": "dist/index.js",