@mentagen/mcp 0.6.0 → 0.7.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/dist/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
3
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
4
  import { createMentagenClient } from './client/helene.js';
5
+ import { registerResources } from './resources/index.js';
5
6
  import { registerTools } from './tools/index.js';
6
7
  import { loadConfig } from './utils/config.js';
7
8
  async function main() {
@@ -13,8 +14,10 @@ async function main() {
13
14
  }, {
14
15
  capabilities: {
15
16
  tools: {},
17
+ resources: {},
16
18
  },
17
19
  });
20
+ registerResources(mcpServer);
18
21
  registerTools(mcpServer.server, client, config);
19
22
  const transport = new StdioServerTransport();
20
23
  await mcpServer.connect(transport);
@@ -0,0 +1,93 @@
1
+ const NODE_COLORS = [
2
+ { name: 'amber', rgb: 'rgb(253, 230, 138)' },
3
+ { name: 'blue', rgb: 'rgb(0, 120, 255)' },
4
+ { name: 'cyan', rgb: 'rgb(0, 231, 255)' },
5
+ { name: 'emerald', rgb: 'rgb(0, 230, 118)' },
6
+ { name: 'fuchsia', rgb: 'rgb(233, 30, 99)' },
7
+ { name: 'green', rgb: 'rgb(52, 211, 153)' },
8
+ { name: 'indigo', rgb: 'rgb(72, 77, 201)' },
9
+ { name: 'lime', rgb: 'rgb(209, 250, 229)' },
10
+ { name: 'orange', rgb: 'rgb(252, 165, 0)' },
11
+ { name: 'pink', rgb: 'rgb(244, 143, 177)' },
12
+ { name: 'purple', rgb: 'rgb(156, 39, 176)' },
13
+ { name: 'red', rgb: 'rgb(239, 68, 68)' },
14
+ { name: 'rose', rgb: 'rgb(255, 204, 203)' },
15
+ { name: 'sky', rgb: 'rgb(0, 184, 230)' },
16
+ { name: 'slate', rgb: 'rgb(107, 114, 128)' },
17
+ { name: 'teal', rgb: 'rgb(0, 210, 183)' },
18
+ { name: 'violet', rgb: 'rgb(123, 31, 162)' },
19
+ { name: 'yellow', rgb: 'rgb(255, 251, 235)' },
20
+ ];
21
+ /**
22
+ * Supported node types with their default colors.
23
+ *
24
+ * Keep in sync with: src/client/features/boards/inner-board-context-menu.tsx
25
+ */
26
+ const NODE_TYPES = [
27
+ {
28
+ type: 'text',
29
+ defaultColor: null,
30
+ description: 'Simple text node with a title and optional rich text content.',
31
+ usage: 'Use for short notes, labels, headings, or any content that needs a title.',
32
+ fields: {
33
+ name: 'The node title (required)',
34
+ content: 'Optional HTML content',
35
+ },
36
+ },
37
+ {
38
+ type: 'markdown',
39
+ defaultColor: 'cyan',
40
+ description: 'Markdown node for longer-form content with full Markdown syntax support.',
41
+ usage: 'Use for documentation, articles, formatted notes, or any content that benefits from Markdown formatting.',
42
+ fields: {
43
+ name: 'The node title (required)',
44
+ content: 'Markdown content (supports full GFM syntax)',
45
+ },
46
+ },
47
+ {
48
+ type: 'code',
49
+ defaultColor: 'indigo',
50
+ description: 'Code node for storing and displaying source code with syntax highlighting.',
51
+ usage: 'Use for code snippets, scripts, configuration files. Supports multiple programming languages.',
52
+ fields: {
53
+ name: 'The node title (required)',
54
+ content: 'Source code content',
55
+ },
56
+ },
57
+ {
58
+ type: 'url',
59
+ defaultColor: 'blue',
60
+ description: 'Bookmark node that stores and displays a link to an external URL.',
61
+ usage: 'Use for saving references to external resources, articles, documentation, or any web link.',
62
+ fields: {
63
+ name: 'The link title (required)',
64
+ url: 'The full URL including protocol (e.g., https://example.com)',
65
+ },
66
+ },
67
+ ];
68
+ export function registerResources(mcpServer) {
69
+ mcpServer.resource('Node Colors', 'mentagen://colors', {
70
+ description: 'Available colors for nodes. Use the color name when creating or updating nodes.',
71
+ mimeType: 'application/json',
72
+ }, async () => ({
73
+ contents: [
74
+ {
75
+ uri: 'mentagen://colors',
76
+ mimeType: 'application/json',
77
+ text: JSON.stringify({ colors: NODE_COLORS }, null, 2),
78
+ },
79
+ ],
80
+ }));
81
+ mcpServer.resource('Node Types', 'mentagen://node-types', {
82
+ description: 'Supported node types with descriptions and usage guidance. Specify the type parameter when creating nodes.',
83
+ mimeType: 'application/json',
84
+ }, async () => ({
85
+ contents: [
86
+ {
87
+ uri: 'mentagen://node-types',
88
+ mimeType: 'application/json',
89
+ text: JSON.stringify({ nodeTypes: NODE_TYPES }, null, 2),
90
+ },
91
+ ],
92
+ }));
93
+ }
@@ -5,7 +5,6 @@ import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextpro
5
5
  import { batchUpdateSchema, handleBatchUpdate } from './batch-update.js';
