image-search-mcp 0.1.5__py3-none-any.whl → 0.1.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- image_search_mcp/main.py +18 -26
- {image_search_mcp-0.1.5.dist-info → image_search_mcp-0.1.6.dist-info}/METADATA +1 -1
- image_search_mcp-0.1.6.dist-info/RECORD +8 -0
- image_search_mcp-0.1.5.dist-info/RECORD +0 -8
- {image_search_mcp-0.1.5.dist-info → image_search_mcp-0.1.6.dist-info}/WHEEL +0 -0
- {image_search_mcp-0.1.5.dist-info → image_search_mcp-0.1.6.dist-info}/entry_points.txt +0 -0
- {image_search_mcp-0.1.5.dist-info → image_search_mcp-0.1.6.dist-info}/top_level.txt +0 -0
image_search_mcp/main.py
CHANGED
|
@@ -43,33 +43,25 @@ def main():
|
|
|
43
43
|
if args.sse:
|
|
44
44
|
try:
|
|
45
45
|
import uvicorn
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
# Use the underlying server from FastMCP instance
|
|
57
|
-
await mcp.server.run(
|
|
58
|
-
read_stream,
|
|
59
|
-
write_stream,
|
|
60
|
-
mcp.server.create_initialization_options()
|
|
61
|
-
)
|
|
62
|
-
|
|
63
|
-
starlette_app = Starlette(
|
|
64
|
-
debug=True,
|
|
65
|
-
routes=[
|
|
66
|
-
# Mount handles the path prefix and passes raw ASGI arguments
|
|
67
|
-
Mount("/sse", app=handle_sse),
|
|
68
|
-
Route("/messages", endpoint=sse.handle_post_message, methods=["POST"]),
|
|
69
|
-
]
|
|
70
|
-
)
|
|
46
|
+
|
|
47
|
+
# The most robust way to get the ASGI app from FastMCP (v2.3.2+)
|
|
48
|
+
# This app already includes the necessary SSE routes (/sse, /messages)
|
|
49
|
+
if hasattr(mcp, "http_app"):
|
|
50
|
+
app = mcp.http_app()
|
|
51
|
+
elif hasattr(mcp, "as_asgi_app"):
|
|
52
|
+
app = mcp.as_asgi_app()
|
|
53
|
+
else:
|
|
54
|
+
# Fallback to internal app if methods are missing
|
|
55
|
+
app = getattr(mcp, "_app", mcp)
|
|
71
56
|
|
|
72
|
-
|
|
57
|
+
# Check for Auth Token
|
|
58
|
+
auth_token = os.environ.get("MCP_AUTH_TOKEN")
|
|
59
|
+
if auth_token:
|
|
60
|
+
print(f"🔒 Authentication enabled. Require Bearer token.")
|
|
61
|
+
app = AuthMiddleware(app, auth_token)
|
|
62
|
+
|
|
63
|
+
print(f"Starting SSE server on {args.host}:{args.port}...")
|
|
64
|
+
uvicorn.run(app, host=args.host, port=args.port)
|
|
73
65
|
|
|
74
66
|
# 3. Apply Auth Middleware if token is provided
|
|
75
67
|
auth_token = os.environ.get("MCP_AUTH_TOKEN")
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
image_search_mcp/__init__.py,sha256=h6DgLFO4TMUk7_wCJ2jn2Y6IkFmfzb-Z7jX-G5UCYVc,43
|
|
2
|
+
image_search_mcp/main.py,sha256=OzbpjQPQ0JD8C43hVsIplcmAaKNIbjKgD2tcg4wDhvQ,3222
|
|
3
|
+
image_search_mcp/server.py,sha256=zDfg1BAB1yPFdvBBkGbBxsGpUEnOAMORnA7LN-4g5Xg,13445
|
|
4
|
+
image_search_mcp-0.1.6.dist-info/METADATA,sha256=h0W96KtxprNmxM6jvrKjT2mAL4oKclPwFGS67_615Wc,5434
|
|
5
|
+
image_search_mcp-0.1.6.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
6
|
+
image_search_mcp-0.1.6.dist-info/entry_points.txt,sha256=BD8buPHSQ9yLqGM6w_UGTKjYkVRu_IjH_R736MsDQXM,64
|
|
7
|
+
image_search_mcp-0.1.6.dist-info/top_level.txt,sha256=toz9LX_-JYwJIcGbvfVSH0ap99Nsp2mdzvitLWHyYWo,17
|
|
8
|
+
image_search_mcp-0.1.6.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
image_search_mcp/__init__.py,sha256=h6DgLFO4TMUk7_wCJ2jn2Y6IkFmfzb-Z7jX-G5UCYVc,43
|
|
2
|
-
image_search_mcp/main.py,sha256=qlKRdiHH7rZIkfSFyb-sW1Vm4FQ2C7PDExGnDOdDaLo,3517
|
|
3
|
-
image_search_mcp/server.py,sha256=zDfg1BAB1yPFdvBBkGbBxsGpUEnOAMORnA7LN-4g5Xg,13445
|
|
4
|
-
image_search_mcp-0.1.5.dist-info/METADATA,sha256=eTZQCd1hD4_bc3lSkATn1Br1LaXEBQd0Z-DiW35iLe0,5434
|
|
5
|
-
image_search_mcp-0.1.5.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
6
|
-
image_search_mcp-0.1.5.dist-info/entry_points.txt,sha256=BD8buPHSQ9yLqGM6w_UGTKjYkVRu_IjH_R736MsDQXM,64
|
|
7
|
-
image_search_mcp-0.1.5.dist-info/top_level.txt,sha256=toz9LX_-JYwJIcGbvfVSH0ap99Nsp2mdzvitLWHyYWo,17
|
|
8
|
-
image_search_mcp-0.1.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|