refactor(mcp): flatten to mcp_server package, drop src layout

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.
This commit is contained in:
CREDO23 2026-07-07 20:24:53 +02:00
parent 839618ef09
commit 116291a3b6
46 changed files with 31 additions and 31 deletions

View file

@ -52,7 +52,7 @@ function bearer(apiKey: string): string {
}
function serverArgs(serverDir: string): string[] {
return ["run", "--directory", serverDir, "python", "-m", "surfsense_mcp"];
return ["run", "--directory", serverDir, "python", "-m", "mcp_server"];
}
/** The `mcpServers` remote shape shared by Cursor, Windsurf, and Gemini CLI. */
@ -110,7 +110,7 @@ export const MCP_CLIENTS: McpClient[] = [
"claude mcp add surfsense \\",
` -e SURFSENSE_BASE_URL=${baseUrl} \\`,
` -e SURFSENSE_API_KEY=${apiKey} \\`,
` -- uv run --directory ${serverDir} python -m surfsense_mcp`,
` -- uv run --directory ${serverDir} python -m mcp_server`,
].join("\n"),
},
},
@ -139,7 +139,7 @@ export const MCP_CLIENTS: McpClient[] = [
configFile: "~/.codex/config.toml",
language: "toml",
steps: [
"Add this to ~/.codex/config.toml (or run `codex mcp add surfsense -- uv run --directory <dir> python -m surfsense_mcp`).",
"Add this to ~/.codex/config.toml (or run `codex mcp add surfsense -- uv run --directory <dir> python -m mcp_server`).",
"Restart Codex; `codex mcp list` should show surfsense.",
],
build: ({ baseUrl, apiKey, serverDir }) =>