suse-documentation-mcp-server 0.13.0__py3-none-any.whl → 0.16.0__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.
@@ -4,6 +4,8 @@ import os
4
4
  from dotenv import load_dotenv
5
5
  from typing import Any
6
6
  from mcp.server.fastmcp import FastMCP
7
+ from pydantic import Field
8
+ from concurrent.futures import ThreadPoolExecutor
7
9
 
8
10
  load_dotenv()
9
11
 
@@ -74,44 +76,35 @@ def get_web_search_results_from_oi(query):
74
76
  return combined_response
75
77
 
76
78
  @mcp.tool()
77
- async def get_web_search_results(queries: Any) -> str:
79
+ async def get_web_search_results(
80
+ queries: list[str] = Field(
81
+ description="One or more concise, keyword-focused search queries. Use keywords relevant to SUSE documentation.",
82
+ ),
83
+ ) -> str:
78
84
  """
79
85
  Search SUSE documentation using web search and return results.
80
86
 
81
87
  This function is designed to perform a web search on the SUSE documentation
82
- for a given query and return the results. The function takes a search query as
83
- a string, JSON object, or dictionary, normalizes it, performs the web search,
84
- and returns a formatted string containing the content from the search results.
88
+ for a given query and return the results.
85
89
 
86
- Args:
87
- input_data (Any): Web search query, either as a string, JSON object, or dictionary.
88
- Examples:
89
- - "sriov in rke2"
90
- - {"query": "how to configure suse manager"}
91
- - {"queries": "latest rancher version"}
90
+ Parameters:
91
+ - query (str): The search query string to be used for the web search.
92
92
 
93
93
  Returns:
94
94
  str: Combined content from the search results, cleaned and formatted
95
95
  """
96
- print("Entered get_web_search_results:", query)
96
+ print("Entered get_web_search_results:", queries)
97
+
97
98
  try:
98
- # Normalize input to extract the query string
99
- if isinstance(input_data, str):
100
- query = input_data
101
- elif isinstance(input_data, dict):
102
- query = input_data.get("query") or input_data.get("queries")
103
- if not query:
104
- raise ValueError("Input dictionary must contain 'query' or 'queries' key.")
105
- else:
106
- raise TypeError("Input must be a string or a dictionary containing 'query' or 'queries'.")
107
-
108
- # Ensure query is a string
109
- if not isinstance(query, str):
110
- raise ValueError("The extracted query must be a string.")
111
- print("Before web search:", query)
112
- return get_web_search_results_from_oi(query)
99
+ if not queries:
100
+ raise ValueError("Search called with no queries.")
101
+
102
+ with ThreadPoolExecutor() as executor:
103
+ results = list(executor.map(get_web_search_results_from_oi, queries, timeout=10))
104
+
105
+ return results
113
106
  except Exception as e:
114
- return f"Error performing web search: {str(e)}\n\n{query}"
107
+ return f"Error performing web search: {str(e)}\n\n{queries}"
115
108
 
116
109
 
117
110
  def main():
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: suse-documentation-mcp-server
3
- Version: 0.13.0
3
+ Version: 0.16.0
4
4
  Summary: Add your description here
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
7
7
  Requires-Dist: httpx>=0.28.1
8
- Requires-Dist: mcp[cli]>=1.9.1
9
- Requires-Dist: pydantic>=2.11.5
8
+ Requires-Dist: mcp[cli]~=1.6.0
9
+ Requires-Dist: pydantic>=2.10.3
10
10
  Requires-Dist: python-dotenv>=1.1.0
11
11
  Requires-Dist: requests>=2.32.3
@@ -0,0 +1,6 @@
1
+ server/search_suse_documentation.py,sha256=7meSeWW-1dxHARLE5nLiq8cPUxSxDGDtEjMVfdztgK0,4034
2
+ suse_documentation_mcp_server-0.16.0.dist-info/METADATA,sha256=YcWgQScnvs03hWnYtdSy8X4qovratURdQXtsYv_SXkg,344
3
+ suse_documentation_mcp_server-0.16.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
4
+ suse_documentation_mcp_server-0.16.0.dist-info/entry_points.txt,sha256=IEM7kH8YFWMMJCcp4hJGv5tHzHWxiR5lZ7jOyzRCHQA,88
5
+ suse_documentation_mcp_server-0.16.0.dist-info/top_level.txt,sha256=StKOSmRhvWS5IPcvhsDRbtxUTEofJgYFGOu5AAJdSWo,7
6
+ suse_documentation_mcp_server-0.16.0.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- server/search_suse_documentation.py,sha256=SjG7sk13hMFejsGktTV4F8T-ceJB1RCxPpVSalnXwTM,4622
2
- suse_documentation_mcp_server-0.13.0.dist-info/METADATA,sha256=-pKy5Usj4S6Zc1TR8R8EFbvaLrNwlvYSQHSF2SmUBNU,344
3
- suse_documentation_mcp_server-0.13.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
4
- suse_documentation_mcp_server-0.13.0.dist-info/entry_points.txt,sha256=IEM7kH8YFWMMJCcp4hJGv5tHzHWxiR5lZ7jOyzRCHQA,88
5
- suse_documentation_mcp_server-0.13.0.dist-info/top_level.txt,sha256=StKOSmRhvWS5IPcvhsDRbtxUTEofJgYFGOu5AAJdSWo,7
6
- suse_documentation_mcp_server-0.13.0.dist-info/RECORD,,