[project] name = "mtg-mcp-server" version = "3.0.0" description = "Magic: The Gathering card search, combo lookup, draft analytics, and Commander tools." readme = "README.md" license = "MIT" authors = [{ name = "Justin Forth", email = "justinforth@gmail.com" }] requires-python = ">=3.12" keywords = [ "mtg", "magic-the-gathering", "mcp", "model-context-protocol", "commander", "edh", "draft", "limited", "scryfall", "edhrec", "17lands", "commander-spellbook", "rules-engine", "composition", "ai", "claude", ] classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Topic :: Games/Entertainment", "Typing :: Typed", ] dependencies = [ "cachetools>=6.0", "fastmcp>=3.2.0", "httpx>=0.28", "pydantic>=2.0", "pydantic-settings>=2.0", "tenacity>=9.0", "structlog>=24.0", "smithery>=0.4.4", "selectolax>=0.4.7", ] [project.optional-dependencies] code-mode = ["fastmcp[code-mode]>=3.2.0"] [project.urls] Homepage = "https://github.com/j4th/mtg-mcp-server" Repository = "https://github.com/j4th/mtg-mcp-server" Issues = "https://github.com/j4th/mtg-mcp-server/issues" Changelog = "https://github.com/j4th/mtg-mcp-server/blob/main/CHANGELOG.md" [project.scripts] mtg-mcp-server = "mtg_mcp_server.server:main" [build-system] requires = ["uv_build>=0.10.9,<0.12.0"] build-backend = "uv_build" # --------------------------------------------------------------------------- # Dependency groups (PEP 735) — managed by uv, NOT pip # --------------------------------------------------------------------------- [dependency-groups] dev = [ "pip-audit>=2.10.0", "pygments>=2.20.0", "pyyaml>=6.0", "pytest>=8.0", "pytest-asyncio>=0.24", "pytest-cov>=6.0", "pytest-testmon>=2.2.0", "pytest-timeout>=2.3", "respx>=0.22", ] # --------------------------------------------------------------------------- # uv # --------------------------------------------------------------------------- [tool.uv] # Sync dev group by default default-groups = ["dev"] # --------------------------------------------------------------------------- # Ruff — linting & formatting # --------------------------------------------------------------------------- [tool.smithery] server = "mtg_mcp_server.smithery:create_server" [tool.ruff] line-length = 100 target-version = "py312" [tool.ruff.lint] select = [ "E", # pycodestyle errors "F", # Pyflakes "I", # isort — import sorting "UP", # pyupgrade — modernize syntax for 3.12+ "B", # flake8-bugbear — common pitfalls "SIM", # flake8-simplify — simplifiable constructs "TCH", # flake8-type-checking — guard typing-only imports "RUF", # Ruff-specific rules "ASYNC", # flake8-async — async/await correctness "PT", # flake8-pytest-style — pytest best practices "LOG", # flake8-logging — logging best practices ] ignore = [ "E501", # line length — handled by formatter "UP007", # Use X | Y syntax — ty doesn't always agree with ruff here ] [tool.ruff.lint.per-file-ignores] "tests/**" = [ "B011", # assert False is fine in tests "B017", # pytest.raises(Exception) is fine in tests ] [tool.ruff.lint.isort] known-first-party = ["mtg_mcp_server"] [tool.ruff.format] docstring-code-format = true # --------------------------------------------------------------------------- # ty — type checking # --------------------------------------------------------------------------- [tool.ty.environment] python-version = "3.12" [tool.ty.src] # Only check our source; skip venv, build artifacts, etc. include = ["src/"] [tool.ty.rules] # Strict — catch missing imports and attributes early possibly-missing-import = "error" possibly-missing-attribute = "warn" # --------------------------------------------------------------------------- # pytest # --------------------------------------------------------------------------- [tool.pytest.ini_options] asyncio_mode = "auto" testpaths = ["tests"] filterwarnings = [ "error", # treat warnings as errors by default "ignore::DeprecationWarning", # except deprecation warnings from deps ] addopts = "--ignore=tests/live" markers = [ "integration: marks tests requiring full orchestrator (deselect with '-m \"not integration\"')", "live: marks tests that start a real server and hit real APIs (deselect with '-m \"not live\"')", ] # --------------------------------------------------------------------------- # coverage # --------------------------------------------------------------------------- [tool.coverage.run] source = ["mtg_mcp_server"] branch = true [tool.coverage.report] show_missing = true fail_under = 80 exclude_lines = [ "pragma: no cover", "if TYPE_CHECKING:", "if __name__ == .__main__.:", "@overload", "raise NotImplementedError", ]