graphiti/mcp_server/docker/docker-compose.yml
Daniel Chalef 3c25268afc feat: Major MCP server refactor with improved structure and CI/CD
- Reorganized MCP server into clean, scalable directory structure:
  - `src/config/` - Configuration modules (schema, managers, provider configs)
  - `src/services/` - Services (queue, factories)
  - `src/models/` - Data models (entities, responses)
  - `src/utils/` - Utilities (formatting, helpers)
  - `tests/` - All test files
  - `config/` - Configuration files (YAML, examples)
  - `docker/` - Docker setup files
  - `docs/` - Documentation

- Added `main.py` wrapper for seamless transition
- Maintains existing command-line interface
- All deployment scripts continue to work unchanged

- **Queue Service Interface Fix**: Fixed missing `add_episode()` and `initialize()` methods
  - Server calls at `graphiti_mcp_server.py:276` and `:755` now work correctly
  - Eliminates runtime crashes on startup and episode processing
- Updated imports throughout restructured codebase
- Fixed Python module name conflicts (renamed `types/` to `models/`)

- **MCP Server Tests Action** (`.github/workflows/mcp-server-tests.yml`)
  - Runs on PRs targeting main with `mcp_server/**` changes
  - Configuration validation, syntax checking, unit tests
  - Import structure validation, dependency verification
  - Main.py wrapper functionality testing

- **MCP Server Lint Action** (`.github/workflows/mcp-server-lint.yml`)
  - Code formatting with ruff (100 char line length, single quotes)
  - Comprehensive linting with GitHub-formatted output
  - Type checking with pyright (baseline approach for existing errors)
  - Import sorting validation

- Added ruff and pyright configuration to `mcp_server/pyproject.toml`
- Proper tool configuration for the new structure
- Enhanced development dependencies with formatting/linting tools

- All existing tests moved and updated for new structure
- Import paths updated throughout test suite
- Validation scripts enhanced for restructured codebase

- **Improved Maintainability**: Clear separation of concerns
- **Better Scalability**: Organized structure supports growth
- **Enhanced Developer Experience**: Proper linting, formatting, type checking
- **Automated Quality Gates**: CI/CD ensures code quality on every PR
- **Zero Breaking Changes**: Maintains full backwards compatibility

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-30 08:50:48 -07:00

64 lines
2.2 KiB
YAML

services:
neo4j:
image: neo4j:5.26.0
ports:
- "7474:7474" # HTTP
- "7687:7687" # Bolt
environment:
- NEO4J_AUTH=${NEO4J_USER:-neo4j}/${NEO4J_PASSWORD:-demodemo}
- NEO4J_server_memory_heap_initial__size=512m
- NEO4J_server_memory_heap_max__size=1G
- NEO4J_server_memory_pagecache_size=512m
volumes:
- neo4j_data:/data
- neo4j_logs:/logs
healthcheck:
test: ["CMD", "wget", "-O", "/dev/null", "http://localhost:7474"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
graphiti-mcp:
image: zepai/knowledge-graph-mcp:latest
build:
context: .
dockerfile: Dockerfile
env_file:
- path: .env
required: false # Makes the file optional. Default value is 'true'
depends_on:
neo4j:
condition: service_healthy
environment:
# Database configuration
- NEO4J_URI=${NEO4J_URI:-bolt://neo4j:7687}
- NEO4J_USER=${NEO4J_USER:-neo4j}
- NEO4J_PASSWORD=${NEO4J_PASSWORD:-demodemo}
- NEO4J_DATABASE=${NEO4J_DATABASE:-neo4j}
# LLM provider configurations
- OPENAI_API_KEY=${OPENAI_API_KEY}
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- GOOGLE_API_KEY=${GOOGLE_API_KEY}
- GROQ_API_KEY=${GROQ_API_KEY}
- AZURE_OPENAI_API_KEY=${AZURE_OPENAI_API_KEY}
- AZURE_OPENAI_ENDPOINT=${AZURE_OPENAI_ENDPOINT}
- AZURE_OPENAI_DEPLOYMENT=${AZURE_OPENAI_DEPLOYMENT}
# Embedder provider configurations
- VOYAGE_API_KEY=${VOYAGE_API_KEY}
- AZURE_OPENAI_EMBEDDINGS_ENDPOINT=${AZURE_OPENAI_EMBEDDINGS_ENDPOINT}
- AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT=${AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT}
# Application configuration
- GRAPHITI_GROUP_ID=${GRAPHITI_GROUP_ID:-main}
- SEMAPHORE_LIMIT=${SEMAPHORE_LIMIT:-10}
- CONFIG_PATH=/app/config/config.yaml
- PATH=/root/.local/bin:${PATH}
volumes:
- ./config.yaml:/app/config/config.yaml:ro
ports:
- "8000:8000" # Expose the MCP server via HTTP for SSE transport
command: ["uv", "run", "graphiti_mcp_server.py", "--transport", "sse", "--config", "/app/config/config.yaml"]
volumes:
neo4j_data:
neo4j_logs: