Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,8 @@ jobs:
- name: Format check
run: ruff format --check .

- name: Type check
run: mypy src/

- name: Test
run: pytest -v
14 changes: 14 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dev = [
"pytest",
"pytest-asyncio",
"ruff",
"mypy",
]

[tool.ruff]
Expand All @@ -42,6 +43,19 @@ line-length = 100
[tool.ruff.lint]
select = ["E", "F", "I", "N", "W", "UP"]

[tool.mypy]
python_version = "3.11"
strict = true
warn_unused_ignores = true
warn_redundant_casts = true
warn_unreachable = true
show_error_codes = true
exclude = ["build/", "dist/"]

[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false

[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
4 changes: 2 additions & 2 deletions src/my_mcp_server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
# ---------------------------------------------------------------------------


def ok(data: str | dict) -> dict:
def ok(data: str | dict[str, object]) -> dict[str, object]:
"""Return a successful tool response."""
text = data if isinstance(data, str) else str(data)
return {"content": [{"type": "text", "text": text}]}


def err(message: str) -> dict:
def err(message: str) -> dict[str, object]:
"""Return an error tool response."""
return {"content": [{"type": "text", "text": message}], "isError": True}

Expand Down
Loading