6
6
  import { boardsSchema, handleBoards } from './boards.js';
7
7
  import { checkCollisionSchema, handleCheckCollision, } from './check-collision.js';
8
- import { colorsSchema, handleColors } from './colors.js';
9
8
  import { createSchema, handleCreate } from './create.js';
10
9
  import { createBoardSchema, handleCreateBoard } from './create-board.js';
11
10
  import { createEdgeSchema, handleCreateEdge } from './create-edge.js';
@@ -22,11 +21,9 @@ import { handleListNodes, listNodesSchema } from './list-nodes.js';
22
21
  import { handleListOrganizations, listOrganizationsSchema, } from './list-organizations.js';
23
22
  import { handleListPositions, listPositionsSchema } from './list-positions.js';
24
23
  import { handleListTeams, listTeamsSchema } from './list-teams.js';
25
- import { handleNodeTypes, nodeTypesSchema } from './node-types.js';
26
24
  import { handlePatchContent, patchContentSchema } from './patch-content.js';
27
25
  import { handleRead, readSchema } from './read.js';
28
26
  import { handleSearch, searchSchema } from './search.js';
29
- import { handleSearchBoard, searchBoardSchema } from './search-board.js';
30
27
  import { handleSearchBoards, searchBoardsSchema } from './search-boards.js';
31
28
  import { handleSizeCalc, sizeCalcSchema } from './size-calc.js';
32
29
  import { handleUpdate, updateSchema } from './update.js';
@@ -204,7 +201,7 @@ export function registerTools(server, client, config) {
204
201
  },
