codex-memory 0.1.40

An advanced hierarchical memory system for AI agents with MCP integration
Documentation
#!/usr/bin/env python3
"""
Test script to trigger harvesting via MCP protocol
"""
import json
import subprocess
import sys

def send_mcp_command(command):
    """Send a command to the MCP server via stdio"""
    # Start the MCP server process
    process = subprocess.Popen(
        ['./target/release/codex-memory', 'mcp-stdio', '--skip-setup'],
        stdin=subprocess.PIPE,
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE,
        text=True
    )
    
    # Send the command
    stdout, stderr = process.communicate(input=json.dumps(command))
    
    return stdout, stderr

# Create harvest request
harvest_request = {
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
        "name": "harvest_conversation",
        "arguments": {
            "message": "I prefer Python for data science. My goal is to master Rust. I decided to use PostgreSQL for this project. I'm excited about building AI systems!",
            "force_harvest": True,
            "silent_mode": False
        }
    },
    "id": 1
}

print("🚀 Sending harvest request to MCP server...")
print(json.dumps(harvest_request, indent=2))
print("\n" + "="*50 + "\n")

# Send the request
stdout, stderr = send_mcp_command(harvest_request)

print("Response from MCP server:")
print(stdout)

if stderr:
    print("\nErrors/Logs:")
    print(stderr)