src/: Python package with core modules —mcp_server/(MCP server),scanner/,parser/,query/,embeddings/,database/,domain/,indexer/,utils/.tests/: Mirrorssrc/by area withtest_*.pyfiles; includesunit/,integration/, and feature folders.docs/,alembic.ini,docker-compose.yml,config.example.yaml,settings.tomlsupport docs, DB migrations, and config.- Entry points (installed via
uv):mcp-code-server,mcp-scanner,mcp-indexer.
- Install deps:
make dev-install(dev + pre-commit) ormake install(prod only). - Lint/format/type-check:
make lint,make format,make type-check, full QA:make qa. - Run tests:
make test(unit),make test-integration,make test-all, coverage HTML:make coverage-html. - Quick feedback loop (Just):
just unveil-next-error,just see-what-you-did-there. - Run locally:
uv run mcp-code-serveroruv run python -m src.mcp_server.
- Python 3.11+, Black (88 cols), Ruff, isort; 4-space indents.
- Type hints required in code paths (mypy strict settings); prefer explicit return types.
- Imports: prefer absolute; relative imports are lint-banned.
- Naming:
snake_casefor functions/vars,PascalCaseclasses,lower_snake_case.pymodules, package dirs lowercase.
- Framework:
pytestwith markers:unit,integration,slow,requires_db,requires_openai. - Structure:
tests/<area>/test_*.py; keep tests close to the feature area. - Run examples:
uv run pytest -m "unit" -q,uv run pytest -m "integration" -v. - Coverage is preconfigured (
--cov=src); open report viamake coverage-html.
- Use Conventional Commits: e.g.,
feat: …,fix: …,docs: …,refactor: …,ci: …,chore: …. - Scope when helpful:
fix(scanner): handle rate limit. - PRs: follow
.github/pull_request_template.md— clear description, linked issue (Fixes #123), tests, and any screenshots where relevant. - Keep changes focused and ensure
make qapasses locally.
- Never commit secrets. Use env vars (e.g.,
OPENAI_API_KEY) or.envlocally. - Start from
config.example.yaml→ createconfig.yaml(untracked) for repos, DB, embeddings, and server settings. - Optional containers:
docker-compose up -dto bring up services; prefer localuvfor dev.