pyproject.toml•7.29 kB
[build-system]
requires = ["setuptools>=68.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "codebase-mcp"
version = "0.1.0"
description = "Production-grade MCP server for semantic code search with PostgreSQL pgvector"
readme = "README.md"
requires-python = ">=3.11"
license = { text = "MIT" }
authors = [
{ name = "Cliff Clarke", email = "cliff@example.com" }
]
keywords = ["mcp", "semantic-search", "code-indexing", "ai-assistant", "pgvector"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Framework :: FastAPI",
"Topic :: Software Development :: Libraries :: Application Frameworks",
"Typing :: Typed",
]
dependencies = [
# Web Framework
"fastapi>=0.109.0",
"uvicorn[standard]>=0.27.0",
# Database & ORM
"sqlalchemy[asyncpg]>=2.0.25",
"alembic>=1.13.0",
"pgvector>=0.2.4",
# Data Validation & Settings
"pydantic>=2.5.0",
"pydantic-settings>=2.1.0",
# MCP Protocol
"mcp>=0.9.0",
# Code Parsing
"tree-sitter>=0.21.0",
"tree-sitter-python>=0.21.0",
"tree-sitter-javascript>=0.21.0",
"pathspec>=0.11.0", # .gitignore pattern matching
# HTTP Client for Ollama
"httpx>=0.26.0",
# Utilities
"python-dotenv>=1.0.0",
]
[project.optional-dependencies]
dev = [
# Testing
"pytest>=7.4.0",
"pytest-asyncio>=0.23.0",
"pytest-cov>=4.1.0",
"pytest-mock>=3.12.0",
"pytest-timeout>=2.2.0",
# Type Checking
"mypy>=1.8.0",
"types-requests>=2.31.0",
# Linting & Formatting
"ruff>=0.1.11",
# Performance Profiling
"py-spy>=0.3.14",
]
[project.urls]
Homepage = "https://github.com/cliffclarke/codebase-mcp"
Repository = "https://github.com/cliffclarke/codebase-mcp"
Issues = "https://github.com/cliffclarke/codebase-mcp/issues"
[project.scripts]
codebase-mcp = "src.main:main"
[tool.setuptools.packages.find]
where = ["."]
include = ["src*"]
namespaces = false
# ==============================================================================
# Tool Configurations
# ==============================================================================
[tool.mypy]
# Strict Mode (Constitutional Principle VIII: Type Safety)
strict = true
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_any_unimported = false
disallow_any_expr = false
disallow_any_decorated = false
disallow_any_explicit = false
disallow_any_generics = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true
strict_concatenate = true
# Async Support
plugins = ["pydantic.mypy"]
[[tool.mypy.overrides]]
module = [
"tree_sitter.*",
"pgvector.*",
"mcp.*",
]
ignore_missing_imports = true
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
# ==============================================================================
# Ruff Configuration (Linting & Formatting)
# ==============================================================================
[tool.ruff]
target-version = "py311"
line-length = 100
indent-width = 4
src = ["src", "tests"]
[tool.ruff.lint]
# Enable recommended rules + additional strict rules
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"ANN", # flake8-annotations
"ASYNC", # flake8-async
"S", # flake8-bandit (security)
"B", # flake8-bugbear
"A", # flake8-builtins
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"T10", # flake8-debugger
"EM", # flake8-errmsg
"FA", # flake8-future-annotations
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"G", # flake8-logging-format
"PIE", # flake8-pie
"T20", # flake8-print
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RSE", # flake8-raise
"RET", # flake8-return
"SLF", # flake8-self
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
"TCH", # flake8-type-checking
"ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
"ERA", # eradicate
"PL", # pylint
"TRY", # tryceratops
"FLY", # flynt
"PERF", # perflint
"RUF", # ruff-specific rules
]
ignore = [
"ANN101", # Missing type annotation for self
"ANN102", # Missing type annotation for cls
"D", # pydocstyle (optional - enable if you want docstring enforcement)
"COM812", # Trailing comma (conflicts with formatter)
"ISC001", # Implicit string concatenation (conflicts with formatter)
]
# Allow autofix for all enabled rules (when `--fix` is provided)
fixable = ["ALL"]
unfixable = []
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
"S101", # Allow assert in tests
"ANN201", # Allow missing return type in tests
"ARG001", # Allow unused function arguments (fixtures)
"PLR2004", # Allow magic values in tests
]
"migrations/**/*.py" = [
"ANN", # Allow missing type annotations in migrations
]
[tool.ruff.lint.isort]
known-first-party = ["src"]
force-sort-within-sections = true
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
# ==============================================================================
# Pytest Configuration
# ==============================================================================
[tool.pytest.ini_options]
minversion = "7.0"
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
# Async support
asyncio_mode = "auto"
# Coverage
addopts = [
"--strict-markers",
"--strict-config",
"--cov=src",
"--cov-report=term-missing",
"--cov-report=html",
"--cov-report=xml",
"--cov-fail-under=95",
"-vv",
"--tb=short",
]
# Markers
markers = [
"unit: Unit tests (fast, isolated)",
"integration: Integration tests (database, external services)",
"contract: Contract/API tests (MCP protocol compliance)",
"slow: Slow-running tests (performance benchmarks)",
]
# Timeout for tests (prevent hanging)
timeout = 300
[tool.coverage.run]
branch = true
source = ["src"]
omit = [
"*/tests/*",
"*/migrations/*",
"*/__pycache__/*",
"*/.venv/*",
]
[tool.coverage.report]
precision = 2
show_missing = true
skip_covered = false
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if TYPE_CHECKING:",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"@(abc\\.)?abstractmethod",
]
[tool.coverage.html]
directory = "htmlcov"