suse-documentation-mcp-server 0.28.0__tar.gz → 0.30.0__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.
@@ -0,0 +1,9 @@
1
+ Metadata-Version: 2.4
2
+ Name: suse-documentation-mcp-server
3
+ Version: 0.30.0
4
+ Summary: MCP server implementation for web search using Open WebUI Web search
5
+ Requires-Python: >=3.12
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: python-dotenv>=1.0.1
8
+ Requires-Dist: httpx>=0.28.1
9
+ Requires-Dist: mcp[cli]>=1.4.1
@@ -1,15 +1,13 @@
1
1
  [project]
2
2
  name = "suse-documentation-mcp-server"
3
- version = "0.28.0"
4
- description = "Add your description here"
3
+ version = "0.30.0"
4
+ description = "MCP server implementation for web search using Open WebUI Web search"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
7
7
  dependencies = [
8
+ "python-dotenv>=1.0.1",
8
9
  "httpx>=0.28.1",
9
- "mcp[cli]~=1.6.0",
10
- "pydantic>=2.10.3",
11
- "python-dotenv>=1.1.0",
12
- "requests>=2.32.3",
10
+ "mcp[cli]>=1.4.1",
13
11
  ]
14
12
 
15
13
  [project.scripts]
@@ -1,11 +1,10 @@
1
- import requests
2
- import re
1
+ import asyncio
3
2
  import os
3
+ import sys
4
+ import time
5
+
4
6
  from dotenv import load_dotenv
5
- from typing import Dict, Any
6
7
  from mcp.server.fastmcp import FastMCP
7
- from pydantic import Field
8
- from concurrent.futures import ThreadPoolExecutor
9
8
 
10
9
  load_dotenv()
11
10
 
@@ -13,7 +12,40 @@ base_url = os.getenv("OI_API_BASE", "") + "/api/v1/retrieval/process/web"
13
12
  authorization_token = os.getenv("OI_API_TOKEN", "")
14
13
 
15
14
  # Initialize FastMCP server
16
- mcp = FastMCP("suse-documentation")
15
+ mcp = FastMCP(
16
+ "web-search",
17
+ prompt="""
18
+ # Web Search MCP Server
19
+
20
+ This server provides tools for searching the web using Open WebUI Web search API.
21
+ It allows you to search web for given search query.
22
+
23
+ ## Available Tools
24
+
25
+ ### 1. get_web_search_results
26
+ Use this tool to search web to gather information about SUSE, Rancher products and projects.
27
+
28
+ Example: "HOw to setup Nvidia GPU in RKE2?" or
29
+ "Does Rancher Desktop support Wasm"
30
+
31
+ ## Guidelines for Use
32
+
33
+ - Always perform a web search even if you think you know the answer
34
+ - Use the most relevant and specific keywords for your search
35
+ - Keep queries concise and specific for best results
36
+
37
+ ## Output Format
38
+
39
+ All search results will be formatted as text with clear sections for each
40
+ result item, including:
41
+
42
+ - URL: The link to the source of the information
43
+ - Content: A brief summary or excerpt from the page
44
+
45
+ If the API call fails for any reason, appropriate error messages will be
46
+ returned.
47
+ """,
48
+ )
17
49
 
18
50
  def clean_content(content):
19
51
  # Remove excessive blank lines
@@ -74,42 +106,32 @@ def get_web_search_results_from_oi(query):
74
106
  combined_response += f"Source: {filename}\n\nContent:\n{cleaned_content}\n\n"
75
107
 
76
108
  return combined_response
77
-
109
+
78
110
  @mcp.tool()
79
111
  async def get_web_search_results(
80
- payload: Dict[str, Any] = Field(
81
- description="A dictionary containing a single key 'queries' with a string value representing the search query.",
82
- ),
112
+ query: str
83
113
  ) -> str:
114
+ """Performs a web search using the Open WebUI web search API.
115
+
116
+ Args:
117
+ query: Search query (required)
84
118
  """
85
- Fetch web results based on a query string provided in the payload using the Open WebUI Web Search API.
86
- Use for general search and when the user explicitly tells you to 'fetch' results/information.
87
- """
88
- print("Entered get_web_search_results with payload:", payload)
89
-
90
- try:
91
- # Validate payload
92
- if not isinstance(payload, Dict) or "queries" not in payload:
93
- raise ValueError("Payload must be a dictionary with a 'queries' key.")
94
-
95
- query = payload["queries"]
96
- if not isinstance(query, str) or not query.strip():
97
- raise ValueError("'queries' must be a non-empty string.")
98
-
119
+
120
+ try:
99
121
  # Process the query
100
122
  result = get_web_search_results_from_oi(query)
101
123
 
102
124
  return result
103
125
  except Exception as e:
104
- return f"Error performing web search: {str(e)}\n\nPayload: {payload}"
126
+ return f"Error performing web search: {str(e)}\n\nQuery: {query}"
105
127
 
106
128
  def main():
107
129
  """Main entry point for the script."""
108
130
  # Initialize and run the server
109
- print("Starting SUSE Documentation Search Server v0.19.0")
131
+ print("Starting SUSE Documentation Search Server...")
110
132
  mcp.run()
111
133
 
112
134
  if __name__ == "__main__":
113
135
  # Initialize and run the server
114
136
  main()
115
-
137
+
@@ -0,0 +1,9 @@
1
+ Metadata-Version: 2.4
2
+ Name: suse-documentation-mcp-server
3
+ Version: 0.30.0
4
+ Summary: MCP server implementation for web search using Open WebUI Web search
5
+ Requires-Python: >=3.12
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: python-dotenv>=1.0.1
8
+ Requires-Dist: httpx>=0.28.1
9
+ Requires-Dist: mcp[cli]>=1.4.1
@@ -0,0 +1,3 @@
1
+ python-dotenv>=1.0.1
2
+ httpx>=0.28.1
3
+ mcp[cli]>=1.4.1
@@ -1,11 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: suse-documentation-mcp-server
3
- Version: 0.28.0
4
- Summary: Add your description here
5
- Requires-Python: >=3.12
6
- Description-Content-Type: text/markdown
7
- Requires-Dist: httpx>=0.28.1
8
- Requires-Dist: mcp[cli]~=1.6.0
9
- Requires-Dist: pydantic>=2.10.3
10
- Requires-Dist: python-dotenv>=1.1.0
11
- Requires-Dist: requests>=2.32.3
@@ -1,11 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: suse-documentation-mcp-server
3
- Version: 0.28.0
4
- Summary: Add your description here
5
- Requires-Python: >=3.12
6
- Description-Content-Type: text/markdown
7
- Requires-Dist: httpx>=0.28.1
8
- Requires-Dist: mcp[cli]~=1.6.0
9
- Requires-Dist: pydantic>=2.10.3
10
- Requires-Dist: python-dotenv>=1.1.0
11
- Requires-Dist: requests>=2.32.3
@@ -1,5 +0,0 @@
1
- httpx>=0.28.1
2
- mcp[cli]~=1.6.0
3
- pydantic>=2.10.3
4
- python-dotenv>=1.1.0
5
- requests>=2.32.3