Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Python cache
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# Virtual environments
.venv/
venv/
ENV/
env/

# Testing
.pytest_cache/
.coverage
htmlcov/
.tox/
.hypothesis/

# IDE
.vscode/
.idea/
*.swp
*.swo
*~

# Git
.git/
.gitignore

# Documentation
docs/
*.md
!README.md

# CI/CD
.github/

# Development files
.env
.env.*
CLAUDE.md

# Logs
logs/
*.log

# macOS
.DS_Store

# Test data
tests/
data.ms/

# Docker compose files
docker-compose*.yml
46 changes: 43 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish to PyPI
name: Publish to PyPI and Docker Hub

on:
push:
Expand All @@ -24,7 +24,7 @@ jobs:
echo "version_changed=true" >> $GITHUB_OUTPUT
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT

build-and-publish:
build-and-publish-pypi:
needs: check-version
if: needs.check-version.outputs.version_changed == 'true'
runs-on: ubuntu-latest
Expand Down Expand Up @@ -54,4 +54,44 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
print-hash: true
print-hash: true

build-and-publish-docker:
needs: check-version
if: needs.check-version.outputs.version_changed == 'true'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: meilisearch/meilisearch-mcp
tags: |
type=raw,value=${{ needs.check-version.outputs.new_version }}
type=raw,value=latest

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
25 changes: 24 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,27 @@ jobs:
MEILI_HTTP_ADDR: http://localhost:7700
MEILI_MASTER_KEY: test_master_key
run: |
pytest tests/ -v
pytest tests/ -v --ignore=tests/test_docker_integration.py

docker-test:
runs-on: ubuntu-latest
# Only run on main branch or when PR has 'docker' label
if: github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'docker')

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install -e .

- name: Run Docker integration tests
run: |
pytest tests/test_docker_integration.py -v
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Use Python 3.12 slim image for smaller size
FROM python:3.12-slim

# Set working directory
WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*

# Install uv for faster Python package management
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.local/bin:${PATH}"

# Copy project files
COPY pyproject.toml README.md ./
COPY src/ ./src/

# Install the package
RUN uv pip install --system .

# Set default environment variables
ENV MEILI_HTTP_ADDR=http://meilisearch:7700
ENV MEILI_MASTER_KEY=""

# Run the MCP server
CMD ["python", "-m", "src.meilisearch_mcp"]
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,60 @@ source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -e .
```

### Using Docker

Perfect for containerized environments like n8n workflows!

#### From Docker Hub (Recommended)

```bash
# Pull the latest image
docker pull meilisearch/meilisearch-mcp:latest

# Or a specific version
docker pull meilisearch/meilisearch-mcp:0.5.0

# Run the container
docker run -it \
-e MEILI_HTTP_ADDR=http://your-meilisearch:7700 \
-e MEILI_MASTER_KEY=your-master-key \
meilisearch/meilisearch-mcp:latest
```

#### Using Docker Compose

```bash
# Option 1: Use pre-built images (requires Docker Hub image to exist)
curl -O https://raw.githubusercontent.com/meilisearch/meilisearch-mcp/main/docker-compose.prod.yml
docker compose -f docker-compose.prod.yml up -d

# Option 2: Build from source
git clone https://github.com/meilisearch/meilisearch-mcp.git
cd meilisearch-mcp
docker compose up -d
```

#### Build from Source

```bash
# Build your own image
docker build -t meilisearch-mcp .
docker run -it \
-e MEILI_HTTP_ADDR=http://your-meilisearch:7700 \
-e MEILI_MASTER_KEY=your-master-key \
meilisearch-mcp
```

For n8n integration, use the Docker image in your workflow:
```yaml
# Example n8n docker-compose service
meilisearch-mcp:
image: meilisearch-mcp:latest
environment:
- MEILI_HTTP_ADDR=http://meilisearch:7700
- MEILI_MASTER_KEY=masterKey
```

## 🛠️ What Can You Do?

<details>
Expand Down
31 changes: 31 additions & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
services:
meilisearch:
image: getmeili/meilisearch:v1.6
ports:
- "7700:7700"
environment:
- MEILI_MASTER_KEY=masterKey
- MEILI_ENV=development
volumes:
- meilisearch_data:/meili_data
networks:
- meilisearch-network

meilisearch-mcp:
image: meilisearch/meilisearch-mcp:latest
environment:
- MEILI_HTTP_ADDR=http://meilisearch:7700
- MEILI_MASTER_KEY=masterKey
depends_on:
- meilisearch
networks:
- meilisearch-network
stdin_open: true
tty: true

volumes:
meilisearch_data:

networks:
meilisearch-network:
driver: bridge
33 changes: 33 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
services:
meilisearch:
image: getmeili/meilisearch:v1.6
ports:
- "7700:7700"
environment:
- MEILI_MASTER_KEY=masterKey
- MEILI_ENV=development
volumes:
- meilisearch_data:/meili_data
networks:
- meilisearch-network

meilisearch-mcp:
build: .
# To use the published image instead, comment the line above and uncomment:
# image: meilisearch/meilisearch-mcp:latest
environment:
- MEILI_HTTP_ADDR=http://meilisearch:7700
- MEILI_MASTER_KEY=masterKey
depends_on:
- meilisearch
networks:
- meilisearch-network
stdin_open: true
tty: true

volumes:
meilisearch_data:

networks:
meilisearch-network:
driver: bridge
Loading