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
4 changes: 3 additions & 1 deletion migrations/env.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import Any

from alembic import context
from sqlalchemy import create_engine, event, pool

Expand Down Expand Up @@ -58,7 +60,7 @@ def run_migrations_online() -> None:
raise ValueError("db_url is required for migrations")

# Add SQLite-specific connection args for read-only root filesystem environments
engine_kwargs = {"poolclass": pool.NullPool}
engine_kwargs: dict[str, Any] = {"poolclass": pool.NullPool}
if db_url.startswith("sqlite://"):
# Ensure absolute path
if db_url.startswith("sqlite:///"):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dev = [
"pytest>=9.0.2",
"pytest-asyncio>=1.3.0",
"ruff>=0.15.7",
"ty>=0.0.15",
"ty>=0.0.24",
"pytest-cov>=7.0.0",
]
security = [
Expand Down
4 changes: 2 additions & 2 deletions src/mcp_optimizer/db/base_tool_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ async def get_all_tools(

tool = self.tool_model_class.model_validate(row_data)
tool_with_metadata = self.tool_with_metadata_model_class(
tool=tool,
tool=cast(Any, tool),
server_name=server_name,
server_description=server_description,
distance=0.0, # Distance not applicable for get_all
Expand Down Expand Up @@ -1041,7 +1041,7 @@ async def _fetch_tools_with_metadata(

# Create metadata object
tool_with_metadata = self.tool_with_metadata_model_class(
tool=tool,
tool=cast(Any, tool),
server_name=server_name,
server_description=server_description,
distance=distance,
Expand Down
2 changes: 1 addition & 1 deletion src/mcp_optimizer/db/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, database_url: str):
self.database_url = _normalize_sqlite_url(database_url)
# Configure connection pool for better concurrency handling
# SQLite doesn't support connection pooling parameters
engine_kwargs = {"echo": False}
engine_kwargs: dict[str, Any] = {"echo": False}
if not self.database_url.startswith("sqlite"):
engine_kwargs.update(
{
Expand Down
2 changes: 1 addition & 1 deletion src/mcp_optimizer/ingestion.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ async def _upsert_workload_server(
return (existing_server.id, False)

# Update server
update_kwargs = {
update_kwargs: dict[str, Any] = {
"status": status,
"transport": transport,
"url": workload.url,
Expand Down
2 changes: 1 addition & 1 deletion src/mcp_optimizer/toolhive/toolhive_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ async def _list_workloads_impl() -> WorkloadListResponse:
valid_workloads.append(Workload.model_validate(raw_workload))
except Exception as e:
name = (
raw_workload.get("name", f"index-{i}")
cast(dict[str, Any], raw_workload).get("name", f"index-{i}")
if isinstance(raw_workload, dict)
else f"index-{i}"
)
Expand Down
178 changes: 89 additions & 89 deletions uv.lock

Large diffs are not rendered by default.

Loading