ddgs-mcp-server 0.2.0__tar.gz → 0.3.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ddgs-mcp-server
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: DuckDuckGo Search MCP Server
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.10
@@ -15,6 +15,7 @@ A Model Context Protocol (MCP) server that provides DuckDuckGo Search capabiliti
15
15
  ## Features
16
16
 
17
17
  - **search_text**: advanced metasearch using `bing`, `brave`, `duckduckgo`, `google`, `mojeek`, `yahoo`, `yandex`, `wikipedia`.
18
+ - **search_news**: Find latest updates, releases, and tech news.
18
19
 
19
20
 
20
21
  ## Installation & Usage
@@ -5,6 +5,7 @@ A Model Context Protocol (MCP) server that provides DuckDuckGo Search capabiliti
5
5
  ## Features
6
6
 
7
7
  - **search_text**: advanced metasearch using `bing`, `brave`, `duckduckgo`, `google`, `mojeek`, `yahoo`, `yandex`, `wikipedia`.
8
+ - **search_news**: Find latest updates, releases, and tech news.
8
9
 
9
10
 
10
11
  ## Installation & Usage
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "ddgs-mcp-server"
7
- version = "0.2.0"
7
+ version = "0.3.0"
8
8
  description = "DuckDuckGo Search MCP Server"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -36,6 +36,21 @@ async def list_tools() -> list[types.Tool]:
36
36
  },
37
37
  "required": ["query"]
38
38
  }
39
+ ),
40
+ types.Tool(
41
+ name="search_news",
42
+ description="Perform a news search to find the latest updates, releases, or security alerts.",
43
+ inputSchema={
44
+ "type": "object",
45
+ "properties": {
46
+ "query": {"type": "string"},
47
+ "region": {"type": "string", "default": "us-en"},
48
+ "safesearch": {"type": "string", "default": "moderate"},
49
+ "timelimit": {"type": "string", "default": None},
50
+ "max_results": {"type": "integer", "default": 10}
51
+ },
52
+ "required": ["query"]
53
+ }
39
54
  )
40
55
  ]
41
56
 
@@ -43,7 +58,7 @@ async def list_tools() -> list[types.Tool]:
43
58
  async def call_tool(name: str, arguments: dict) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]:
44
59
  logger.info(f"Calling tool: {name} with args: {arguments}")
45
60
 
46
- if name != "search_text":
61
+ if name not in ["search_text", "search_news"]:
47
62
  raise ValueError(f"Unknown tool: {name}")
48
63
 
49
64
  query = arguments.get("query")
@@ -55,14 +70,25 @@ async def call_tool(name: str, arguments: dict) -> list[types.TextContent | type
55
70
 
56
71
  try:
57
72
  with DDGS() as ddgs:
58
- results = ddgs.text(
59
- keywords=query,
60
- region=region,
61
- safesearch=safesearch,
62
- timelimit=timelimit,
63
- max_results=max_results,
64
- backend=backend
65
- )
73
+ results = []
74
+ if name == "search_text":
75
+ results = ddgs.text(
76
+ keywords=query,
77
+ region=region,
78
+ safesearch=safesearch,
79
+ timelimit=timelimit,
80
+ max_results=max_results,
81
+ backend=backend
82
+ )
83
+ elif name == "search_news":
84
+ results = ddgs.news(
85
+ keywords=query,
86
+ region=region,
87
+ safesearch=safesearch,
88
+ timelimit=timelimit,
89
+ max_results=max_results
90
+ )
91
+
66
92
  return [types.TextContent(type="text", text=json.dumps(results, indent=2))]
67
93
 
68
94
  except Exception as e:
File without changes
File without changes