[project]
name = "chmcp"
version = "0.1.2"
description = "A comprehensive Model Context Protocol (MCP) server for ClickHouse database operations and ClickHouse Cloud management."
readme = "README.md"
license = "Apache-2.0"
license-files = ["LICENSE"]
authors = [
{ name = "Badr Ouali", email = "badr.ouali@outlook.fr" }
]
maintainers = [
{ name = "Badr Ouali", email = "badr.ouali@outlook.fr" }
]
keywords = [
"mcp",
"clickhouse",
"database",
"cloud",
"sql",
"analytics",
"model-context-protocol"
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Database",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Systems Administration",
"Typing :: Typed",
]
requires-python = ">=3.12"
dependencies = [
"mcp[cli]>=1.4.0",
"python-dotenv>=1.0.1",
"uvicorn>=0.34.0",
"clickhouse-connect>=0.8.16",
"pip-system-certs>=4.0",
"requests>=2.31.0",
]
[project.scripts]
chmcp = "chmcp.main:main"
[project.urls]
Homepage = "https://github.com/oualib/chmcp"
Repository = "https://github.com/oualib/chmcp"
Documentation = "https://github.com/oualib/chmcp#readme"
"Bug Tracker" = "https://github.com/oualib/chmcp/issues"
Changelog = "https://github.com/oualib/chmcp/releases"
[project.optional-dependencies]
dev = [
"ruff>=0.8.0",
"pytest>=8.0.0",
"pytest-asyncio>=0.23.0",
"mypy>=1.8.0",
"black>=24.0.0",
"isort>=5.13.0",
"pre-commit>=3.6.0",
]
test = [
"pytest>=8.0.0",
"pytest-asyncio>=0.23.0",
"pytest-cov>=4.0.0",
"pytest-mock>=3.12.0",
]
docs = [
"mkdocs>=1.5.0",
"mkdocs-material>=9.5.0",
"mkdocstrings[python]>=0.24.0",
]
[project.entry-points."mcp.servers"]
clickhouse = "chmcp.main:main"
[tool.hatch.build.targets.wheel]
packages = ["chmcp"]
[tool.hatch.version]
path = "chmcp/__init__.py"
[tool.ruff]
line-length = 100
target-version = "py313"
extend-include = ["*.ipynb"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"ARG001", # unused-function-argument
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"TID", # flake8-tidy-imports
"Q", # flake8-quotes
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"ERA", # eradicate
"PD", # pandas-vet
"PYI", # flake8-pyi
"N", # pep8-naming
"ASYNC", # flake8-async
"S", # flake8-bandit
"BLE", # flake8-blind-except
"FBT", # flake8-boolean-trap
"A", # flake8-builtins
"COM", # flake8-commas
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"T10", # flake8-debugger
"DJ", # flake8-django
"EM", # flake8-errmsg
"EXE", # flake8-executable
"FA", # flake8-future-annotations
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"G", # flake8-logging-format
"INP", # flake8-no-pep420
"RSE", # flake8-raise
"RET", # flake8-return
"SLF", # flake8-self
"SLOT", # flake8-slots
"T20", # flake8-print
"TRY", # tryceratops
"FLY", # flynt
"PERF", # perflint
"FURB", # refurb
"LOG", # flake8-logging
"RUF", # ruff-specific rules
]
ignore = [
"E501", # line too long, handled by formatter
"S101", # use of assert
"PLR0913", # too many arguments
"PLR0915", # too many statements
"COM812", # trailing comma missing
"ISC001", # single line implicit string concatenation
]
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
"S101", # asserts allowed in tests
"ARG", # unused function args allowed in tests
"FBT", # boolean trap allowed in tests
"PLR2004", # magic values allowed in tests
"S311", # random allowed in tests
]
[tool.ruff.lint.isort]
force-single-line = true
lines-after-imports = 2
known-first-party = ["chmcp"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.mypy]
python_version = "3.12"
strict = true
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = 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
show_error_codes = true
[[tool.mypy.overrides]]
module = [
"clickhouse_connect.*",
"mcp.*",
"uvicorn.*",
]
ignore_missing_imports = true
[tool.pytest.ini_options]
minversion = "8.0"
addopts = [
"--strict-markers",
"--strict-config",
"--verbose",
"--cov=chmcp",
"--cov-report=term-missing",
"--cov-report=html",
"--cov-report=xml",
]
testpaths = ["tests"]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
"unit: marks tests as unit tests",
]
[tool.coverage.run]
source = ["chmcp"]
omit = [
"tests/*",
"*/test_*",
"*/__pycache__/*",
]
[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.black]
line-length = 100
target-version = ['py313']
include = '\.pyi?$'
extend-exclude = '''
/(
# directories
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| build
| dist
)/
'''
[build-system]
requires = ["hatchling>=1.21.0"]
build-backend = "hatchling.build"