[Refactor] MCP: flatten to mcp_server package (drop src layout)#1584
Conversation
Rename the import package surfsense_mcp -> mcp_server and remove the src/ layer so the project mirrors the backend's shape (project folder != package name, e.g. surfsense_backend/app). Kills the redundant surfsense_mcp/src/surfsense_mcp nesting. Distribution name and console command (surfsense-mcp) are unchanged; only python -m and internal import paths move to mcp_server. Dockerfile CMD updated; no PYTHONPATH added since the editable install already makes the package importable.
|
@CREDO23 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (46)
📝 WalkthroughWalkthroughThe surfsense_mcp Python module was renamed to mcp_server. Changes update the Dockerfile CMD, pyproject.toml entrypoint and packaging path, all test imports, README setup instructions, documentation for MCP client integrations, and generated client command snippets to reference the new module name. ChangesModule rename from surfsense_mcp to mcp_server
Estimated code review effort: 1 (Trivial) | ~5 minutes Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Tools execution failed with the following error: Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error) Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
surfsense_mcp→mcp_serverand remove thesrc/layer, so the project mirrors the backend's shape (project folder ≠ package name, likesurfsense_backend/app). Removes thesurfsense_mcp/src/surfsense_mcpredundancy.surfsense-mcp) are unchanged — onlypython -mand internal import paths move tomcp_server.DockerfileCMD →python -m mcp_server; noPYTHONPATHadded since the editable install already makes the package importable.Test plan
uv run python -m mcp_server.selfcheck→18 tools registereduv run pytest→41 passedHigh-level PR Summary
This PR refactors the MCP server package structure by renaming the import package from
surfsense_mcptomcp_serverand removing the redundantsrc/layer. The distribution name and console command (surfsense-mcp) remain unchanged, but all internal imports and the module invocation command now usemcp_server. This aligns the project structure with the backend's pattern where the project folder name differs from the package name. The changes include updating thepyproject.tomlbuild configuration, Dockerfile CMD, test imports, and all documentation references across README files, the web documentation, and client configuration examples.⏱️ Estimated Review Time: 5-15 minutes
💡 Review Order Suggestion
surfsense_mcp/pyproject.tomlsurfsense_mcp/Dockerfilesurfsense_mcp/mcp_server/__init__.pysurfsense_mcp/mcp_server/__main__.pysurfsense_mcp/mcp_server/config.pysurfsense_mcp/mcp_server/server.pysurfsense_mcp/mcp_server/selfcheck.pysurfsense_mcp/tests/test_auth_headers.pysurfsense_mcp/tests/test_client_errors.pysurfsense_mcp/tests/test_client_params.pysurfsense_mcp/tests/test_note_ingestion.pysurfsense_mcp/tests/test_rendering.pysurfsense_mcp/tests/test_request_auth.pysurfsense_mcp/tests/test_workspace_context.pysurfsense_mcp/README.mdsurfsense_web/content/docs/how-to/mcp-server.mdxsurfsense_web/lib/mcp/clients.tssurfsense_mcp/mcp_server/core/__init__.pysurfsense_mcp/mcp_server/core/auth/__init__.pysurfsense_mcp/mcp_server/core/auth/headers.pysurfsense_mcp/mcp_server/core/auth/identity.pysurfsense_mcp/mcp_server/core/auth/middleware.pysurfsense_mcp/mcp_server/core/client.pysurfsense_mcp/mcp_server/core/errors.pysurfsense_mcp/mcp_server/core/rendering.pysurfsense_mcp/mcp_server/core/transport/__init__.pysurfsense_mcp/mcp_server/core/transport/http.pysurfsense_mcp/mcp_server/core/workspace_context.pysurfsense_mcp/mcp_server/core/workspace_matching.pysurfsense_mcp/mcp_server/features/__init__.pysurfsense_mcp/mcp_server/features/knowledge_base/__init__.pysurfsense_mcp/mcp_server/features/knowledge_base/annotations.pysurfsense_mcp/mcp_server/features/knowledge_base/document_tools.pysurfsense_mcp/mcp_server/features/knowledge_base/note_ingestion.pysurfsense_mcp/mcp_server/features/knowledge_base/search_tools.pysurfsense_mcp/mcp_server/features/scrapers/__init__.pysurfsense_mcp/mcp_server/features/scrapers/annotations.pysurfsense_mcp/mcp_server/features/scrapers/capability.pysurfsense_mcp/mcp_server/features/scrapers/platforms/__init__.pysurfsense_mcp/mcp_server/features/scrapers/platforms/google_maps.pysurfsense_mcp/mcp_server/features/scrapers/platforms/google_search.pysurfsense_mcp/mcp_server/features/scrapers/platforms/reddit.pysurfsense_mcp/mcp_server/features/scrapers/platforms/web.pysurfsense_mcp/mcp_server/features/scrapers/platforms/youtube.pysurfsense_mcp/mcp_server/features/scrapers/run_history.pysurfsense_mcp/mcp_server/features/workspaces/__init__.pySummary by CodeRabbit