viraja1 commited on
Commit
6efa6ab
·
verified ·
1 Parent(s): cf8076f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -16
app.py CHANGED
@@ -3,11 +3,6 @@ from __future__ import annotations
3
 
4
  from typing import Any, Dict, List, Optional
5
 
6
- import os
7
-
8
- from fastapi import FastAPI
9
- import uvicorn
10
-
11
  from mcp.server.fastmcp import FastMCP
12
 
13
  from github_client import GitHubAPIError, GitHubClient
@@ -842,16 +837,6 @@ async def search_repos(query: str, sort: Optional[str] = None, order: str = "des
842
  data = await _client.search_repositories(query, sort, order, limit)
843
  return [_summarize_repo(repo) for repo in data]
844
 
845
- app = FastAPI()
846
-
847
- # Health endpoint for HF Spaces
848
- @app.get("/")
849
- def health():
850
- return {"status": "ok"}
851
-
852
- # Mount MCP server under /mcp
853
- app.mount("/mcp", server.create_http_router())
854
 
855
  if __name__ == "__main__":
856
- port = int(os.getenv("PORT", 8000))
857
- uvicorn.run(app, host="0.0.0.0", port=port, log_level="info")
 
3
 
4
  from typing import Any, Dict, List, Optional
5
 
 
 
 
 
 
6
  from mcp.server.fastmcp import FastMCP
7
 
8
  from github_client import GitHubAPIError, GitHubClient
 
837
  data = await _client.search_repositories(query, sort, order, limit)
838
  return [_summarize_repo(repo) for repo in data]
839
 
 
 
 
 
 
 
 
 
 
840
 
841
  if __name__ == "__main__":
842
+ server.run(transport="streamable-http")