mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-22 23:31:12 +02:00
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:
parent
839618ef09
commit
116291a3b6
46 changed files with 31 additions and 31 deletions
|
|
@ -33,4 +33,4 @@ ENV PYTHONUNBUFFERED=1 \
|
|||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["python", "-m", "surfsense_mcp"]
|
||||
CMD ["python", "-m", "mcp_server"]
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ remote support. It uses [uv](https://github.com/astral-sh/uv):
|
|||
```bash
|
||||
cd surfsense_mcp
|
||||
uv sync
|
||||
uv run python -m surfsense_mcp.selfcheck # verify tools register correctly
|
||||
uv run python -m mcp_server.selfcheck # verify tools register correctly
|
||||
```
|
||||
|
||||
Then add it to your client. Cursor (`~/.cursor/mcp.json` or a project
|
||||
|
|
@ -86,7 +86,7 @@ Then add it to your client. Cursor (`~/.cursor/mcp.json` or a project
|
|||
"mcpServers": {
|
||||
"surfsense": {
|
||||
"command": "uv",
|
||||
"args": ["run", "--directory", "/absolute/path/to/SurfSense/surfsense_mcp", "python", "-m", "surfsense_mcp"],
|
||||
"args": ["run", "--directory", "/absolute/path/to/SurfSense/surfsense_mcp", "python", "-m", "mcp_server"],
|
||||
"env": {
|
||||
"SURFSENSE_BASE_URL": "http://localhost:8000",
|
||||
"SURFSENSE_API_KEY": "ss_pat_your_token_here"
|
||||
|
|
@ -102,7 +102,7 @@ Claude Code:
|
|||
claude mcp add surfsense \
|
||||
-e SURFSENSE_BASE_URL=http://localhost:8000 \
|
||||
-e SURFSENSE_API_KEY=ss_pat_your_token_here \
|
||||
-- uv run --directory /absolute/path/to/SurfSense/surfsense_mcp python -m surfsense_mcp
|
||||
-- uv run --directory /absolute/path/to/SurfSense/surfsense_mcp python -m mcp_server
|
||||
```
|
||||
|
||||
Claude Desktop: add the same `mcpServers` block as Cursor to
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ dependencies = [
|
|||
]
|
||||
|
||||
[project.scripts]
|
||||
surfsense-mcp = "surfsense_mcp.__main__:main"
|
||||
surfsense-mcp = "mcp_server.__main__:main"
|
||||
|
||||
[dependency-groups]
|
||||
dev = ["pytest>=8.0"]
|
||||
|
|
@ -23,7 +23,7 @@ requires = ["hatchling"]
|
|||
build-backend = "hatchling.build"
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["src/surfsense_mcp"]
|
||||
packages = ["mcp_server"]
|
||||
|
||||
[tool.ruff]
|
||||
target-version = "py311"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from __future__ import annotations
|
|||
|
||||
from starlette.datastructures import Headers
|
||||
|
||||
from surfsense_mcp.core.auth.headers import extract_api_key
|
||||
from mcp_server.core.auth.headers import extract_api_key
|
||||
|
||||
|
||||
def _headers(**pairs: str) -> Headers:
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from __future__ import annotations
|
|||
|
||||
import httpx
|
||||
|
||||
from surfsense_mcp.core.client import SurfSenseClient
|
||||
from mcp_server.core.client import SurfSenseClient
|
||||
|
||||
_REQUEST = httpx.Request("GET", "http://localhost:8000/api/v1/documents")
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import asyncio
|
|||
|
||||
import httpx
|
||||
|
||||
from surfsense_mcp.core.client import SurfSenseClient
|
||||
from mcp_server.core.client import SurfSenseClient
|
||||
|
||||
|
||||
def _capture(client: SurfSenseClient) -> dict:
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from surfsense_mcp.features.knowledge_base.note_ingestion import build_note_document
|
||||
from mcp_server.features.knowledge_base.note_ingestion import build_note_document
|
||||
|
||||
|
||||
def test_builds_extension_document_with_content():
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from surfsense_mcp.core.rendering import clip, compact_items, to_json
|
||||
from mcp_server.core.rendering import clip, compact_items, to_json
|
||||
|
||||
|
||||
def test_clip_leaves_short_text_untouched():
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ import asyncio
|
|||
import httpx
|
||||
import pytest
|
||||
|
||||
from surfsense_mcp.core.auth import identity
|
||||
from surfsense_mcp.core.client import SurfSenseClient
|
||||
from surfsense_mcp.core.errors import ToolError
|
||||
from mcp_server.core.auth import identity
|
||||
from mcp_server.core.client import SurfSenseClient
|
||||
from mcp_server.core.errors import ToolError
|
||||
|
||||
|
||||
def _client_recording_auth(seen: dict, *, fallback: str | None) -> SurfSenseClient:
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ import asyncio
|
|||
|
||||
import pytest
|
||||
|
||||
from surfsense_mcp.core.auth import identity
|
||||
from surfsense_mcp.core.errors import ToolError
|
||||
from surfsense_mcp.core.workspace_context import WorkspaceContext
|
||||
from mcp_server.core.auth import identity
|
||||
from mcp_server.core.errors import ToolError
|
||||
from mcp_server.core.workspace_context import WorkspaceContext
|
||||
|
||||
|
||||
class FakeClient:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue