Skip to content

Commit cb62c2f

Browse files
committed
style: fix ruff check — drop unused re-exports, retarget imports
Ruff autofix removed unused re-exports from http_common.py. The three security helpers (validate_host_header, enforce_same_origin_write, resolve_allowed_origin) were re-exported there for backward-compat but genuinely not used by http_common itself. Retargeted the two callers (http_standalone.py, http_standalone_endpoints.py) to import straight from http_security where the real implementations live. All 17 F401 issues resolved. Lint + format + 1657 tests green.
1 parent 2904be8 commit cb62c2f

5 files changed

Lines changed: 4 additions & 23 deletions

File tree

mcp_server/core/workflow_graph_schema.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,6 @@
2727

2828
# Re-export enums + palette so existing callers (handlers, builder,
2929
# tests) keep importing from ``workflow_graph_schema`` unchanged.
30-
from mcp_server.core.workflow_graph_palette import (
31-
AGENT_COLOR,
32-
COMMAND_COLOR,
33-
DISCUSSION_COLOR,
34-
DOMAIN_COLOR,
35-
ENTITY_COLOR,
36-
HOOK_COLOR,
37-
MCP_COLOR,
38-
MEMORY_STAGE_COLORS,
39-
PRIMARY_TOOL_COLORS,
40-
SKILL_COLOR,
41-
TOOL_HUB_COLORS,
42-
classify_primary_tool,
43-
primary_tool_color,
44-
)
4530
from mcp_server.core.workflow_graph_schema_enums import (
4631
EdgeKind,
4732
NodeKind,

mcp_server/server/http_common.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@
4040
# backward-compatibility with existing import sites.
4141
from mcp_server.server.http_security import ( # noqa: E402
4242
_apply_cors_headers,
43-
enforce_same_origin_write,
44-
resolve_allowed_origin,
45-
validate_host_header,
4643
)
4744

4845

mcp_server/server/http_file_diff.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ def serve_file_diff(handler) -> None:
3333
handler.end_headers()
3434
return
3535

36-
from pathlib import Path
37-
3836
from mcp_server.infrastructure.git_diff import (
3937
find_git_root,
4038
get_file_diff,

mcp_server/server/http_standalone.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
from pathlib import Path
2929
from socketserver import ThreadingMixIn
3030

31-
from mcp_server.server.http_common import (
32-
_apply_cors_headers,
31+
from mcp_server.server.http_common import _apply_cors_headers
32+
from mcp_server.server.http_security import (
3333
enforce_same_origin_write,
3434
validate_host_header,
3535
)

mcp_server/server/http_standalone_endpoints.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
from http.server import BaseHTTPRequestHandler
2020
from pathlib import Path
2121

22-
from mcp_server.server.http_common import _apply_cors_headers, validate_host_header
22+
from mcp_server.server.http_common import _apply_cors_headers
23+
from mcp_server.server.http_security import validate_host_header
2324
from mcp_server.server.http_standalone_graph import (
2425
build_discussion_detail,
2526
build_discussions_response,

0 commit comments

Comments
 (0)