fix: enforce mime_type='text/html' inside FastMCP resource decorators and release 0.2.8

This commit is contained in:
2026-05-30 19:34:45 +02:00
parent 4d127541c5
commit 99ee6b7076
4 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -68,7 +68,7 @@ async def generate():
return decorator
def resource(self, path):
def resource(self, path, **kwargs):
def decorator(func):
self.resources[path] = func
return func
@@ -164,7 +164,7 @@ async def generate():
return decorator
def resource(self, path):
def resource(self, path, **kwargs):
def decorator(func):
self.resources[path] = func
return func
+1 -1
View File
@@ -1,3 +1,3 @@
"""Strava MCP Server"""
__version__ = "0.2.7"
__version__ = "0.2.8"
+2 -2
View File
@@ -901,7 +901,7 @@ def register(mcp: FastMCP, strava: StravaClient) -> None:
isError=True,
)
@mcp.resource("strava://activity/{activity_id}/map")
@mcp.resource("strava://activity/{activity_id}/map", mime_type="text/html")
async def get_activity_map_resource(activity_id: int) -> ReadResourceResult:
"""HTML map resource for a specific Strava activity."""
html_content = await _render_activity_map_html(activity_id)
@@ -915,7 +915,7 @@ def register(mcp: FastMCP, strava: StravaClient) -> None:
]
)
@mcp.resource("strava://activity/last/map")
@mcp.resource("strava://activity/last/map", mime_type="text/html")
async def get_last_activity_map_resource() -> ReadResourceResult:
"""HTML map resource for the most recent Strava activity."""
try:
+1 -1
View File
@@ -15,7 +15,7 @@ class MockMCP:
return decorator
def resource(self, path):
def resource(self, path, **kwargs):
if not hasattr(self, "resources"):
self.resources = {}