set_memory_bank_path
Define or update the custom path for the Memory Bank in mcp-with-ssh, ensuring centralized knowledge storage and access via SSH. Use the command to specify a directory or default to the current one.
Instructions
Set a custom path for the Memory Bank
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Custom path for the Memory Bank. If not provided, the current directory will be used. |
Implementation Reference
- src/server/tools/CoreTools.ts:136-172 (handler)The handler function that executes the set_memory_bank_path tool logic by setting a custom path for the Memory Bank using the MemoryBankManager.export async function handleSetMemoryBankPath( memoryBankManager: MemoryBankManager, customPath?: string ) { // Use the provided path, project path, or the current directory const basePath = customPath || memoryBankManager.getProjectPath(); // Ensure the path is absolute const absolutePath = path.isAbsolute(basePath) ? basePath : path.resolve(process.cwd(), basePath); console.error('Using absolute path for Memory Bank:', absolutePath); // Set the custom path and check for a memory-bank directory await memoryBankManager.setCustomPath(absolutePath); // Check if a memory-bank directory was found const memoryBankDir = memoryBankManager.getMemoryBankDir(); if (memoryBankDir) { return { content: [ { type: 'text', text: `Memory Bank path set to ${memoryBankDir}`, }, ], }; } // If we get here, no valid Memory Bank was found return { content: [ { type: 'text', text: `Memory Bank not found in the provided directory. Use initialize_memory_bank to create one.`, }, ], }; }
- src/server/tools/CoreTools.ts:25-38 (schema)The schema definition for the set_memory_bank_path tool, including name, description, and input schema, part of the coreTools array.{ name: 'set_memory_bank_path', description: 'Set a custom path for the Memory Bank', inputSchema: { type: 'object', properties: { path: { type: 'string', description: 'Custom path for the Memory Bank. If not provided, the current directory will be used.', }, }, required: [], }, },
- src/server/tools/index.ts:65-68 (registration)The switch case registration that routes calls to the set_memory_bank_path handler in the MCP server's tool request handler.case 'set_memory_bank_path': { const { path: customPath } = request.params.arguments as { path?: string }; return handleSetMemoryBankPath(memoryBankManager, customPath); }
- src/server/tools/index.ts:30-37 (registration)Registers the list of tools including coreTools (which contains set_memory_bank_path schema) for the MCP list tools request.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ ...coreTools, ...progressTools, ...contextTools, ...decisionTools, ...modeTools, ],