This document describes the organization of the MCP Context Engine codebase.
context_keeper/
├── .git/ # Git repository data
├── .kiro/ # Kiro IDE configuration
│ └── specs/ # Feature specifications
│ └── mcp-context-engine/ # Main spec
├── .vscode/ # VS Code settings
├── bin/ # Compiled binaries (gitignored)
├── cmd/ # Application entrypoints
│ └── server/ # Main server application
│ └── main.go # Server entry point
├── deployment/ # Deployment configurations
│ ├── kubernetes/ # Kubernetes manifests
│ └── README.md # Deployment guide
├── docs/ # Documentation
│ ├── ARCHITECTURE.md # System architecture
│ ├── DISCORD_INTEGRATION.md # Discord setup guide
│ ├── DOCKER.md # Docker deployment
│ ├── PROJECT_STRUCTURE.md # This file
│ └── SLACK_INTEGRATION.md # Slack setup guide
├── internal/ # Private application code
│ ├── config/ # Configuration management
│ │ ├── config.go # Config struct and loading
│ │ └── config_test.go # Config tests
│ ├── database/ # Database operations
│ │ └── migrations.go # Database migrations
│ ├── handlers/ # HTTP request handlers
│ │ ├── handlers.go # Core handlers
│ │ ├── project_handlers.go # Project management
│ │ ├── github_integration.go # GitHub integration handlers
│ │ ├── slack_integration.go # Slack integration handlers
│ │ └── discord_integration.go # Discord integration handlers
│ ├── logger/ # Logging utilities
│ │ ├── logger.go # Logger interface
│ │ └── logger_test.go # Logger tests
│ ├── middleware/ # HTTP middleware
│ │ └── auth.go # Authentication middleware
│ ├── models/ # Data models
│ │ ├── models.go # Core models
│ │ └── models_test.go # Model tests
│ ├── repository/ # Data access layer
│ │ ├── repository.go # Repository interface
│ │ └── repository_test.go # Repository tests
│ ├── server/ # Server setup
│ │ ├── server.go # HTTP server
│ │ └── server_test.go # Server tests
│ └── services/ # Business logic
│ ├── auth.go # Authentication service
│ ├── context.go # Context service
│ ├── context_processor.go # Context processing
│ ├── encryption.go # Encryption service
│ ├── github.go # GitHub service
│ ├── github_integration.go # GitHub integration
│ ├── slack_integration.go # Slack integration
│ ├── discord_integration.go # Discord integration
│ ├── ingestion_orchestrator.go # Ingestion orchestration
│ ├── interfaces.go # Service interfaces
│ ├── job.go # Job service
│ ├── jwt.go # JWT service
│ ├── knowledge_graph.go # Knowledge graph service
│ ├── mcp_server.go # MCP server
│ ├── mcp_tools.go # MCP tools
│ ├── password.go # Password service
│ ├── permission.go # Permission service
│ ├── project_workspace.go # Project workspace service
│ └── connectors/ # Platform connectors
│ ├── base.go # Base connector
│ ├── config.go # Connector config
│ ├── discord.go # Discord connector
│ ├── github.go # GitHub connector
│ ├── interfaces.go # Connector interfaces
│ ├── registry.go # Connector registry
│ └── slack.go # Slack connector
├── scripts/ # Utility scripts
│ ├── test-go-backend.sh # Go backend tests
│ └── test_knowledge_graph.sh # Knowledge graph tests
├── secrets/ # Secret files (gitignored)
│ ├── .gitkeep # Keep directory in git
│ ├── github_client_secret.txt.example
│ ├── jwt_secret.txt.example
│ └── postgres_password.txt.example
├── src/ # TypeScript/Node.js code
│ ├── config/ # Node configuration
│ ├── demo/ # Demo data and services
│ ├── mcp/ # MCP server (Node)
│ ├── services/ # Node services
│ ├── slack/ # Slack bot
│ ├── types/ # TypeScript types
│ ├── utils/ # Utilities
│ └── index.ts # Node entry point
├── test/ # Integration tests
│ └── system_test.go # System-level tests
├── web/ # Frontend web application
│ ├── auth.css # Auth page styles
│ ├── auth.js # Auth JavaScript
│ ├── index.html # Landing page
│ ├── login.html # Login page
│ ├── nginx.conf.example # Nginx config
│ ├── README.md # Web docs
│ ├── script.js # Main JavaScript
│ ├── server.js # Dev server
│ ├── signup.html # Signup page
│ └── styles.css # Main styles
├── .env.example # Environment variables template
├── .env.test # Test environment
├── .eslintrc.js # ESLint configuration
├── .gitignore # Git ignore rules
├── docker-compose.dev.yml # Dev Docker Compose
├── docker-compose.mcp-slack.yml # Slack bot Docker Compose
├── docker-compose.yml # Production Docker Compose
├── Dockerfile # Main Dockerfile
├── Dockerfile.mcp-slack # Slack bot Dockerfile
├── go.mod # Go module definition
├── go.sum # Go dependencies
├── Makefile # Build automation
├── package.json # Node dependencies
├── package-lock.json # Node lock file
├── README.md # Project README
├── SECURITY.md # Security policies
├── SETUP_GUIDE.md # Setup instructions
├── tsconfig.json # TypeScript config
└── vitest.config.ts # Vitest config
Application entry points. Each subdirectory is a separate executable.
Private application code that cannot be imported by other projects.
Business logic layer. Contains all service implementations.
Platform connector implementations (GitHub, Slack, Discord).
HTTP request handlers. Maps HTTP requests to service calls.
Data models and database schemas.
Data access layer. Abstracts database operations.
TypeScript/Node.js code for MCP server and Slack bot.
Frontend web application (landing page, dashboard).
Project documentation.
Deployment configurations (Kubernetes, Docker).
Utility scripts for testing and development.
Integration and system tests.
*_test.go- Test files*_properties_test.go- Property-based test files*_integration_test.go- Integration test files
*.test.ts- Unit test files*.integration.test.ts- Integration test files*.properties.test.ts- Property-based test files
*.md- Markdown documentationREADME.md- Directory-specific documentation
.env.example- Environment variable template.gitignore- Git ignore rulesMakefile- Build automationgo.mod- Go module definitionpackage.json- Node dependenciestsconfig.json- TypeScript configurationvitest.config.ts- Test configuration
Dockerfile- Main application containerDockerfile.mcp-slack- Slack bot containerdocker-compose.yml- Production composedocker-compose.dev.yml- Development composedocker-compose.mcp-slack.yml- Slack bot compose
/bin/- Compiled Go binaries/dist/- Distribution builds/coverage/- Test coverage reports/node_modules/- Node dependencies*.log- Log files*.db- Database files
- Keep related code together
- Use clear, descriptive names
- Separate concerns (handlers, services, models)
- Write tests alongside code
- One primary type per file
- Group related functions
- Keep files focused and small
- Use subdirectories for logical grouping
- Document public APIs
- Include examples in docs
- Keep README files updated
- Use godoc comments for Go code
- Test files next to source files
- Integration tests in
/test - Property tests with
*_properties_test.go - Maintain high test coverage
When adding a new feature:
- Create spec in
.kiro/specs/ - Add models in
internal/models/ - Implement service in
internal/services/ - Add handlers in
internal/handlers/ - Write tests alongside code
- Update docs in
/docs/ - Add to README if user-facing