# ==============================================================================
# Project
# ==============================================================================
[project]
name = "mcp-brain"
version = "0.1.0"
description = "AIエージェントに統合的な知識を提供するMCPサーバー"
readme = "README.md"
requires-python = ">=3.13,<3.14"
dependencies = [
"mcp[cli]>=1.0.0",
"pydantic>=2.0.0",
"pyyaml>=6.0.0",
"sentence-transformers>=3.0.0",
"gitpython>=3.1.0",
"sentencepiece>=0.2.0",
"protobuf>=5.0.0",
]
[project.scripts]
mcp-brain = "mcp_brain.server:main"
[dependency-groups]
dev = [
"pyright",
"ruff",
"pytest",
"pytest-cov",
"pytest-randomly",
"pytest-xdist",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/mcp_brain"]
# ==============================================================================
# Linter / Formatter
# ==============================================================================
[tool.ruff]
target-version = "py313"
[tool.ruff.lint]
select = [
"E", "W", "F", # 基本的なコードスタイルとエラー検出
"I", # import文の並び順を自動整理
"B", # バグになりやすい危険なパターンを検出
"C4", # リスト内包表記等の最適化を提案
"UP", # 古い書き方を新しいPython構文に変換
"ANN", # 関数の型注釈を強制
"ARG", # 未使用の引数を検出
"SIM", # 冗長なコードをシンプルに
"TCH", # TYPE_CHECKINGブロックの適切な使用
"PTH", # os.path → pathlib への移行を促進
"N", # pep8-naming: 命名規則チェック
"T20", # print文禁止
"LOG", # loggingのベストプラクティス
"G", # ログフォーマット最適化
"PT", # pytest用ルール
]
ignore = [
"G004", # f-stringログは許容(可読性優先)
]
fixable = ["ALL"]
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["ANN", "ARG"] # テストでは型注釈・未使用引数を緩和
# ==============================================================================
# Type Checker
# ==============================================================================
[tool.pyright]
pythonVersion = "3.13"
typeCheckingMode = "standard"
# ==============================================================================
# Test
# ==============================================================================
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = [
"-ra", # 失敗・スキップ等の理由を表示
"-v", # 詳細出力
"--strict-markers", # 未登録マーカーをエラーに
"--strict-config", # 設定エラーを厳格に検出
"-p", "no:cacheprovider", # キャッシュ無効化
]
[tool.coverage.run]
source = ["src"]
branch = true
[tool.coverage.report]
fail_under = 50