Skip to content

feat(4.9): Extract MCPServer into openspace/mcp/server.py#37

Merged
Deepfreezechill merged 2 commits intomainfrom
epic/4.9-mcp-server-extract
Apr 3, 2026
Merged

feat(4.9): Extract MCPServer into openspace/mcp/server.py#37
Deepfreezechill merged 2 commits intomainfrom
epic/4.9-mcp-server-extract

Conversation

@Deepfreezechill
Copy link
Copy Markdown
Owner

Epic 4.9: Extract MCPRouter + MCPServer

Changes

  • New: \openspace/mcp/server.py\ (236 lines) — _MCPSafeStdout, logging bootstrap, create_mcp_app(), run_mcp_server()
  • New: \ ests/test_mcp_server.py\ — 15 tests (_MCPSafeStdout, create_mcp_app, cleanup)
  • Modified: \mcp_server.py\ → 42-line backward-compat shim with lazy proxy
  • Modified: \ ool_handlers.py\ docstring update (L1)
  • Skipped: Epic 4.8 (auth already extracted in P3 to openspace/auth/)

openspace/mcp/ Package (complete)

Module Lines Responsibility
server.py 236 Bootstrap, FastMCP, entry point
tool_handlers.py 799 4 MCP tools + helpers
init.py 2 Package marker
Total 1,037

mcp_server.py: 992 → 42 lines (backward-compat shim)

Review Results (/8eyes + /collab) — Outcome-Focused

Reviewer Verdict Key Check
8eyes-impl ✅ PASS C1 fixed (test assertion), M1 fixed (lazy proxy)
8eyes-sec ✅ PASS Auth chain intact, fail-closed preserved
/collab GPT-5.4 ✅ APPROVE 4 tools registered, stdio/SSE paths verified
/collab Opus 4.6 ✅ APPROVE No double-init, import chain traced

All 1,391 tests pass, 117 skipped.

Brian Krafft and others added 2 commits April 3, 2026 14:06
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>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2026

🔒 Phase Gate Enforcement — 🚫 FAIL

Check Result Detail
Issue linkage No linked issues found. PR must contain "Closes #N", "Fixes #N", or "Resolves #N".

Verdict: FAIL
Timestamp: 2026-04-03T21:15:55.780Z
Run: View workflow run


How to fix: Ensure all prerequisite phases are complete, or add emergency:bypass label with a ## Bypass Reason section in the PR body.

@Deepfreezechill Deepfreezechill merged commit 9260f31 into main Apr 3, 2026
0 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant