Skip to main content
Glama
orneryd

M.I.M.I.R - Multi-agent Intelligent Memory & Insight Repository

by orneryd
test-neo4j.jsβ€’2.92 kB
// Quick test script for Neo4j connection import { createGraphManager } from './build/managers/index.js'; async function test() { console.log('πŸ§ͺ Testing Neo4j Connection...'); console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'); try { console.log('\nπŸ“Š Environment:'); console.log(` NEO4J_URI: ${process.env.NEO4J_URI || 'bolt://localhost:7687'}`); console.log(` NEO4J_USER: ${process.env.NEO4J_USER || 'neo4j'}`); console.log(` NEO4J_PASSWORD: ${process.env.NEO4J_PASSWORD ? '***' : 'password'}`); console.log('\nπŸ”Œ Connecting to Neo4j...'); const manager = await createGraphManager(); console.log('\nβœ… Connected successfully!'); console.log('\nπŸ“ˆ Getting stats...'); const stats = await manager.getStats(); console.log(` Nodes: ${stats.nodeCount}`); console.log(` Edges: ${stats.edgeCount}`); console.log(` Types: ${JSON.stringify(stats.types, null, 2)}`); console.log('\nπŸ§ͺ Testing basic operations...'); // Test 1: Create a node console.log('\n Test 1: Creating a test TODO node...'); const node = await manager.addNode('todo', { title: 'Test Connection', status: 'pending', priority: 'high', description: 'Testing Neo4j connection' }); console.log(` βœ… Created node: ${node.id}`); // Test 2: Query nodes console.log('\n Test 2: Querying TODO nodes...'); const todos = await manager.queryNodes('todo'); console.log(` βœ… Found ${todos.length} TODO(s)`); // Test 3: Get node console.log('\n Test 3: Getting node by ID...'); const retrieved = await manager.getNode(node.id); console.log(` βœ… Retrieved: ${retrieved?.properties.title}`); // Test 4: Update node console.log('\n Test 4: Updating node...'); const updated = await manager.updateNode(node.id, { status: 'completed' }); console.log(` βœ… Updated status: ${updated.properties.status}`); // Test 5: Delete node console.log('\n Test 5: Deleting test node...'); await manager.deleteNode(node.id); console.log(` βœ… Deleted successfully`); console.log('\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'); console.log('βœ… All tests passed!'); console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'); await manager.close?.(); process.exit(0); } catch (error) { console.error('\n❌ Test failed:', error.message); console.error('\nDetails:', error.stack); process.exit(1); } } test();

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/orneryd/Mimir'

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