205
202
  {
206
203
  name: 'mentagen_search_nodes',
207
- description: 'Search for nodes across ALL your boards using semantic search. Returns matching nodes with truncated content previews and direct links. Use mentagen_search_board to search within a specific board, or mentagen_read_node with the node ID to retrieve full content.',
204
+ description: 'Search for nodes using semantic search. Returns matching nodes with truncated content previews and direct links. Use mentagen_read_node with the node ID to retrieve full content.',
208
205
  inputSchema: {
209
206
  type: 'object',
210
207
  properties: {
@@ -234,34 +231,6 @@ export function registerTools(server, client, config) {
234
231
  required: ['query'],
235
232
  },
236
233
  },
237
- {
238
- name: 'mentagen_search_board',
239
- description: 'Search for nodes within a SPECIFIC board using semantic search. Use this when you know which board to search in. Returns matching nodes with truncated content previews and direct links. Use mentagen_read_node with the node ID to retrieve full content.',
240
- inputSchema: {
241
- type: 'object',
242
- properties: {
243
- boardId: {
244
- type: 'string',
245
- description: 'The board ID to search within (required)',
246
- },
247
- query: {
248
- type: 'string',
249
- description: 'The search query - can be a question or keywords',
250
- },
251
- limit: {
252
- type: 'number',
253
- description: 'Maximum number of results (default: 10)',
254
- default: 10,
255
- },
256
- semanticRatio: {
257
- type: 'number',
258
- description: 'Balance between semantic (1.0) and keyword (0.0) search',
259
- default: 0.5,
260
- },
261
- },
262
- required: ['boardId', 'query'],
263
- },
264
- },
265
234
  {
266
235
  name: 'mentagen_read_node',
267
236
  description: 'Read a single node by ID. Returns the full node content without truncation, unlike search results. Includes a direct link to the node.',
@@ -359,7 +328,7 @@ export function registerTools(server, client, config) {
359
328
  },
360
329
  color: {
361
330
  type: 'string',
362
- description: 'Node color name (use mentagen_colors to see available colors)',
331
+ description: 'Node color name (see mentagen://colors resource for available colors)',
363
332
  },
364
333
  x: {
365
334
  type: 'number',
@@ -733,22 +702,6 @@ export function registerTools(server, client, config) {
733
702
  required: ['boardId'],
734
703
  },
735
704
  },
736
- {
737
- name: 'mentagen_colors',
738
- description: 'Get the list of available colors for nodes. Returns color names and their RGB values.',
739
- inputSchema: {
740
- type: 'object',
741
- properties: {},
742
- },
743
- },
744
- {
745
- name: 'mentagen_node_types',
746
- description: 'Get the list of supported node types with descriptions and usage guidance. Use this to understand what types of nodes can be created.',
747
- inputSchema: {
748
- type: 'object',
749
- properties: {},
750
- },
751
- },
752
705
  {
753
706
  name: 'mentagen_grid_calc',
754
707
  description: 'Math helper for calculating node positions in grid units (1 unit = 16px). Use gap=6+ for connected nodes, gap=1 for unrelated nodes. Operations: "snap" rounds to nearest integer unit, "next_x"/"next_y" calculate position after a node, "grid_units" is deprecated (returns same value).',
@@ -984,10 +937,6 @@ export function registerTools(server, client, config) {
984
937
  const params = searchSchema.parse(args);
985
938
  return handleSearch(client, params, config.mentagenUrl);
986
939
  },
987
- mentagen_search_board: async (args) => {
988
- const params = searchBoardSchema.parse(args);
989
- return handleSearchBoard(client, params, config.mentagenUrl);
990
- },
991
940
  mentagen_read_node: async (args) => {
992
941
  const params = readSchema.parse(args);
993
942
  return handleRead(client, params, config.mentagenUrl);
@@ -1038,14 +987,6 @@ export function registerTools(server, client, config) {
1038
987
  const params = linkSchema.parse(args);
1039
988
  return handleLink(params, config);
1040
989
  },
1041
- mentagen_colors: async (args) => {
1042
- colorsSchema.parse(args);
1043
- return handleColors();
1044
- },
1045
- mentagen_node_types: async (args) => {
1046
- nodeTypesSchema.parse(args);
1047
- return handleNodeTypes();
1048
- },
1049
990
  mentagen_grid_calc: async (args) => {
1050
991
  const params = gridCalcSchema.parse(args);
1051
992
  return handleGridCalc(params, client);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mentagen/mcp",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "MCP server for Mentagen knowledge base integration with Cursor",
5
5
  "type": "module",
6
6
  "bin": "dist/index.js",
@@ -45,6 +45,6 @@
45
45
  "node": ">=18"
46
46
  },
47
47
  "resolutions": {
48
- "tar": "7.5.3"
48
+ "tar": "^7.5.4"
49
49
  }
50
50
  }