Skip to content

Commit f988850

Browse files
authored
Merge pull request #53 from rhaist/main
Bump all dependencies - Meilisearch 1.16 compatibility
2 parents 2821835 + cb8947e commit f988850

File tree

15 files changed

+558
-264
lines changed

15 files changed

+558
-264
lines changed

.github/workflows/claude.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,3 @@ jobs:
3434
uses: anthropics/claude-code-action@beta
3535
with:
3636
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
37-

.github/workflows/publish.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ jobs:
1212
version_changed: ${{ steps.check_version.outputs.version_changed }}
1313
current_version: ${{ steps.get_version.outputs.current_version }}
1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
with:
1717
fetch-depth: 2
18-
18+
1919
- name: Get current version
2020
id: get_version
2121
run: |
2222
CURRENT_VERSION=$(grep "version = " pyproject.toml | cut -d'"' -f2)
2323
echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
24-
24+
2525
- name: Check if version changed
2626
id: check_version
2727
run: |
@@ -40,23 +40,23 @@ jobs:
4040
url: https://pypi.org/p/meilisearch-mcp
4141
permissions:
4242
id-token: write # IMPORTANT: mandatory for trusted publishing
43-
43+
4444
steps:
45-
- uses: actions/checkout@v3
46-
45+
- uses: actions/checkout@v4
46+
4747
- name: Set up Python
48-
uses: actions/setup-python@v4
48+
uses: actions/setup-python@v5
4949
with:
5050
python-version: "3.10"
51-
51+
5252
- name: Install build dependencies
5353
run: |
5454
python -m pip install --upgrade pip
5555
pip install build
56-
56+
5757
- name: Build package
5858
run: python -m build
59-
59+
6060
- name: Publish to PyPI
6161
uses: pypa/gh-action-pypi-publish@release/v1
6262
with:
@@ -65,24 +65,24 @@ jobs:
6565

6666
build-and-publish-docker-latest:
6767
runs-on: ubuntu-latest
68-
68+
6969
steps:
70-
- uses: actions/checkout@v3
71-
70+
- uses: actions/checkout@v4
71+
7272
- name: Set up QEMU
7373
uses: docker/setup-qemu-action@v3
74-
74+
7575
- name: Set up Docker Buildx
7676
uses: docker/setup-buildx-action@v3
77-
77+
7878
- name: Log in to Docker Hub
7979
uses: docker/login-action@v3
8080
with:
8181
username: ${{ secrets.DOCKERHUB_USERNAME }}
8282
password: ${{ secrets.DOCKERHUB_TOKEN }}
83-
83+
8484
- name: Build and push latest Docker image
85-
uses: docker/build-push-action@v5
85+
uses: docker/build-push-action@v6
8686
with:
8787
context: .
8888
platforms: linux/amd64,linux/arm64
@@ -95,28 +95,28 @@ jobs:
9595
needs: check-version
9696
if: needs.check-version.outputs.version_changed == 'true'
9797
runs-on: ubuntu-latest
98-
98+
9999
steps:
100-
- uses: actions/checkout@v3
101-
100+
- uses: actions/checkout@v4
101+
102102
- name: Set up QEMU
103103
uses: docker/setup-qemu-action@v3
104-
104+
105105
- name: Set up Docker Buildx
106106
uses: docker/setup-buildx-action@v3
107-
107+
108108
- name: Log in to Docker Hub
109109
uses: docker/login-action@v3
110110
with:
111111
username: ${{ secrets.DOCKERHUB_USERNAME }}
112112
password: ${{ secrets.DOCKERHUB_TOKEN }}
113-
113+
114114
- name: Build and push versioned Docker image
115-
uses: docker/build-push-action@v5
115+
uses: docker/build-push-action@v6
116116
with:
117117
context: .
118118
platforms: linux/amd64,linux/arm64
119119
push: true
120120
tags: getmeili/meilisearch-mcp:${{ needs.check-version.outputs.current_version }}
121121
cache-from: type=gha
122-
cache-to: type=gha,mode=max
122+
cache-to: type=gha,mode=max

.github/workflows/test.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ on:
99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
12-
12+
1313
services:
1414
meilisearch:
15-
image: getmeili/meilisearch:v1.6
15+
image: getmeili/meilisearch:v1.16
1616
ports:
1717
- 7700:7700
1818
env:
@@ -23,30 +23,30 @@ jobs:
2323
--health-interval 30s
2424
--health-timeout 10s
2525
--health-retries 5
26-
26+
2727
steps:
28-
- uses: actions/checkout@v3
29-
28+
- uses: actions/checkout@v4
29+
3030
- name: Set up Python
31-
uses: actions/setup-python@v4
31+
uses: actions/setup-python@v5
3232
with:
3333
python-version: '3.10'
34-
34+
3535
- name: Install dependencies
3636
run: |
3737
python -m pip install --upgrade pip
3838
pip install -r requirements-dev.txt
3939
pip install -e .
40-
40+
4141
- name: Format code with black
4242
run: |
4343
black src/
4444
black tests/
45-
45+
4646
- name: Wait for Meilisearch to be ready
4747
run: |
4848
timeout 60 bash -c 'until curl -f http://localhost:7700/health; do sleep 2; done'
49-
49+
5050
- name: Run tests
5151
env:
5252
MEILI_HTTP_ADDR: http://localhost:7700

Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Use Python 3.12 slim image for smaller size
2-
FROM python:3.12-slim
2+
FROM python:3.13-slim
33

