diff --git a/src/strava_mcp_server/__init__.py b/src/strava_mcp_server/__init__.py index 3506b38..8f71c96 100644 --- a/src/strava_mcp_server/__init__.py +++ b/src/strava_mcp_server/__init__.py @@ -1,3 +1,3 @@ """Strava MCP Server""" -__version__ = "0.2.5" +__version__ = "0.2.6" diff --git a/src/strava_mcp_server/tools/activities.py b/src/strava_mcp_server/tools/activities.py index 4c27325..a039edd 100644 --- a/src/strava_mcp_server/tools/activities.py +++ b/src/strava_mcp_server/tools/activities.py @@ -267,6 +267,53 @@ def register(mcp: FastMCP, strava: StravaClient) -> None: except Exception as e: return [TextContent(type="text", text=f"Error fetching kudoers: {str(e)}")] + @mcp.resource("strava://activity/{activity_id}/map") + async def get_activity_map_resource(activity_id: int) -> str: + """HTML map resource for a specific Strava activity.""" + + class DummyContext: + async def info(self, msg): + pass + + async def warning(self, msg): + pass + + async def error(self, msg): + pass + + ctx = DummyContext() + result = await get_activity_map(ctx, activity_id) + if result and result.content: + return result.content[0].text + return "

Error loading map

" + + @mcp.resource("strava://activity/last/map") + async def get_last_activity_map_resource() -> str: + """HTML map resource for the most recent Strava activity.""" + + class DummyContext: + async def info(self, msg): + pass + + async def warning(self, msg): + pass + + async def error(self, msg): + pass + + ctx = DummyContext() + try: + activities = await strava.list_activities(limit=1) + if not activities: + return "

Keine Strava-Aktivitäten gefunden.

" + last_id = activities[0]["id"] + result = await get_activity_map(ctx, last_id) + if result and result.content: + return result.content[0].text + except Exception as e: + return f"

Error loading last activity: {str(e)}

" + return "

Error loading map

" + @mcp.tool() async def get_laps_by_activity_id(activity_id: int): """