Skip to main content
Glama
knowall-ai

Neo4j Agent Memory MCP Server

by knowall-ai
test-create-memory.js2.42 kB
#!/usr/bin/env node // Test script for create_memory function // This script tests creating different types of memory entities import { spawn } from 'child_process'; import dotenv from 'dotenv'; // Load environment variables dotenv.config({ path: '../.env' }); const testCreateMemory = () => { console.log('🧠 Testing create_memory function...'); const mcp = spawn('node', ['../build/index.js'], { env: { ...process.env }, stdio: ['pipe', 'pipe', 'pipe'] }); const tests = [ { id: 1, label: 'person', properties: { name: 'Alice', occupation: 'Engineer', company: 'Tech Corp', context: 'Test user for MCP testing' } }, { id: 2, label: 'place', properties: { name: 'San Francisco', state: 'California', country: 'USA', context: 'Test location' } }, { id: 3, label: 'food', properties: { name: 'coffee', context: 'Alice loves coffee' } } ]; let completedTests = 0; let output = ''; mcp.stdout.on('data', (data) => { output += data.toString(); const lines = output.split('\n'); for (const line of lines) { if (line.trim()) { try { const response = JSON.parse(line); if (response.id && response.id <= tests.length) { console.log(`✅ create_memory test ${response.id} passed`); console.log('Response:', JSON.stringify(response, null, 2)); completedTests++; if (completedTests === tests.length) { console.log('🎉 All create_memory tests completed'); mcp.kill(); return; } } } catch (e) { // Ignore non-JSON lines } } } }); mcp.stderr.on('data', (data) => { console.error('❌ Error:', data.toString()); }); // Send all test messages tests.forEach(test => { const testMessage = { jsonrpc: '2.0', id: test.id, method: 'tools/call', params: { name: 'create_memory', arguments: { label: test.label, properties: test.properties } } }; mcp.stdin.write(JSON.stringify(testMessage) + '\n'); }); setTimeout(() => { console.log('⏰ Test timeout'); mcp.kill(); }, 10000); }; testCreateMemory();

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/knowall-ai/mcp-neo4j-agent-memory'

If you have feedback or need assistance with the MCP directory API, please join our Discord server