fix: update FastMCP initialization for API changes

- Remove deprecated auth_server_provider parameter
- Use auth parameter correctly with OAuthProvider instead of AuthSettings
- Fixes type error after dependency updates

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
phernandez
2025-06-03 09:08:17 -05:00
parent c13d4b1511
commit ac08a8d024
22 changed files with 135 additions and 90 deletions
@@ -57,7 +57,6 @@ def upgrade() -> None:
""")
def downgrade() -> None:
"""Downgrade database schema to use old search index."""
# Drop the updated search_index table
@@ -274,4 +274,4 @@ async def delete_entities(
background_tasks.add_task(search_service.delete_by_permalink, permalink)
result = DeleteEntitiesResponse(deleted=deleted)
return result
return result
@@ -145,7 +145,9 @@ async def remove_project(
try:
old_project = await project_service.get_project(name)
if not old_project: # pragma: no cover
raise HTTPException(status_code=404, detail=f"Project: '{name}' does not exist") # pragma: no cover
raise HTTPException(
status_code=404, detail=f"Project: '{name}' does not exist"
) # pragma: no cover
await project_service.remove_project(name)
@@ -186,7 +188,9 @@ async def set_default_project(
# get the new project
new_default_project = await project_service.get_project(name)
if not new_default_project: # pragma: no cover
raise HTTPException(status_code=404, detail=f"Project: '{name}' does not exist") # pragma: no cover
raise HTTPException(
status_code=404, detail=f"Project: '{name}' does not exist"
) # pragma: no cover
await project_service.set_default_project(name)
+1 -1
View File
@@ -179,7 +179,7 @@ class ConfigManager:
def save_config(self, config: BasicMemoryConfig) -> None:
"""Save configuration to file."""
try:
try:
self.config_file.write_text(json.dumps(config.model_dump(), indent=2))
except Exception as e: # pragma: no cover
logger.error(f"Failed to save config: {e}")
+1 -2
View File
@@ -106,6 +106,5 @@ auth_settings, auth_provider = create_auth_config()
mcp = FastMCP(
name="Basic Memory",
log_level="DEBUG",
auth_server_provider=auth_provider,
auth=auth_settings,
auth=auth_provider,
)
+1 -1
View File
@@ -31,7 +31,7 @@ async def move_note(
Examples:
- Move to new folder: move_note("My Note", "work/notes/my-note.md")
- Move by permalink: move_note("my-note-permalink", "archive/old-notes/my-note.md")
- Move by permalink: move_note("my-note-permalink", "archive/old-notes/my-note.md")
- Specify project: move_note("My Note", "archive/my-note.md", project="work-project")
Note: This operation moves notes within the specified project only. Moving notes
+2 -1
View File
@@ -22,6 +22,7 @@ from basic_memory.config import WATCH_STATUS_JSON
from basic_memory.utils import generate_permalink
from basic_memory.config import config_manager
class ProjectService:
"""Service for managing Basic Memory projects."""
@@ -545,4 +546,4 @@ class ProjectService:
database_size=db_size_readable,
watch_status=watch_status,
timestamp=datetime.now(),
)
)
+1 -1
View File
@@ -148,7 +148,7 @@ class SearchService:
# If parsing fails, treat as single tag
return [tags] if tags.strip() else []
return [] # pragma: no cover
return [] # pragma: no cover
async def index_entity(
self,
+4 -2
View File
@@ -379,7 +379,9 @@ class SyncService:
updates = {"file_path": new_path}
# If configured, also update permalink to match new path
if self.app_config.update_permalinks_on_move and self.file_service.is_markdown(new_path):
if self.app_config.update_permalinks_on_move and self.file_service.is_markdown(
new_path
):
# generate new permalink value
new_permalink = await self.entity_service.resolve_permalink(new_path)
@@ -505,4 +507,4 @@ class SyncService:
f"duration_ms={duration_ms}"
)
return result
return result