Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[BUG] Both resources and prompts not loading after adding a federated gateway #393

@kmnis

Description

@kmnis

Hey everyone, as the title says, I created a very basic MCP server (code below) and started it using uv run server.py command.

After adding it to the Federated Gateways/MCP Servers via the UI (running in Docker container), I'm able to see the tools in the Global Tools tab however, both the global resources and prompts are missing. Could someone please help out on what am I doing wrong here? Have I misunderstood the functionality of the Global Resources and Prompts here?

Here's the bare minimum MCP server code:

from typing import Any
import httpx
from mcp.server.fastmcp import FastMCP
from mcp.server.fastmcp.prompts import base


# Create an MCP server
mcp = FastMCP(
    name="sample-mcp-server",
    host="0.0.0.0",
    port=8006,
)

# Add a dynamic greeting resource
@mcp.resource("greeting://{name}")
def get_greeting(name: str) -> str:
    """Get a personalized greeting"""
    return f"Hello, {name}!"

@mcp.resource("github://repos/{owner}/{repo}")
def github_repo(owner: str, repo: str) -> str:
    """GitHub repository resource."""
    return f"Repository: {owner}/{repo}"

@mcp.prompt(title="Code Review")
def review_code(code: str) -> str:
    return f"Please review this code:\n\n{code}"

@mcp.prompt(title="Debug Assistant")
def debug_error(error: str) -> list[base.Message]:
    return [
        base.UserMessage("I'm seeing this error:"),
        base.UserMessage(error),
        base.AssistantMessage("I'll help debug that. What have you tried so far?"),
    ]

@mcp.tool()
def sum(a: int, b: int) -> int:
    """Add two numbers together."""
    return a + b

@mcp.tool()
def get_weather(city: str, unit: str = "celsius") -> str:
    """Get weather for a city."""
    # This would normally call a weather API
    return f"Weather in {city}: 22degrees{unit[0].upper()}"

# Run the server
if __name__ == "__main__":
    mcp.run(transport="streamable-http")

Here are some screenshots from the UI:

Image Image Image

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions