Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -61,6 +61,7 @@ async def fetch_github_trending():
|
|
| 61 |
|
| 62 |
# 定义MCP服务器和工具
|
| 63 |
mcp_server = FastMCP(name="GithubTrending", stateless_http=True)
|
|
|
|
| 64 |
|
| 65 |
@mcp_server.tool()
|
| 66 |
def get_trending_repos(num: int = 10) -> dict:
|
|
@@ -69,8 +70,7 @@ def get_trending_repos(num: int = 10) -> dict:
|
|
| 69 |
fetch_github_trending()
|
| 70 |
return {"trending": cached_trending[:num]}
|
| 71 |
|
| 72 |
-
#app.mount("/mcp", mcp_server.
|
| 73 |
-
app.mount("/mcp", mcp_server.streamable_http_app())
|
| 74 |
|
| 75 |
async def trending_generator():
|
| 76 |
"""SSE 事件生成器"""
|
|
|
|
| 61 |
|
| 62 |
# 定义MCP服务器和工具
|
| 63 |
mcp_server = FastMCP(name="GithubTrending", stateless_http=True)
|
| 64 |
+
app.mount("/mcp", mcp_server.http_app())
|
| 65 |
|
| 66 |
@mcp_server.tool()
|
| 67 |
def get_trending_repos(num: int = 10) -> dict:
|
|
|
|
| 70 |
fetch_github_trending()
|
| 71 |
return {"trending": cached_trending[:num]}
|
| 72 |
|
| 73 |
+
#app.mount("/mcp", mcp_server.streamable_http_app())
|
|
|
|
| 74 |
|
| 75 |
async def trending_generator():
|
| 76 |
"""SSE 事件生成器"""
|