Filesystem helper methods Provides convenient access to filesystem MCP tool operations
Read file content
Write file content
Writes content to a file, creating the file if it doesn't exist or overwriting it if it does.
// Write JSON data
await mcpTools.filesystem.writeFile({
path: 'data/output.json',
content: JSON.stringify({ results: [...] }, null, 2)
});
// Write generated code
await mcpTools.filesystem.writeFile({
path: 'generated/schema.ts',
content: generatedTypeScriptCode
});
// Write log file
await mcpTools.filesystem.writeFile({
path: 'logs/execution.log',
content: `Execution completed at ${new Date().toISOString()}`
});
Memory helper methods
Provides convenient access to memory/knowledge graph MCP tool operations. Enables structured knowledge storage and retrieval for project context, decisions, lessons learned, and system architecture.
Create entities in knowledge graph
Creates new entities (nodes) in the knowledge graph with associated observations and metadata. Useful for storing project milestones, decisions, lessons learned, and system architecture information.
// Store lesson learned
await mcpTools.memory.createEntities({
entities: [{
name: 'Authentication Bug Fix 2025-01-01',
entityType: 'lesson_learned',
observations: [
'Root cause: JWT token expiry not properly handled',
'Fix: Added token refresh mechanism',
'Prevention: Added integration tests for auth flow'
]
}]
});
// Store architecture decision
await mcpTools.memory.createEntities({
entities: [{
name: 'PostgreSQL Database Selection',
entityType: 'architecture_decision',
observations: [
'Chosen PostgreSQL over MongoDB',
'Reason: Complex relational queries required',
'Trade-off: More rigid schema but better data integrity'
]
}]
});
Search nodes in knowledge graph
Searches the knowledge graph for entities matching a query string. Searches across entity names, types, and observation content.
// Search for API-related entities
const apiNodes = await mcpTools.memory.searchNodes('API endpoints');
console.log(`Found ${apiNodes.length} API-related nodes`);
// Search for recent decisions
const decisions = await mcpTools.memory.searchNodes('architecture decision');
// Search for specific component
const authNodes = await mcpTools.memory.searchNodes('authentication');
authNodes.forEach(node => {
console.log(`Entity: ${node.name}, Type: ${node.entityType}`);
});
// Store project milestone
await mcpTools.memory.createEntities({
entities: [{
name: 'API Integration v2.2',
entityType: 'milestone',
observations: [
'Completed RESTful API endpoints',
'Added authentication middleware',
'Achieved 95% test coverage'
]
}]
});
// Search for architecture decisions
const results = await mcpTools.memory.searchNodes('database schema');
console.log(`Found ${results.length} related nodes`);
Playwright helper methods Provides convenient access to Playwright MCP tool operations for browser automation
Navigate to a URL
Take an accessibility snapshot of the current page
Click an element on the page
Type text into an element
Wait for a condition
Take a screenshot
Evaluate JavaScript expression on page
Close the browser
Cleanup all active child processes
✅ FIX HIGH-1: Kill all spawned processes on shutdown Sends SIGTERM then SIGKILL to ensure processes don't become zombies
Check if memory operations are available
Bash command execution helper Provides vetted access to shell command execution.
Register an MCP tool
Name of the tool to register
Tool metadata (description, methods)
True if registration successful
Check if a tool is registered
Name of the tool to check
True if tool is registered
Get list of all registered tools
Array of registered tool names
Invoke an MCP tool
Name of the tool to invoke
Method to call on the tool
Parameters to pass to the tool
Promise
Invoke a MeMesh tool directly via in-process dispatcher
MCP tool name (e.g., "buddy-do", "memesh-remember")
Tool arguments
ToolInvocationResult with MCP CallToolResult payload
Check if all required tools are available
Array of required tool names
ToolDependencyCheck Result of the check
Get metadata for a specific tool
Name of the tool
ToolMetadata or undefined if not found
MCP Tool Interface Class
Central registry and invocation point for all MCP tools. Agents use this interface to interact with MCP tools in a standardized way.