ddgs-mcp-server 0.3.0__tar.gz → 0.4.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.
- ddgs_mcp_server-0.4.1/.gitignore +180 -0
- {ddgs_mcp_server-0.3.0 → ddgs_mcp_server-0.4.1}/PKG-INFO +2 -2
- {ddgs_mcp_server-0.3.0 → ddgs_mcp_server-0.4.1}/pyproject.toml +2 -2
- {ddgs_mcp_server-0.3.0 → ddgs_mcp_server-0.4.1}/requirements.txt +1 -1
- {ddgs_mcp_server-0.3.0 → ddgs_mcp_server-0.4.1}/server.py +6 -6
- {ddgs_mcp_server-0.3.0 → ddgs_mcp_server-0.4.1}/src/ddgs_mcp_server/server.py +3 -3
- ddgs_mcp_server-0.3.0/.gitignore +0 -6
- {ddgs_mcp_server-0.3.0 → ddgs_mcp_server-0.4.1}/.env.example +0 -0
- {ddgs_mcp_server-0.3.0 → ddgs_mcp_server-0.4.1}/.gitattributes +0 -0
- {ddgs_mcp_server-0.3.0 → ddgs_mcp_server-0.4.1}/Dockerfile +0 -0
- {ddgs_mcp_server-0.3.0 → ddgs_mcp_server-0.4.1}/LICENSE +0 -0
- {ddgs_mcp_server-0.3.0 → ddgs_mcp_server-0.4.1}/README.md +0 -0
- {ddgs_mcp_server-0.3.0 → ddgs_mcp_server-0.4.1}/docker-compose.yml +0 -0
- {ddgs_mcp_server-0.3.0 → ddgs_mcp_server-0.4.1}/main.py +0 -0
- {ddgs_mcp_server-0.3.0 → ddgs_mcp_server-0.4.1}/src/ddgs_mcp_server/__init__.py +0 -0
- {ddgs_mcp_server-0.3.0 → ddgs_mcp_server-0.4.1}/src/ddgs_mcp_server/main.py +0 -0
- {ddgs_mcp_server-0.3.0 → ddgs_mcp_server-0.4.1}/start_api.sh +0 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py,cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
|
|
110
|
+
# pdm
|
|
111
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
112
|
+
#pdm.lock
|
|
113
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
114
|
+
# in version control.
|
|
115
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
|
116
|
+
.pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
121
|
+
__pypackages__/
|
|
122
|
+
|
|
123
|
+
# Celery stuff
|
|
124
|
+
celerybeat-schedule
|
|
125
|
+
celerybeat.pid
|
|
126
|
+
|
|
127
|
+
# SageMath parsed files
|
|
128
|
+
*.sage.py
|
|
129
|
+
|
|
130
|
+
# Environments
|
|
131
|
+
.env
|
|
132
|
+
.venv
|
|
133
|
+
venv/
|
|
134
|
+
ENV/
|
|
135
|
+
env.bak/
|
|
136
|
+
venv.bak/
|
|
137
|
+
|
|
138
|
+
# Spyder project settings
|
|
139
|
+
.spyderproject
|
|
140
|
+
.spyproject
|
|
141
|
+
|
|
142
|
+
# Rope project settings
|
|
143
|
+
.ropeproject
|
|
144
|
+
|
|
145
|
+
# mkdocs documentation
|
|
146
|
+
/site
|
|
147
|
+
|
|
148
|
+
# mypy
|
|
149
|
+
.mypy_cache/
|
|
150
|
+
.dmypy.json
|
|
151
|
+
dmypy.json
|
|
152
|
+
|
|
153
|
+
# Pyre type checker
|
|
154
|
+
.pyre/
|
|
155
|
+
|
|
156
|
+
# pytype static type analyzer
|
|
157
|
+
.pytype/
|
|
158
|
+
|
|
159
|
+
# Cython debug symbols
|
|
160
|
+
cython_debug/
|
|
161
|
+
|
|
162
|
+
# PyCharm
|
|
163
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
164
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
165
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
166
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
167
|
+
#.idea/
|
|
168
|
+
|
|
169
|
+
# Ruff stuff:
|
|
170
|
+
.ruff_cache/
|
|
171
|
+
|
|
172
|
+
# PyPI configuration file
|
|
173
|
+
.pypirc
|
|
174
|
+
|
|
175
|
+
# Cursor
|
|
176
|
+
# Cursor is an AI-powered code editor.`.cursorignore` specifies files/directories to
|
|
177
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
178
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
179
|
+
.cursorignore
|
|
180
|
+
.cursorindexingignore
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ddgs-mcp-server
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary: DuckDuckGo Search MCP Server
|
|
5
5
|
License-File: LICENSE
|
|
6
6
|
Requires-Python: >=3.10
|
|
7
|
-
Requires-Dist:
|
|
7
|
+
Requires-Dist: ddgs>=9.10.0
|
|
8
8
|
Requires-Dist: mcp>=1.0.0
|
|
9
9
|
Description-Content-Type: text/markdown
|
|
10
10
|
|
|
@@ -4,13 +4,13 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "ddgs-mcp-server"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.4.1"
|
|
8
8
|
description = "DuckDuckGo Search MCP Server"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
11
11
|
dependencies = [
|
|
12
12
|
"mcp>=1.0.0",
|
|
13
|
-
"
|
|
13
|
+
"ddgs>=9.10.0"
|
|
14
14
|
]
|
|
15
15
|
|
|
16
16
|
[project.scripts]
|
|
@@ -16,7 +16,7 @@ from mcp.server.sse import SseServerTransport
|
|
|
16
16
|
import mcp.types as types
|
|
17
17
|
|
|
18
18
|
# DDGS Import
|
|
19
|
-
from
|
|
19
|
+
from ddgs import DDGS
|
|
20
20
|
|
|
21
21
|
# Logging Configuration
|
|
22
22
|
logging.basicConfig(level=logging.INFO)
|
|
@@ -121,17 +121,17 @@ async def call_tool(name: str, arguments: dict) -> list[types.TextContent | type
|
|
|
121
121
|
with DDGS() as ddgs:
|
|
122
122
|
results = []
|
|
123
123
|
if name == "search_text":
|
|
124
|
-
results = ddgs.text(
|
|
124
|
+
results = ddgs.text(query=query, region=region, safesearch=safesearch, timelimit=timelimit, max_results=max_results)
|
|
125
125
|
elif name == "search_images":
|
|
126
|
-
results = ddgs.images(
|
|
126
|
+
results = ddgs.images(query=query, region=region, safesearch=safesearch, timelimit=timelimit, max_results=max_results)
|
|
127
127
|
elif name == "search_videos":
|
|
128
|
-
results = ddgs.videos(
|
|
128
|
+
results = ddgs.videos(query=query, region=region, safesearch=safesearch, timelimit=timelimit, max_results=max_results)
|
|
129
129
|
elif name == "search_news":
|
|
130
|
-
results = ddgs.news(
|
|
130
|
+
results = ddgs.news(query=query, region=region, safesearch=safesearch, timelimit=timelimit, max_results=max_results)
|
|
131
131
|
elif name == "search_books":
|
|
132
132
|
# Check for books method availability or fallback
|
|
133
133
|
if hasattr(ddgs, 'books'):
|
|
134
|
-
results = ddgs.books(
|
|
134
|
+
results = ddgs.books(query=query, max_results=max_results)
|
|
135
135
|
else:
|
|
136
136
|
return [types.TextContent(type="text", text="Error: 'books' search backend not available in this version of python-ddgs.")]
|
|
137
137
|
else:
|
|
@@ -4,7 +4,7 @@ import logging
|
|
|
4
4
|
from typing import Optional, Literal
|
|
5
5
|
from mcp.server import Server
|
|
6
6
|
import mcp.types as types
|
|
7
|
-
from
|
|
7
|
+
from ddgs import DDGS
|
|
8
8
|
|
|
9
9
|
# Logging Configuration
|
|
10
10
|
logging.basicConfig(level=logging.INFO)
|
|
@@ -73,7 +73,7 @@ async def call_tool(name: str, arguments: dict) -> list[types.TextContent | type
|
|
|
73
73
|
results = []
|
|
74
74
|
if name == "search_text":
|
|
75
75
|
results = ddgs.text(
|
|
76
|
-
|
|
76
|
+
query=query,
|
|
77
77
|
region=region,
|
|
78
78
|
safesearch=safesearch,
|
|
79
79
|
timelimit=timelimit,
|
|
@@ -82,7 +82,7 @@ async def call_tool(name: str, arguments: dict) -> list[types.TextContent | type
|
|
|
82
82
|
)
|
|
83
83
|
elif name == "search_news":
|
|
84
84
|
results = ddgs.news(
|
|
85
|
-
|
|
85
|
+
query=query,
|
|
86
86
|
region=region,
|
|
87
87
|
safesearch=safesearch,
|
|
88
88
|
timelimit=timelimit,
|
ddgs_mcp_server-0.3.0/.gitignore
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|