web-search-searxng-mcp 0.1.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.
Files changed (27) hide show
  1. web_search_searxng_mcp-0.1.0/.github/workflows/publish-to-pypi.yml +38 -0
  2. web_search_searxng_mcp-0.1.0/.gitignore +224 -0
  3. web_search_searxng_mcp-0.1.0/.python-version +1 -0
  4. web_search_searxng_mcp-0.1.0/CHANGELOG.md +28 -0
  5. web_search_searxng_mcp-0.1.0/LICENSE +21 -0
  6. web_search_searxng_mcp-0.1.0/PKG-INFO +127 -0
  7. web_search_searxng_mcp-0.1.0/README.md +114 -0
  8. web_search_searxng_mcp-0.1.0/docker-compose.yml +25 -0
  9. web_search_searxng_mcp-0.1.0/docs/PUBLISHING.md +118 -0
  10. web_search_searxng_mcp-0.1.0/pyproject.toml +23 -0
  11. web_search_searxng_mcp-0.1.0/searxng/settings.yml.example +13 -0
  12. web_search_searxng_mcp-0.1.0/src/web_search_mcp/__init__.py +3 -0
  13. web_search_searxng_mcp-0.1.0/src/web_search_mcp/config/__init__.py +0 -0
  14. web_search_searxng_mcp-0.1.0/src/web_search_mcp/config/logging.py +15 -0
  15. web_search_searxng_mcp-0.1.0/src/web_search_mcp/config/settings.py +19 -0
  16. web_search_searxng_mcp-0.1.0/src/web_search_mcp/domains/__init__.py +0 -0
  17. web_search_searxng_mcp-0.1.0/src/web_search_mcp/domains/search/__init__.py +0 -0
  18. web_search_searxng_mcp-0.1.0/src/web_search_mcp/domains/search/exceptions.py +7 -0
  19. web_search_searxng_mcp-0.1.0/src/web_search_mcp/domains/search/models.py +19 -0
  20. web_search_searxng_mcp-0.1.0/src/web_search_mcp/domains/search/services.py +36 -0
  21. web_search_searxng_mcp-0.1.0/src/web_search_mcp/entry_points/__init__.py +0 -0
  22. web_search_searxng_mcp-0.1.0/src/web_search_mcp/entry_points/main.py +10 -0
  23. web_search_searxng_mcp-0.1.0/src/web_search_mcp/entry_points/mcp_server.py +31 -0
  24. web_search_searxng_mcp-0.1.0/src/web_search_mcp/infrastructure/__init__.py +0 -0
  25. web_search_searxng_mcp-0.1.0/src/web_search_mcp/infrastructure/clients/__init__.py +0 -0
  26. web_search_searxng_mcp-0.1.0/src/web_search_mcp/infrastructure/clients/searxng.py +77 -0
  27. web_search_searxng_mcp-0.1.0/uv.lock +1354 -0
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: Publish to PyPI
3
+
4
+ 'on':
5
+ release:
6
+ types: [published]
7
+ workflow_dispatch: # Allow manual trigger for testing
8
+
9
+ jobs:
10
+ build-and-publish:
11
+ name: Build and publish Python distribution to PyPI
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ id-token: write # Required for trusted publishing
15
+
16
+ steps:
17
+ - name: Checkout code
18
+ uses: actions/checkout@v4
19
+
20
+ - name: Set up Python
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: '3.12'
24
+
25
+ - name: Install UV
26
+ uses: astral-sh/setup-uv@v4
27
+ with:
28
+ enable-cache: true
29
+
30
+ - name: Build package
31
+ run: uv build
32
+
33
+ - name: Publish to PyPI
34
+ uses: pypa/gh-action-pypi-publish@release/v1
35
+ with:
36
+ # Uses OIDC trusted publishing - no manual token needed
37
+ # Configure at: https://pypi.org/manage/account/publishing/
38
+ skip-existing: true
@@ -0,0 +1,224 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
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
+ #poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ #pdm.lock
116
+ #pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ #pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # SageMath parsed files
135
+ *.sage.py
136
+
137
+ # Environments
138
+ .env
139
+ .envrc
140
+ .venv
141
+ env/
142
+ venv/
143
+ ENV/
144
+ env.bak/
145
+ venv.bak/
146
+
147
+ # Spyder project settings
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope project settings
152
+ .ropeproject
153
+
154
+ # mkdocs documentation
155
+ /site
156
+
157
+ # mypy
158
+ .mypy_cache/
159
+ .dmypy.json
160
+ dmypy.json
161
+
162
+ # Pyre type checker
163
+ .pyre/
164
+
165
+ # pytype static type analyzer
166
+ .pytype/
167
+
168
+ # Cython debug symbols
169
+ cython_debug/
170
+
171
+ # PyCharm
172
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
175
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
176
+ #.idea/
177
+
178
+ # Abstra
179
+ # Abstra is an AI-powered process automation framework.
180
+ # Ignore directories containing user credentials, local state, and settings.
181
+ # Learn more at https://abstra.io/docs
182
+ .abstra/
183
+
184
+ # Visual Studio Code
185
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
188
+ # you could uncomment the following to ignore the entire vscode folder
189
+ # .vscode/
190
+
191
+ # Ruff stuff:
192
+ .ruff_cache/
193
+
194
+ # PyPI configuration file
195
+ .pypirc
196
+
197
+ # Cursor
198
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200
+ # refer to https://docs.cursor.com/context/ignore-files
201
+ .cursorignore
202
+ .cursorindexingignore
203
+
204
+ # Marimo
205
+ marimo/_static/
206
+ marimo/_lsp/
207
+ __marimo__/
208
+
209
+
210
+ # Sensitive Information & Environment
211
+ .env
212
+ .env.local
213
+ .env.*
214
+ !.env.example
215
+ !.env.template
216
+ secrets.yml
217
+ *.key
218
+ *.pem
219
+ *.cert
220
+ *.crt
221
+
222
+ # Project specific sensitive files
223
+ # searxng/settings.yml can contain secret keys
224
+ searxng/settings.yml
@@ -0,0 +1 @@
1
+ 3.13
@@ -0,0 +1,28 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Added
11
+ - None yet
12
+
13
+ ### Changed
14
+ - None yet
15
+
16
+ ### Fixed
17
+ - None yet
18
+
19
+ ## [0.1.0] - 2026-02-05
20
+
21
+ ### Added
22
+ - Initial project release with web search capabilities
23
+ - MCP server implementation
24
+ - SearXNG integration
25
+ - Documentation and configuration setup
26
+
27
+ [Unreleased]: https://github.com/ViktoriaKutseva/web-search-mcp/compare/v0.1.0...HEAD
28
+ [0.1.0]: https://github.com/ViktoriaKutseva/web-search-mcp/releases/tag/v0.1.0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ViktoriaKutseva
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,127 @@
1
+ Metadata-Version: 2.4
2
+ Name: web-search-searxng-mcp
3
+ Version: 0.1.0
4
+ Summary: Add your description here
5
+ License-File: LICENSE
6
+ Requires-Python: >=3.13
7
+ Requires-Dist: fastmcp>=2.14.5
8
+ Requires-Dist: httpx>=0.28.1
9
+ Requires-Dist: loguru>=0.7.3
10
+ Requires-Dist: pydantic-settings>=2.12.0
11
+ Requires-Dist: pydantic>=2.12.5
12
+ Description-Content-Type: text/markdown
13
+
14
+ # Step-by-Step Setup Guide for Web Search MCP
15
+
16
+ This guide lists the specific steps to set up the Web Search MCP server and integrate it into your development environment or MCP clients (like Claude Desktop).
17
+
18
+ ## Prerequisites
19
+
20
+ Before starting, ensure you have the following installed:
21
+
22
+ 1. **Docker & Docker Compose**: For running the local SearxNG instance.
23
+ 2. **uv**: An extremely fast Python package installer and resolver.
24
+ - Install instructions: [astral.sh/uv](https://github.com/astral-sh/uv)
25
+
26
+ ## Step 1: Installation & Setup
27
+
28
+ 1. **Clone the Repository**
29
+ Clone this repository to a permanent location on your machine.
30
+ ```bash
31
+ git clone https://github.com/ViktoriaKutseva/web-search-mcp.git
32
+ cd web-search-mcp
33
+ ```
34
+
35
+ 2. **Initialize Environment**
36
+ Use `uv` to sync dependencies (this creates the virtual environment).
37
+ ```bash
38
+ uv sync
39
+ ```
40
+
41
+ ## Step 2: Start the Search Engine
42
+
43
+ The MCP server relies on a local instance of SearxNG.
44
+
45
+ 1. **Configure SearxNG**
46
+ Copy the example settings file to create the actual configuration.
47
+ ```bash
48
+ cp searxng/settings.yml.example searxng/settings.yml
49
+ ```
50
+ *Note: The `settings.yml` file is git-ignored. You should generate a new `secret_key` inside it.*
51
+
52
+ 2. **Start Services**
53
+ From the repository root run:
54
+ ```bash
55
+ docker compose up -d
56
+ ```
57
+
58
+ 3. **Verify SearxNG**
59
+ Open your browser and navigate to `http://localhost:8080`. You should see the SearxNG search interface.
60
+
61
+ ## Step 3: Configure MCP Client
62
+
63
+ To use this tool in other specific projects or global editors, you need to register it with your MCP Client (e.g., Claude Desktop, VS Code extension).
64
+
65
+ ### Option A: Integration with Claude Desktop
66
+
67
+ 1. **Get Absolute Path**
68
+ Run `pwd` (Linux/macOS) or `cd` (Windows) in the repository root to get the full path.
69
+ *Example:* `/home/user/code/web-search-mcp`
70
+
71
+ 2. **Locate Config File**
72
+ Find or create the `claude_desktop_config.json` file:
73
+ * **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
74
+ * **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
75
+
76
+ 3. **Edit Configuration**
77
+ Add the `web-search` entry to the `mcpServers` object. Replace `/ABSOLUTE/PATH/TO/` with your actual path.
78
+
79
+ ```json
80
+ {
81
+ "mcpServers": {
82
+ "web-search": {
83
+ "command": "uv",
84
+ "args": [
85
+ "--directory",
86
+ "/ABSOLUTE/PATH/TO/web-search-mcp",
87
+ "run",
88
+ "web-search-mcp"
89
+ ],
90
+ "env": {
91
+ "SEARXNG_BASE_URL": "http://localhost:8080"
92
+ }
93
+ }
94
+ }
95
+ }
96
+ ```
97
+
98
+ 4. **Restart Claude Desktop**
99
+ Completely quit and restart the application for changes to take effect.
100
+
101
+ ## Step 4: Verification
102
+
103
+ 1. Open your MCP Client (e.g., Claude Desktop).
104
+ 2. Look for the 🔌 icon or installed tools list to verify `web-search` is connected.
105
+ 3. Ask a question that requires searching the web:
106
+ > "Search for the latest release of Python and tell me the date."
107
+
108
+ ## Troubleshooting
109
+
110
+ - **SearxNG not reachable**: Ensure Docker container is running (`docker ps`) and port 8080 is free.
111
+ - **MCP Error**: Check the logs in your client or run `uv run web-search-mcp` manually in the terminal to see if it starts without crashing (it will wait for stdio input).
112
+
113
+ ## Configuration
114
+
115
+ Settings are managed via environment variables (or \`.env\` file):
116
+
117
+ - \`SEARXNG_BASE_URL\`: URL of the SearxNG instance (default: \`http://localhost:8080\`)
118
+ - \`SEARXNG_TIMEOUT\`: Request timeout in seconds (default: \`10\`)
119
+ - \`LOG_LEVEL\`: Logging level (default: \`INFO\`)
120
+
121
+ ## Development
122
+
123
+ - **Architecture**: Follows simplified DDD guidelines.
124
+ - \`domains/\`: Business logic
125
+ - \`infrastructure/\`: External implementations (SearxNG client)
126
+ - \`entry_points/\`: MCP server and Main execution
127
+ - \`config/\`: Settings
@@ -0,0 +1,114 @@
1
+ # Step-by-Step Setup Guide for Web Search MCP
2
+
3
+ This guide lists the specific steps to set up the Web Search MCP server and integrate it into your development environment or MCP clients (like Claude Desktop).
4
+
5
+ ## Prerequisites
6
+
7
+ Before starting, ensure you have the following installed:
8
+
9
+ 1. **Docker & Docker Compose**: For running the local SearxNG instance.
10
+ 2. **uv**: An extremely fast Python package installer and resolver.
11
+ - Install instructions: [astral.sh/uv](https://github.com/astral-sh/uv)
12
+
13
+ ## Step 1: Installation & Setup
14
+
15
+ 1. **Clone the Repository**
16
+ Clone this repository to a permanent location on your machine.
17
+ ```bash
18
+ git clone https://github.com/ViktoriaKutseva/web-search-mcp.git
19
+ cd web-search-mcp
20
+ ```
21
+
22
+ 2. **Initialize Environment**
23
+ Use `uv` to sync dependencies (this creates the virtual environment).
24
+ ```bash
25
+ uv sync
26
+ ```
27
+
28
+ ## Step 2: Start the Search Engine
29
+
30
+ The MCP server relies on a local instance of SearxNG.
31
+
32
+ 1. **Configure SearxNG**
33
+ Copy the example settings file to create the actual configuration.
34
+ ```bash
35
+ cp searxng/settings.yml.example searxng/settings.yml
36
+ ```
37
+ *Note: The `settings.yml` file is git-ignored. You should generate a new `secret_key` inside it.*
38
+
39
+ 2. **Start Services**
40
+ From the repository root run:
41
+ ```bash
42
+ docker compose up -d
43
+ ```
44
+
45
+ 3. **Verify SearxNG**
46
+ Open your browser and navigate to `http://localhost:8080`. You should see the SearxNG search interface.
47
+
48
+ ## Step 3: Configure MCP Client
49
+
50
+ To use this tool in other specific projects or global editors, you need to register it with your MCP Client (e.g., Claude Desktop, VS Code extension).
51
+
52
+ ### Option A: Integration with Claude Desktop
53
+
54
+ 1. **Get Absolute Path**
55
+ Run `pwd` (Linux/macOS) or `cd` (Windows) in the repository root to get the full path.
56
+ *Example:* `/home/user/code/web-search-mcp`
57
+
58
+ 2. **Locate Config File**
59
+ Find or create the `claude_desktop_config.json` file:
60
+ * **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
61
+ * **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
62
+
63
+ 3. **Edit Configuration**
64
+ Add the `web-search` entry to the `mcpServers` object. Replace `/ABSOLUTE/PATH/TO/` with your actual path.
65
+
66
+ ```json
67
+ {
68
+ "mcpServers": {
69
+ "web-search": {
70
+ "command": "uv",
71
+ "args": [
72
+ "--directory",
73
+ "/ABSOLUTE/PATH/TO/web-search-mcp",
74
+ "run",
75
+ "web-search-mcp"
76
+ ],
77
+ "env": {
78
+ "SEARXNG_BASE_URL": "http://localhost:8080"
79
+ }
80
+ }
81
+ }
82
+ }
83
+ ```
84
+
85
+ 4. **Restart Claude Desktop**
86
+ Completely quit and restart the application for changes to take effect.
87
+
88
+ ## Step 4: Verification
89
+
90
+ 1. Open your MCP Client (e.g., Claude Desktop).
91
+ 2. Look for the 🔌 icon or installed tools list to verify `web-search` is connected.
92
+ 3. Ask a question that requires searching the web:
93
+ > "Search for the latest release of Python and tell me the date."
94
+
95
+ ## Troubleshooting
96
+
97
+ - **SearxNG not reachable**: Ensure Docker container is running (`docker ps`) and port 8080 is free.
98
+ - **MCP Error**: Check the logs in your client or run `uv run web-search-mcp` manually in the terminal to see if it starts without crashing (it will wait for stdio input).
99
+
100
+ ## Configuration
101
+
102
+ Settings are managed via environment variables (or \`.env\` file):
103
+
104
+ - \`SEARXNG_BASE_URL\`: URL of the SearxNG instance (default: \`http://localhost:8080\`)
105
+ - \`SEARXNG_TIMEOUT\`: Request timeout in seconds (default: \`10\`)
106
+ - \`LOG_LEVEL\`: Logging level (default: \`INFO\`)
107
+
108
+ ## Development
109
+
110
+ - **Architecture**: Follows simplified DDD guidelines.
111
+ - \`domains/\`: Business logic
112
+ - \`infrastructure/\`: External implementations (SearxNG client)
113
+ - \`entry_points/\`: MCP server and Main execution
114
+ - \`config/\`: Settings
@@ -0,0 +1,25 @@
1
+ version: '3.7'
2
+
3
+ services:
4
+ searxng:
5
+ image: searxng/searxng:latest
6
+ container_name: searxng
7
+ volumes:
8
+ - ./searxng:/etc/searxng:rw
9
+ ports:
10
+ - "8080:8080"
11
+ environment:
12
+ - SEARXNG_BASE_URL=http://localhost:8080/
13
+ - UWSGI_WORKERS=4
14
+ - UWSGI_THREADS=4
15
+ cap_drop:
16
+ - ALL
17
+ cap_add:
18
+ - CHOWN
19
+ - SETGID
20
+ - SETUID
21
+ logging:
22
+ driver: "json-file"
23
+ options:
24
+ max-size: "1m"
25
+ max-file: "1"
@@ -0,0 +1,118 @@
1
+ # Publishing to PyPI
2
+
3
+ This project uses [UV](https://docs.astral.sh/uv/) as the package manager and GitHub Actions for automated publishing to PyPI.
4
+
5
+ ## Prerequisites
6
+
7
+ 1. **PyPI Account**: Create an account at [https://pypi.org/](https://pypi.org/)
8
+ 2. **Trusted Publishing**: Configure trusted publishing (no API tokens needed!) at [https://pypi.org/manage/account/publishing/](https://pypi.org/manage/account/publishing/)
9
+ - Add a new publisher with:
10
+ - PyPI Project Name: `web-search-searxng-mcp`
11
+ - Owner: `ViktoriaKutseva`
12
+ - Repository name: `web-search-mcp`
13
+ - Workflow name: `publish-to-pypi.yml`
14
+ - Environment name: (leave blank)
15
+
16
+ ## Automated Publishing (Recommended)
17
+
18
+ The project is configured to automatically publish to PyPI when a new GitHub release is created:
19
+
20
+ 1. **Update version** in `pyproject.toml`:
21
+ ```toml
22
+ version = "0.2.0" # Update to your new version
23
+ ```
24
+
25
+ 2. **Update version** in `src/web_search_mcp/settings.py`:
26
+ ```python
27
+ app_version: str = Field(default="0.2.0", description="Application version")
28
+ # Update to your new version
29
+ ```
30
+
31
+ 1. **Update CHANGELOG.md** with the new version changes and link for release.
32
+
33
+ 2. **Commit and push** your changes:
34
+ ```bash
35
+ git add pyproject.toml
36
+ git commit -m "Bump version to 0.2.0"
37
+ git push
38
+ ```
39
+
40
+ 3. **Create a GitHub release**:
41
+
42
+ Using GitHub CLI (recommended):
43
+ ```bash
44
+ gh release create v0.2.0 \
45
+ --title "v0.2.0 - Release Title" \
46
+ --notes "Release notes here..."
47
+ ```
48
+
49
+ Or using GitHub web interface:
50
+ - Go to [https://github.com/ViktoriaKutseva/web-search-mcp/releases/new](https://github.com/ViktoriaKutseva/web-search-mcp/releases/new)
51
+ - Create a new tag (e.g., `v0.2.0`)
52
+ - Add release title and description
53
+ - Click "Publish release"
54
+
55
+ To verify the release:
56
+ ```bash
57
+ gh release view v0.2.0
58
+ ```
59
+
60
+ 4. **GitHub Actions will automatically**:
61
+ - Build the package using UV
62
+ - Publish to PyPI using trusted publishing
63
+ - You can monitor the progress in the Actions tab
64
+
65
+ ## Manual Publishing
66
+
67
+ If you need to publish manually:
68
+
69
+ 1. **Install UV** (if not already installed):
70
+ ```bash
71
+ pip install uv
72
+ ```
73
+
74
+ 2. **Build the package**:
75
+ ```bash
76
+ uv build
77
+ ```
78
+ This creates distribution files in the `dist/` directory.
79
+
80
+ 3. **Publish using UV** (requires PyPI API token):
81
+ ```bash
82
+ uv publish
83
+ ```
84
+ Or use `twine`:
85
+ ```bash
86
+ pip install twine
87
+ twine upload dist/*
88
+ ```
89
+
90
+ ## Testing on TestPyPI
91
+
92
+ Before publishing to the main PyPI, you can test on TestPyPI:
93
+
94
+ 1. Configure trusted publishing for TestPyPI at [https://test.pypi.org/manage/account/publishing/](https://test.pypi.org/manage/account/publishing/)
95
+
96
+ 2. Manually trigger the workflow or modify the workflow to publish to TestPyPI:
97
+ ```bash
98
+ uv publish --index-url https://test.pypi.org/legacy/
99
+ ```
100
+
101
+ 3. Test installation:
102
+ ```bash
103
+ pip install --index-url https://test.pypi.org/simple/ web-search-mcp
104
+ ```
105
+
106
+ ## Best Practices
107
+
108
+ 1. **Always create tags on `main` branch** - Never tag on `develop` or feature branches
109
+ 2. **Merge develop to main before tagging** - Ensure all changes are in main
110
+ 3. **Test on TestPyPI first** (optional but recommended for major releases)
111
+ 4. **Use semantic versioning** (MAJOR.MINOR.PATCH)
112
+ 5. **Analyze changes** in repository between last release and current state
113
+ 6. **Update CHANGELOG.md** with all changes before release
114
+ 7. **Test build locally** before pushing tags
115
+ 8. **Keep credentials secure** - use project-specific tokens
116
+ 9. **Test installation** from PyPI after publishing
117
+ 10. **Create GitHub Release** after successful publish
118
+ 11. **Monitor PyPI stats** and user feedback