feat(4.9): Extract MCPServer into openspace/mcp/server.py#37
Merged
Deepfreezechill merged 2 commits intomainfrom Apr 3, 2026
Merged
feat(4.9): Extract MCPServer into openspace/mcp/server.py#37Deepfreezechill merged 2 commits intomainfrom
Deepfreezechill merged 2 commits intomainfrom
Conversation
Extract all MCP server bootstrap, FastMCP creation, and run_mcp_server() from mcp_server.py into openspace/mcp/server.py. Changes: - Create openspace/mcp/server.py (236 lines) with: - _MCPSafeStdout class (stdio transport wrapper) - Logging/stderr bootstrap (Windows pipe deadlock prevention) - create_mcp_app() factory (FastMCP + tool handler registration) - run_mcp_server() entry point (CLI, transport, auth middleware) - Slim mcp_server.py to 34-line thin entry point (re-exports + __main__) - Add 15 new tests in test_mcp_server.py - Skip Epic 4.8 (auth middleware already extracted in P3) openspace/mcp/ package now owns all MCP concerns: server.py — bootstrap, FastMCP, entry point (236 lines) tool_handlers.py — 4 MCP tools + helpers (799 lines) __init__.py — package marker Original mcp_server.py: 992 lines → 34-line backward-compat shim. All 1,391 tests pass, 117 skipped. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- C1: test_tools_registered now asserts all 4 tool names (was no-op) - M1: mcp_server.py uses lazy proxy — no wasted FastMCP on console script - L1: register_handlers docstring updated to reference create_mcp_app() Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔒 Phase Gate Enforcement — 🚫 FAIL
Verdict: FAIL
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Epic 4.9: Extract MCPRouter + MCPServer
Changes
openspace/mcp/ Package (complete)
mcp_server.py: 992 → 42 lines (backward-compat shim)
Review Results (/8eyes + /collab) — Outcome-Focused
All 1,391 tests pass, 117 skipped.