Major Changes: - Implemented MCP HTTP/SSE transport server for n8n and web clients - Created mcp_server/http_server.py with FastAPI for JSON-RPC 2.0 over HTTP - Added health check endpoint (/health) for container monitoring - Refactored mcp-server/ to mcp_server/ (Python module structure) - Updated Dockerfile.mcp to run HTTP server with health checks MCP Server Features: - 7 memory tools exposed via MCP (add, search, get, update, delete) - HTTP/SSE transport on port 8765 for n8n integration - stdio transport for Claude Code integration - JSON-RPC 2.0 protocol implementation - CORS support for web clients n8n Integration: - Successfully tested with AI Agent workflows - MCP Client Tool configuration documented - Working webhook endpoint tested and verified - System prompt optimized for automatic user_id usage Documentation: - Created comprehensive Mintlify documentation site - Added docs/mcp/introduction.mdx - MCP server overview - Added docs/mcp/installation.mdx - Installation guide - Added docs/mcp/tools.mdx - Complete tool reference - Added docs/examples/n8n.mdx - n8n integration guide - Added docs/examples/claude-code.mdx - Claude Code setup - Updated README.md with MCP HTTP server info - Updated roadmap to mark Phase 1 as complete Bug Fixes: - Fixed synchronized delete operations across Supabase and Neo4j - Updated memory_service.py with proper error handling - Fixed Neo4j connection issues in delete operations Configuration: - Added MCP_HOST and MCP_PORT environment variables - Updated .env.example with MCP server configuration - Updated docker-compose.yml with MCP container health checks Testing: - Added test scripts for MCP HTTP endpoint verification - Created test workflows in n8n - Verified all 7 memory tools working correctly - Tested synchronized operations across both stores Version: 1.0.0 Status: Phase 1 Complete - Production Ready 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
111 lines
3.1 KiB
YAML
111 lines
3.1 KiB
YAML
services:
|
|
# Neo4j Graph Database
|
|
neo4j:
|
|
image: neo4j:5.26-community
|
|
container_name: t6-mem0-neo4j
|
|
restart: unless-stopped
|
|
ports:
|
|
- "7474:7474" # HTTP Browser UI
|
|
- "7687:7687" # Bolt Protocol
|
|
environment:
|
|
- NEO4J_AUTH=${NEO4J_USER:-neo4j}/${NEO4J_PASSWORD}
|
|
- NEO4J_PLUGINS=["apoc", "graph-data-science"]
|
|
- NEO4J_dbms_security_procedures_unrestricted=apoc.*,gds.*
|
|
- NEO4J_dbms_memory_heap_initial__size=512M
|
|
- NEO4J_dbms_memory_heap_max__size=2G
|
|
- NEO4J_dbms_memory_pagecache_size=512M
|
|
volumes:
|
|
- neo4j_data:/data
|
|
- neo4j_logs:/logs
|
|
- neo4j_import:/import
|
|
- neo4j_plugins:/plugins
|
|
networks:
|
|
- localai
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "cypher-shell -u ${NEO4J_USER:-neo4j} -p ${NEO4J_PASSWORD} 'RETURN 1'"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# REST API Server
|
|
api:
|
|
build:
|
|
context: .
|
|
dockerfile: docker/Dockerfile.api
|
|
container_name: t6-mem0-api
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${API_PORT:-8080}:8080"
|
|
environment:
|
|
- OPENAI_API_KEY=${OPENAI_API_KEY}
|
|
- SUPABASE_CONNECTION_STRING=${SUPABASE_CONNECTION_STRING}
|
|
- NEO4J_URI=neo4j://neo4j:7687
|
|
- NEO4J_USER=${NEO4J_USER:-neo4j}
|
|
- NEO4J_PASSWORD=${NEO4J_PASSWORD}
|
|
- API_HOST=0.0.0.0
|
|
- API_PORT=8080
|
|
- API_KEY=${API_KEY}
|
|
- MEM0_COLLECTION_NAME=${MEM0_COLLECTION_NAME:-t6_memories}
|
|
- MEM0_EMBEDDING_DIMS=${MEM0_EMBEDDING_DIMS:-1536}
|
|
- MEM0_VERSION=${MEM0_VERSION:-v1.1}
|
|
- LOG_LEVEL=${LOG_LEVEL:-INFO}
|
|
- ENVIRONMENT=${ENVIRONMENT:-production}
|
|
depends_on:
|
|
neo4j:
|
|
condition: service_healthy
|
|
networks:
|
|
- localai
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl -f http://localhost:8080/v1/health || exit 1"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
# MCP Server
|
|
mcp-server:
|
|
build:
|
|
context: .
|
|
dockerfile: docker/Dockerfile.mcp
|
|
container_name: t6-mem0-mcp
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${MCP_PORT:-8765}:8765"
|
|
environment:
|
|
- OPENAI_API_KEY=${OPENAI_API_KEY}
|
|
- SUPABASE_CONNECTION_STRING=${SUPABASE_CONNECTION_STRING}
|
|
- NEO4J_URI=neo4j://neo4j:7687
|
|
- NEO4J_USER=${NEO4J_USER:-neo4j}
|
|
- NEO4J_PASSWORD=${NEO4J_PASSWORD}
|
|
- API_KEY=${API_KEY}
|
|
- MCP_HOST=0.0.0.0
|
|
- MCP_PORT=8765
|
|
- MEM0_COLLECTION_NAME=${MEM0_COLLECTION_NAME:-t6_memories}
|
|
- MEM0_EMBEDDING_DIMS=${MEM0_EMBEDDING_DIMS:-1536}
|
|
- MEM0_VERSION=${MEM0_VERSION:-v1.1}
|
|
- LOG_LEVEL=${LOG_LEVEL:-INFO}
|
|
- ENVIRONMENT=${ENVIRONMENT:-production}
|
|
depends_on:
|
|
neo4j:
|
|
condition: service_healthy
|
|
networks:
|
|
- localai
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl -f http://localhost:8765/health || exit 1"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
volumes:
|
|
neo4j_data:
|
|
name: t6-mem0-neo4j-data
|
|
neo4j_logs:
|
|
name: t6-mem0-neo4j-logs
|
|
neo4j_import:
|
|
name: t6-mem0-neo4j-import
|
|
neo4j_plugins:
|
|
name: t6-mem0-neo4j-plugins
|
|
|
|
networks:
|
|
localai:
|
|
external: true
|