zvec-mcp-server 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.
@@ -0,0 +1,52 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, master]
6
+ pull_request:
7
+ branches: [main, master]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ os: [ubuntu-latest, macos-latest]
16
+ python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
17
+
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Set up Python ${{ matrix.python-version }}
22
+ uses: actions/setup-python@v5
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+
26
+ - name: Install uv
27
+ uses: astral-sh/setup-uv@v3
28
+ with:
29
+ version: "latest"
30
+
31
+ - name: Install dependencies
32
+ run: |
33
+ uv venv
34
+ uv pip install -e ".[dev]"
35
+
36
+ - name: Lint with ruff
37
+ run: |
38
+ uv run ruff check src/ tests/
39
+ uv run ruff format --check src/ tests/
40
+
41
+ - name: Run tests
42
+ run: |
43
+ uv run pytest tests/ -v --tb=short
44
+
45
+ - name: Upload coverage to Codecov
46
+ if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
47
+ uses: codecov/codecov-action@v4
48
+ with:
49
+ fail_ci_if_error: false
50
+ verbose: true
51
+ env:
52
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
@@ -0,0 +1,49 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ jobs:
9
+ build:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+
14
+ - name: Set up Python
15
+ uses: actions/setup-python@v5
16
+ with:
17
+ python-version: "3.11"
18
+
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v3
21
+ with:
22
+ version: "latest"
23
+
24
+ - name: Install build dependencies
25
+ run: |
26
+ uv venv
27
+ uv pip install build twine
28
+
29
+ - name: Build package
30
+ run: |
31
+ uv run python -m build
32
+
33
+ - name: Check package
34
+ run: |
35
+ uv run twine check dist/*
36
+
37
+ - name: Upload to PyPI
38
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
39
+ uses: pypa/gh-action-pypi-publish@release/v1
40
+ with:
41
+ password: ${{ secrets.PYPI_API_TOKEN }}
42
+
43
+ - name: Create GitHub Release
44
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
45
+ uses: softprops/action-gh-release@v1
46
+ with:
47
+ generate_release_notes: true
48
+ draft: false
49
+ prerelease: false
@@ -0,0 +1,64 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+
23
+ # Virtual environments
24
+ venv/
25
+ env/
26
+ ENV/
27
+ .venv/
28
+
29
+ # UV
30
+ .uv/
31
+ uv.lock
32
+
33
+ # IDE
34
+ .vscode/
35
+ .idea/
36
+ *.swp
37
+ *.swo
38
+ *~
39
+
40
+ # Qoder / Agents
41
+ .agents/
42
+ .qoder/
43
+ skills-lock.json
44
+
45
+ # Temporary directories
46
+ tmp/
47
+
48
+ # Zvec data directories
49
+ *.zvec/
50
+ my_vectors/
51
+ test_vectors/
52
+ ./embeddings/
53
+ ./my_collection/
54
+ example_collection/
55
+ test_collection/
56
+
57
+ # Testing
58
+ .pytest_cache/
59
+ .coverage
60
+ htmlcov/
61
+
62
+ # OS
63
+ .DS_Store
64
+ Thumbs.db
@@ -0,0 +1,7 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.6.9
4
+ hooks:
5
+ - id: ruff
6
+ args: [--fix]
7
+ - id: ruff-format
@@ -0,0 +1,128 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the
26
+ overall community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or
31
+ advances of any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email
35
+ address, without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ the issue tracker.
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series
86
+ of actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or
93
+ permanent ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within
113
+ the community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.0, available at
119
+ https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120
+
121
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct
122
+ enforcement ladder](https://github.com/mozilla/diversity).
123
+
124
+ [homepage]: https://www.contributor-covenant.org
125
+
126
+ For answers to common questions about this code of conduct, see the FAQ at
127
+ https://www.contributor-covenant.org/faq. Translations are available at
128
+ https://www.contributor-covenant.org/translations.
@@ -0,0 +1,212 @@
1
+ # Contributing to Zvec MCP Server
2
+
3
+ Thank you for your interest in contributing to Zvec MCP Server! This document provides guidelines and instructions for contributing.
4
+
5
+ ## Development Setup
6
+
7
+ ### Prerequisites
8
+
9
+ - Python 3.10 - 3.12
10
+ - [uv](https://github.com/astral-sh/uv) (recommended) or pip
11
+
12
+ ### Setup Steps
13
+
14
+ 1. Fork the repository and clone your fork:
15
+ ```bash
16
+ git clone https://github.com/yourusername/zvec-mcp-server.git
17
+ cd zvec-mcp-server
18
+ ```
19
+
20
+ 2. Create a virtual environment and install dependencies:
21
+ ```bash
22
+ # Using uv (recommended)
23
+ uv venv
24
+ source .venv/bin/activate # On Windows: .venv\Scripts\activate
25
+ uv pip install -e ".[dev]"
26
+
27
+ # Or using pip
28
+ python -m venv .venv
29
+ source .venv/bin/activate
30
+ pip install -e ".[dev]"
31
+ ```
32
+
33
+ 3. Verify the setup by running tests:
34
+ ```bash
35
+ pytest tests/ -v
36
+ ```
37
+
38
+ ## Development Workflow
39
+
40
+ ### Code Style
41
+
42
+ We use [Ruff](https://docs.astral.sh/ruff/) for linting and formatting:
43
+
44
+ ```bash
45
+ # Check code style
46
+ ruff check src/ tests/
47
+
48
+ # Format code
49
+ ruff format src/ tests/
50
+
51
+ # Fix auto-fixable issues
52
+ ruff check --fix src/ tests/
53
+ ```
54
+
55
+ ### Running Tests
56
+
57
+ ```bash
58
+ # Run all tests
59
+ pytest tests/ -v
60
+
61
+ # Run specific test file
62
+ pytest tests/test_server.py -v
63
+
64
+ # Run with coverage
65
+ pytest tests/ --cov=zvec_mcp --cov-report=html
66
+
67
+ # Run specific test class
68
+ pytest tests/test_server.py::TestMultiVectorQuery -v
69
+ ```
70
+
71
+ ### Testing with MCP Inspector
72
+
73
+ ```bash
74
+ # Start the MCP Inspector
75
+ npx @modelcontextprotocol/inspector python -m zvec_mcp
76
+ ```
77
+
78
+ ## Submitting Changes
79
+
80
+ ### Pull Request Process
81
+
82
+ 1. **Create a branch** for your changes:
83
+ ```bash
84
+ git checkout -b feature/your-feature-name
85
+ # or
86
+ git checkout -b fix/issue-description
87
+ ```
88
+
89
+ 2. **Make your changes** following our coding standards
90
+
91
+ 3. **Add tests** for new functionality
92
+
93
+ 4. **Ensure all tests pass**:
94
+ ```bash
95
+ pytest tests/ -v
96
+ ```
97
+
98
+ 5. **Update documentation** if needed (README.md, docstrings, etc.)
99
+
100
+ 6. **Commit your changes** with a clear commit message:
101
+ ```bash
102
+ git commit -m "feat: add new embedding search tool"
103
+ ```
104
+
105
+ 7. **Push to your fork**:
106
+ ```bash
107
+ git push origin feature/your-feature-name
108
+ ```
109
+
110
+ 8. **Open a Pull Request** against the main repository
111
+
112
+ ### Commit Message Convention
113
+
114
+ We follow [Conventional Commits](https://www.conventionalcommits.org/):
115
+
116
+ - `feat:` - New feature
117
+ - `fix:` - Bug fix
118
+ - `docs:` - Documentation changes
119
+ - `style:` - Code style changes (formatting, no logic change)
120
+ - `refactor:` - Code refactoring
121
+ - `test:` - Test changes
122
+ - `chore:` - Build process or auxiliary tool changes
123
+
124
+ Examples:
125
+ ```
126
+ feat: add support for sparse vector queries
127
+ fix: handle missing collection error in search
128
+ docs: update README with new examples
129
+ ```
130
+
131
+ ## Code Guidelines
132
+
133
+ ### Python Style
134
+
135
+ - Follow PEP 8 guidelines
136
+ - Maximum line length: 100 characters
137
+ - Use type hints where appropriate
138
+ - Write docstrings for all public functions and classes
139
+
140
+ ### Testing Guidelines
141
+
142
+ - Write tests for all new functionality
143
+ - Use pytest fixtures for setup/teardown
144
+ - Use `pytest-asyncio` for async tests
145
+ - Ensure tests are isolated and don't depend on external state
146
+
147
+ ### MCP Tool Design
148
+
149
+ When adding new MCP tools:
150
+
151
+ 1. Define input schema in `schemas.py` using Pydantic models
152
+ 2. Implement the tool in `server.py` with proper annotations
153
+ 3. Add comprehensive tests in `tests/test_server.py`
154
+ 4. Update README.md with usage examples
155
+
156
+ Example tool structure:
157
+ ```python
158
+ @mcp.tool(
159
+ name="tool_name",
160
+ annotations={
161
+ "title": "Human Readable Title",
162
+ "readOnlyHint": True/False,
163
+ "destructiveHint": True/False,
164
+ "idempotentHint": True/False,
165
+ "openWorldHint": True/False,
166
+ }
167
+ )
168
+ async def tool_name(params: ToolInput) -> str:
169
+ """
170
+ Clear description of what the tool does.
171
+
172
+ Args:
173
+ params (ToolInput): Description of parameters
174
+
175
+ Returns:
176
+ str: Description of return value
177
+ """
178
+ try:
179
+ # Implementation
180
+ return result
181
+ except Exception as e:
182
+ return handle_error(e)
183
+ ```
184
+
185
+ ## Reporting Issues
186
+
187
+ ### Bug Reports
188
+
189
+ When reporting bugs, please include:
190
+
191
+ - Python version
192
+ - Operating system
193
+ - Steps to reproduce
194
+ - Expected behavior
195
+ - Actual behavior
196
+ - Error messages and stack traces
197
+
198
+ ### Feature Requests
199
+
200
+ For feature requests, please describe:
201
+
202
+ - The use case
203
+ - Proposed solution
204
+ - Alternatives considered
205
+
206
+ ## Questions?
207
+
208
+ Feel free to open an issue for questions or join discussions in existing issues.
209
+
210
+ ## License
211
+
212
+ By contributing, you agree that your contributions will be licensed under the Apache 2.0 License.