Skip to content

[Bug]:Resource view error - mime type handling for resource added via mcp server #1381

@TS0713

Description

@TS0713

🐞 Bug Summary

Unable to view the resource when added via mcp server due to missing mime type handling.
Works fine when resource is added via mcpgateway UI - resource panel (mime type handled correctly)


🧩 Affected Component

Select the area of the project impacted:


🔁 Steps to Reproduce

<< app.py >>
`
from mcp.server.fastmcp import FastMCP

mcp = FastMCP("sample gateway",port="8200")

@mcp.resource("resource://hello",name="hello")
def get_hello_message() -> str:
"""Provides a simple 'Hello, World!' message."""
return "Hello, World!"

if name == "main":
mcp.run(transport="streamable-http")

`
Terminal

python -m app.py

🤔 Expected Behavior

What should have happened instead?

  • should be able to view without any errors

📓 Logs / Error Output

mcpgateway_pa/mcp-context-forge/mcpgateway/db.py", line 1944, in content
    raise ValueError("Resource has no content")
ValueError: Resource has no content

UI Error

Image

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtriageIssues / Features awaiting triage

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions