Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4357609
add server with basic tools
DavidRamosSal Apr 29, 2025
912adc6
project can now be built as a package
DavidRamosSal Apr 30, 2025
31b9248
commit db changes automatically
DavidRamosSal Apr 30, 2025
9c55993
add delete vector store tool
DavidRamosSal Apr 30, 2025
5f13099
refactor server to make it more modular
DavidRamosSal May 2, 2025
f127808
changed to FastMCP
DavidRamosSal May 3, 2025
7d32d35
add test for mcp tools with mock embeddings
DavidRamosSal May 3, 2025
115694c
add working Dockerfile
DavidRamosSal May 4, 2025
2b5be7b
add testing to github actions
DavidRamosSal May 4, 2025
fbbf231
fix db setup in github action
DavidRamosSal May 4, 2025
aa6f43a
tweak db setup in github action
DavidRamosSal May 4, 2025
dd25a4a
fix db and python setup in github action
DavidRamosSal May 4, 2025
dd873c6
added test embedding provider to simplify tests
DavidRamosSal May 4, 2025
d448437
change Docker CMD args
DavidRamosSal May 4, 2025
f961e73
change tool name for clarity
DavidRamosSal May 4, 2025
01e9f79
add proper README
DavidRamosSal May 4, 2025
09c17a5
add schema check
DavidRamosSal May 4, 2025
a158b9a
remove default database name
DavidRamosSal May 5, 2025
56cdf96
fix and update readme
DavidRamosSal May 5, 2025
ec9285c
fix readme
DavidRamosSal May 5, 2025
68f4c79
Create LICENSE
DavidRamosSal May 5, 2025
6c65be4
merge the code into the new repo
DavidRamosSal May 9, 2025
67ad9ae
change server versions to LTS branch
DavidRamosSal May 12, 2025
7231353
fix urls in readme to refer to correct repo and documentation
DavidRamosSal May 12, 2025
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
69 changes: 69 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Run Tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-24.04

services:
mariadb:
image: mariadb:11.8
env:
MARIADB_ROOT_PASSWORD: Password123!
MARIADB_DATABASE: test

ports:
- 3306:3306

steps:
- uses: actions/checkout@v4

- name: Install system dependencies
run: |
curl -LsSO https://r.mariadb.com/downloads/mariadb_repo_setup
echo "c4a0f3dade02c51a6a28ca3609a13d7a0f8910cccbb90935a2f218454d3a914a mariadb_repo_setup" | sha256sum -c -
chmod +x mariadb_repo_setup
sudo ./mariadb_repo_setup --mariadb-server-version="mariadb-11.8"
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential \
python3-dev \
libmariadb3 \
libmariadb-dev \
pkg-config

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"

- name: Enable caching
uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.5.14"

- name: Install dependencies
run: |
uv sync

- name: Run tests
run: |
uv run pytest tests/test_server.py -v
env:
# Environment variables for MCP server
MARIADB_HOST: 127.0.0.1
MARIADB_PORT: 3306
MARIADB_USER: root
MARIADB_PASSWORD: Password123!
MARIADB_DATABASE: test
EMBEDDING_PROVIDER: test
174 changes: 174 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# UV
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
#uv.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# Ruff stuff:
.ruff_cache/

# PyPI configuration file
.pypirc
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10
40 changes: 40 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM python:3.10-slim

# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
python3-dev \
openssl \
curl \
ca-certificates \
gnupg \
build-essential && \
rm -rf /var/lib/apt/lists/*

# Set up MariaDB's Python connector dependencies
RUN curl -LsSO https://r.mariadb.com/downloads/mariadb_repo_setup && \
echo "c4a0f3dade02c51a6a28ca3609a13d7a0f8910cccbb90935a2f218454d3a914a mariadb_repo_setup" | sha256sum -c - && \
chmod +x mariadb_repo_setup && \
./mariadb_repo_setup --mariadb-server-version="mariadb-11.8" && \
rm mariadb_repo_setup && \
apt-get update && \
apt-get install -y --no-install-recommends \
libmariadb3 \
libmariadb-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Install uv package manager
RUN pip install --no-cache-dir uv

WORKDIR /app

# Copy project files
COPY . /app

# Install project dependencies
RUN uv sync

EXPOSE 8000

CMD ["uv", "run", "mcp-server-mariadb-vector", "--transport", "sse", "--host", "0.0.0.0"]
Loading