44
# Set working directory
55
WORKDIR /app
66

77
# Install system dependencies
8-
RUN apt-get update && apt-get install -y --no-install-recommends \
9-
curl \
10-
&& rm -rf /var/lib/apt/lists/*
8+
RUN apt-get update && apt-get dist-upgrade -y && \
9+
apt-get install -y --no-install-recommends curl && \
10+
rm -rf /var/lib/apt/lists/*
1111

1212
# Install uv for faster Python package management
1313
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
@@ -25,4 +25,4 @@ ENV MEILI_HTTP_ADDR=http://meilisearch:7700
2525
ENV MEILI_MASTER_KEY=""
2626

2727
# Run the MCP server
28-
CMD ["python", "-m", "src.meilisearch_mcp"]
28+
CMD ["uv", "run", "python", "-m", "src.meilisearch_mcp"]

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ version = "0.5.0"
44
description = "MCP server for Meilisearch"
55
requires-python = ">=3.10"
66
dependencies = [
7-
"meilisearch>=0.33.0",
8-
"mcp>=0.1.0",
9-
"httpx>=0.24.0",
10-
"pydantic>=2.0.0"
7+
"meilisearch>=0.36.0",
8+
"mcp>=1.12.4",
9+
"httpx>=0.28.1",
10+
"pydantic>=2.11.7",
1111
]
1212

1313
[build-system]

requirements-dev.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pytest>=7.0.0
2-
pytest-asyncio>=0.25.0
3-
black>=23.0.0
4-
mcp>=1.2.1
1+
pytest>=8.4.1
2+
pytest-asyncio>=1.1.0
3+
black>=25.1.0
4+
mcp>=1.12.4

src/meilisearch_mcp/documents.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,24 @@ def get_documents(
2626
params["limit"] = limit
2727
if fields is not None:
2828
params["fields"] = fields
29-
29+
3030
result = index.get_documents(params if params else {})
31-
31+
3232
# Convert meilisearch model objects to JSON-serializable format
33-
if hasattr(result, '__dict__'):
33+
if hasattr(result, "__dict__"):
3434
result_dict = result.__dict__.copy()
3535
# Convert individual document objects in results if they exist
36-
if 'results' in result_dict and isinstance(result_dict['results'], list):
36+
if "results" in result_dict and isinstance(
37+
result_dict["results"], list
38+
):
3739
serialized_results = []
38-
for doc in result_dict['results']:
39-
if hasattr(doc, '__dict__'):
40+
for doc in result_dict["results"]:
41+
if hasattr(doc, "__dict__"):
4042
# Extract the actual document data
4143
doc_dict = doc.__dict__.copy()
4244
# Look for private attributes that might contain the actual data
4345
for key, value in doc_dict.items():
44-
if key.startswith('_') and isinstance(value, dict):
46+
if key.startswith("_") and isinstance(value, dict):
4547
# Use the dict content instead of the wrapper
4648
serialized_results.append(value)
4749
break
@@ -50,7 +52,7 @@ def get_documents(
5052
serialized_results.append(doc_dict)
5153
else:
5254
serialized_results.append(doc)
53-
result_dict['results'] = serialized_results
55+
result_dict["results"] = serialized_results
5456
return result_dict
5557
else:
5658
return result

src/meilisearch_mcp/keys.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ class KeyManager:
99
def __init__(self, client: Client):
1010
self.client = client
1111

12-
def get_keys(
13-
self, parameters: Optional[Dict[str, Any]] = None
14-
) -> Dict[str, Any]:
12+
def get_keys(self, parameters: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
1513
"""Get list of API keys"""
1614
try:
1715
return self.client.get_keys(parameters)

src/meilisearch_mcp/logging.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import logging
22
import sys
33
import json
4-
from datetime import datetime
4+
from datetime import datetime, timezone
55
from pathlib import Path
66
from typing import Optional, Dict, Any
77
import threading
@@ -97,7 +97,7 @@ def _setup_logger(self, log_dir: Optional[str]):
9797
def _log(self, level: str, msg: str, **kwargs):
9898
"""Create structured log entry"""
9999
log_entry = {
100-
"timestamp": datetime.utcnow().isoformat(),
100+
"timestamp": datetime.now(timezone.utc).isoformat(),
101101
"level": level,
102102
"message": msg,
103103
**kwargs,

src/meilisearch_mcp/monitoring.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def get_health_status(self) -> HealthStatus:
3636
"""Get comprehensive health status"""
3737
try:
3838
# Get various stats to build health picture
39-
stats = self.client.get_stats()
39+
stats = self.client.get_all_stats()
4040
indexes = self.client.get_indexes()
4141

4242
indexes_info = []

0 commit comments

Comments
 (0)