[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "context-engineering-mcp"
version = "2.0.0"
description = "Context Engineering MCP Platform - AI-powered context management with MCP integration"
authors = [
    { name = "Context Engineering Team", email = "team@context-engineering.ai" }
]
readme = "README.md"
license = { text = "MIT" }
requires-python = ">=3.9"
classifiers = [
    "Development Status :: 4 - Beta",
    "Intended Audience :: Developers",
    "License :: OSI Approved :: MIT License",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.9",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Topic :: Software Development :: Libraries :: Python Modules",
    "Topic :: Scientific/Engineering :: Artificial Intelligence",
]
dependencies = [
    "fastapi>=0.111.0",
    "uvicorn[standard]>=0.29.0",
    "python-dotenv>=1.0.0",
    "requests>=2.32.3",
    "pydantic>=2.10.3",
    "google-generativeai>=0.8.3",
    "cryptography>=41.0.0",
    "pyjwt>=2.8.0",
]

[project.optional-dependencies]
dev = [
    "pytest>=7.4.0",
    "pytest-asyncio>=0.21.0",
    "pytest-cov>=4.1.0",
    "pytest-mock>=3.11.1",
    "httpx>=0.24.1",
    "black>=23.7.0",
    "isort>=5.12.0",
    "ruff>=0.0.284",
    "mypy>=1.5.1",
    "pre-commit>=3.3.0",
]
security = [
    "passlib[bcrypt]>=1.7.4",
    "python-jose[cryptography]>=3.3.0",
    "slowapi>=0.1.9",
    "secure>=0.3.0",
    "bleach>=6.0.0",
]
monitoring = [
    "structlog>=23.0.0",
    "sentry-sdk[fastapi]>=1.32.0",
    "prometheus-client>=0.18.0",
]

[project.urls]
Homepage = "https://github.com/ShunsukeHayashi/context_engineering_MCP"
Repository = "https://github.com/ShunsukeHayashi/context_engineering_MCP.git"
Documentation = "https://github.com/ShunsukeHayashi/context_engineering_MCP#readme"
Issues = "https://github.com/ShunsukeHayashi/context_engineering_MCP/issues"

[project.scripts]
context-mcp-server = "mcp-server.context_mcp_server:main"

# === Tool Configuration ===

[tool.black]
line-length = 88
target-version = ['py39']
include = '\.pyi?$'
extend-exclude = '''
/(
  # directories
  \.eggs
  | \.git
  | \.hg
  | \.mypy_cache
  | \.tox
  | \.venv
  | build
  | dist
  | node_modules
)/
'''

[tool.isort]
profile = "black"
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
line_length = 88
src_paths = [".", "context_engineering", "workflow_system", "mcp-server"]
skip_gitignore = true
known_first_party = ["context_engineering", "workflow_system"]

[tool.ruff]
target-version = "py39"
line-length = 88
select = [
    "E",  # pycodestyle errors
    "W",  # pycodestyle warnings
    "F",  # pyflakes
    "I",  # isort
    "B",  # flake8-bugbear
    "C4", # flake8-comprehensions
    "UP", # pyupgrade
    "N",  # pep8-naming
    "S",  # bandit (security)
    "T20", # flake8-print
    "PT", # flake8-pytest-style
    "RET", # flake8-return
    "SIM", # flake8-simplify
    "TCH", # flake8-type-checking
]
ignore = [
    "E501",  # line too long, handled by black
    "B008",  # do not perform function calls in argument defaults
    "C901",  # too complex
    "S101",  # use of assert detected
    "S104",  # possible binding to all interfaces
    "S105",  # possible hardcoded password
    "S106",  # possible hardcoded password
    "S107",  # possible hardcoded password
    "S113",  # probable use of requests without timeout
]
unfixable = ["B"]
exclude = [
    ".bzr",
    ".direnv",
    ".eggs",
    ".git",
    ".hg",
    ".mypy_cache",
    ".nox",
    ".pants.d",
    ".ruff_cache",
    ".svn",
    ".tox",
    ".venv",
    "__pypackages__",
    "_build",
    "buck-out",
    "build",
    "dist",
    "node_modules",
    "venv",
]

[tool.ruff.per-file-ignores]
"__init__.py" = ["E402"]
"**/{tests,docs,tools}/*" = ["E402", "S101", "T20"]

[tool.mypy]
python_version = "3.9"
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_return_any = true
strict_equality = true
show_error_codes = true

[[tool.mypy.overrides]]
module = [
    "google.generativeai.*",
    "google.ai.generativelanguage.*",
    "respx.*",
    "freezegun.*",
]
ignore_missing_imports = true

[tool.pytest.ini_options]
minversion = "7.0"
addopts = [
    "-ra",
    "--strict-markers",
    "--strict-config",
    "--cov=.",
    "--cov-report=term-missing",
    "--cov-report=html:htmlcov",
    "--cov-report=xml",
    "--cov-fail-under=80",
]
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
markers = [
    "slow: marks tests as slow (deselect with '-m \"not slow\"')",
    "integration: marks tests as integration tests",
    "unit: marks tests as unit tests",
    "security: marks tests as security tests",
    "api: marks tests as API tests",
]
filterwarnings = [
    "ignore::UserWarning",
    "ignore::DeprecationWarning",
]
asyncio_mode = "auto"

[tool.coverage.run]
source = ["."]
omit = [
    "*/tests/*",
    "*/test_*",
    "*/__pycache__/*",
    "*/venv/*",
    "*/env/*",
    "*/node_modules/*",
    "setup.py",
    "conftest.py",
]

[tool.coverage.report]
exclude_lines = [
    "pragma: no cover",
    "def __repr__",
    "if self.debug:",
    "if settings.DEBUG",
    "raise AssertionError",
    "raise NotImplementedError",
    "if 0:",
    "if __name__ == .__main__.:",
    "class .*\\bProtocol\\):",
    "@(abc\\.)?abstractmethod",
]

[tool.bandit]
exclude_dirs = ["tests", "test_*"]
skips = ["B101", "B601"]

[tool.bandit.assert_used]
skips = ["**/test_*.py", "**/tests.py"]