image-search-mcp 0.1.0__tar.gz → 0.1.1__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: image-search-mcp
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: MCP server for Reverse Image Search using PicImageSearch
5
5
  Author-email: Your Name <your.email@example.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "image-search-mcp"
7
- version = "0.1.0"
7
+ version = "0.1.1"
8
8
  description = "MCP server for Reverse Image Search using PicImageSearch"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -43,12 +43,15 @@ def main():
43
43
  if args.sse:
44
44
  try:
45
45
  import uvicorn
46
- # Attempt to find the ASGI app from FastMCP instance
47
- app = mcp
48
- if hasattr(mcp, "_sse_app"):
49
- app = mcp._sse_app
50
- elif hasattr(mcp, "app"):
51
- app = mcp.app
46
+ # FastMCP's Starlette app is usually available via the ._app attribute
47
+ # after some initialization, or we can use its built-in server logic.
48
+ # To apply middleware, we need the actual ASGI app.
49
+
50
+ # This is a more robust way to get the ASGI app from FastMCP
51
+ from mcp.server.fastmcp import FastMCP
52
+
53
+ # Force initialization of the SSE app if possible
54
+ app = mcp.as_asgi_app()
52
55
 
53
56
  # Check for Auth Token
54
57
  auth_token = os.environ.get("MCP_AUTH_TOKEN")
@@ -58,11 +61,10 @@ def main():
58
61
 
59
62
  print(f"Starting SSE server on {args.host}:{args.port}...")
60
63
  uvicorn.run(app, host=args.host, port=args.port)
61
- except ImportError:
62
- print("Error: 'uvicorn' is required for SSE mode. Please install it: pip install uvicorn")
63
- sys.exit(1)
64
64
  except Exception as e:
65
65
  print(f"Error starting SSE server: {e}")
66
+ import traceback
67
+ traceback.print_exc()
66
68
  sys.exit(1)
67
69
  else:
68
70
  # Stdio mode (Default)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: image-search-mcp
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: MCP server for Reverse Image Search using PicImageSearch
5
5
  Author-email: Your Name <your.email@example.com>
6
6
  License: MIT