update to fastmcp 2.9.2
This commit is contained in:
+2
-2
@@ -28,7 +28,7 @@ async def health_check(request: Request) -> JSONResponse:
|
|||||||
"status": "healthy",
|
"status": "healthy",
|
||||||
"service": "Yargı MCP Server",
|
"service": "Yargı MCP Server",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"tools_count": len(mcp_server._tool_manager.tools)
|
"tools_count": len(mcp_server._tool_manager._tools)
|
||||||
})
|
})
|
||||||
|
|
||||||
@mcp_server.custom_route("/", methods=["GET"])
|
@mcp_server.custom_route("/", methods=["GET"])
|
||||||
@@ -58,7 +58,7 @@ async def root(request: Request) -> JSONResponse:
|
|||||||
async def status(request: Request) -> JSONResponse:
|
async def status(request: Request) -> JSONResponse:
|
||||||
"""Status endpoint with detailed information"""
|
"""Status endpoint with detailed information"""
|
||||||
tools = []
|
tools = []
|
||||||
for tool in mcp_server._tool_manager.tools.values():
|
for tool in mcp_server._tool_manager._tools.values():
|
||||||
tools.append({
|
tools.append({
|
||||||
"name": tool.name,
|
"name": tool.name,
|
||||||
"description": tool.description[:100] + "..." if len(tool.description) > 100 else tool.description
|
"description": tool.description[:100] + "..." if len(tool.description) > 100 else tool.description
|
||||||
|
|||||||
+6
-6
@@ -77,7 +77,7 @@ async def root():
|
|||||||
name="Yargı MCP Server",
|
name="Yargı MCP Server",
|
||||||
version="0.1.0",
|
version="0.1.0",
|
||||||
description="MCP server for Turkish legal databases",
|
description="MCP server for Turkish legal databases",
|
||||||
tools_count=len(mcp_server._tool_manager.tools),
|
tools_count=len(mcp_server._tool_manager._tools),
|
||||||
databases=[
|
databases=[
|
||||||
"Yargıtay (Court of Cassation)",
|
"Yargıtay (Court of Cassation)",
|
||||||
"Danıştay (Council of State)",
|
"Danıştay (Council of State)",
|
||||||
@@ -101,7 +101,7 @@ async def health_check():
|
|||||||
status="healthy",
|
status="healthy",
|
||||||
timestamp=datetime.now(),
|
timestamp=datetime.now(),
|
||||||
uptime_seconds=uptime,
|
uptime_seconds=uptime,
|
||||||
tools_operational=len(mcp_server._tool_manager.tools) > 0
|
tools_operational=len(mcp_server._tool_manager._tools) > 0
|
||||||
)
|
)
|
||||||
|
|
||||||
@app.get("/api/tools", response_model=List[ToolInfo])
|
@app.get("/api/tools", response_model=List[ToolInfo])
|
||||||
@@ -112,7 +112,7 @@ async def list_tools(
|
|||||||
"""List all available MCP tools"""
|
"""List all available MCP tools"""
|
||||||
tools = []
|
tools = []
|
||||||
|
|
||||||
for tool in mcp_server._tool_manager.tools.values():
|
for tool in mcp_server._tool_manager._tools.values():
|
||||||
# Apply filters if provided
|
# Apply filters if provided
|
||||||
if search and search.lower() not in tool.name.lower() and search.lower() not in tool.description.lower():
|
if search and search.lower() not in tool.name.lower() and search.lower() not in tool.description.lower():
|
||||||
continue
|
continue
|
||||||
@@ -141,7 +141,7 @@ async def list_tools(
|
|||||||
@app.get("/api/tools/{tool_name}", response_model=ToolInfo)
|
@app.get("/api/tools/{tool_name}", response_model=ToolInfo)
|
||||||
async def get_tool(tool_name: str):
|
async def get_tool(tool_name: str):
|
||||||
"""Get detailed information about a specific tool"""
|
"""Get detailed information about a specific tool"""
|
||||||
tool = mcp_server._tool_manager.tools.get(tool_name)
|
tool = mcp_server._tool_manager._tools.get(tool_name)
|
||||||
|
|
||||||
if not tool:
|
if not tool:
|
||||||
raise HTTPException(status_code=404, detail=f"Tool '{tool_name}' not found")
|
raise HTTPException(status_code=404, detail=f"Tool '{tool_name}' not found")
|
||||||
@@ -225,7 +225,7 @@ async def get_statistics():
|
|||||||
|
|
||||||
# Count tools by database
|
# Count tools by database
|
||||||
tool_counts = {}
|
tool_counts = {}
|
||||||
for tool in mcp_server._tool_manager.tools.values():
|
for tool in mcp_server._tool_manager._tools.values():
|
||||||
for db in ["yargitay", "danistay", "emsal", "uyusmazlik", "anayasa", "kik", "rekabet", "bedesten"]:
|
for db in ["yargitay", "danistay", "emsal", "uyusmazlik", "anayasa", "kik", "rekabet", "bedesten"]:
|
||||||
if db in tool.name.lower():
|
if db in tool.name.lower():
|
||||||
tool_counts[db] = tool_counts.get(db, 0) + 1
|
tool_counts[db] = tool_counts.get(db, 0) + 1
|
||||||
@@ -238,7 +238,7 @@ async def get_statistics():
|
|||||||
"version": "0.1.0"
|
"version": "0.1.0"
|
||||||
},
|
},
|
||||||
"tools": {
|
"tools": {
|
||||||
"total": len(mcp_server._tool_manager.tools),
|
"total": len(mcp_server._tool_manager._tools),
|
||||||
"by_database": tool_counts
|
"by_database": tool_counts
|
||||||
},
|
},
|
||||||
"capabilities": {
|
"capabilities": {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ dependencies = [
|
|||||||
"playwright>=1.52.0",
|
"playwright>=1.52.0",
|
||||||
"fastmcp>=2.9.2",
|
"fastmcp>=2.9.2",
|
||||||
"pypdf>=5.5.0",
|
"pypdf>=5.5.0",
|
||||||
|
"fastapi>=0.115.14",
|
||||||
]
|
]
|
||||||
|
|
||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
|
|||||||
+1
-1
@@ -72,7 +72,7 @@ async def api_info(request: Request):
|
|||||||
|
|
||||||
return JSONResponse({
|
return JSONResponse({
|
||||||
"authenticated_as": request.user.display_name,
|
"authenticated_as": request.user.display_name,
|
||||||
"available_tools": len(mcp_server._tool_manager.tools),
|
"available_tools": len(mcp_server._tool_manager._tools),
|
||||||
"databases": [
|
"databases": [
|
||||||
"Yargıtay", "Danıştay", "Emsal", "Uyuşmazlık",
|
"Yargıtay", "Danıştay", "Emsal", "Uyuşmazlık",
|
||||||
"Anayasa", "KIK", "Rekabet", "Bedesten"
|
"Anayasa", "KIK", "Rekabet", "Bedesten"
|
||||||
|
|||||||
Reference in New Issue
Block a user