Skip to content

Commit

Permalink
Merge pull request #24 from alexander-zuev/feat/infra
Browse files Browse the repository at this point in the history
chore: add Docker and environment configuration files
  • Loading branch information
alexander-zuev authored Mar 2, 2025
2 parents da00388 + 609701b commit 29e3619
Show file tree
Hide file tree
Showing 8 changed files with 193 additions and 5 deletions.
89 changes: 89 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Python
__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
.pytest_cache/
.coverage
htmlcov/
.tox/
.nox/

# Virtual Environment
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# macOS
.DS_Store
.AppleDouble
.LSOverride
Icon
._*
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# IDEs and Editors
.idea/
.vscode/
*.swp
*.swo
*~
.project
.classpath
.settings/
*.sublime-workspace
*.sublime-project

# Local development
.env.mcp
.env.mcp2
*.log
logs/

# Ignore local assets
assets/
*.gif
*.mp4

# Generated version file
supabase_mcp/_version.py

# Docs
.llms-full.txt

# Docker specific ignores
Dockerfile
.dockerignore
docker-compose.yml
docker-compose.yaml

# Git
.git/
.github/
.gitignore
14 changes: 11 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# .env.mcp.example
SUPABASE_PROJECT_REF=your-project-ref # default is local supabase project ref if not set
SUPABASE_DB_PASSWORD=your-db-password # default is local supabase db password if not set
# Supabase MCP Server Environment Configuration
# Copy this file to .env to configure your server

# Required for remote Supabase projects (optional for local development)
SUPABASE_PROJECT_REF=your-project-ref # Your project reference from dashboard URL
SUPABASE_DB_PASSWORD=your-db-password # Database password for your project

# Optional configuration
SUPABASE_REGION=us-east-1 # Region where your Supabase project is hosted (defaults to us-east-1)
SUPABASE_ACCESS_TOKEN=your-personal-access-token # Required for Management API tools
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key # Required for Auth Admin SDK tools
20 changes: 20 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Description

<!-- Provide a clear and concise description of what this PR accomplishes -->

## Type of Change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Performance improvement
- [ ] Code refactoring (no functional changes)
- [ ] Test updates
- [ ] CI/CD or build process changes
- [ ] Other (please describe):

## Checklist
- [ ] I have performed a self-review of my own code
- [ ] I have made corresponding changes to the documentation
- [ ] New and existing unit tests pass locally with my changes
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Run tests
run: |
source .venv/bin/activate
source .venv/bin/activate # necessary for pytest
pytest
- name: Build distribution packages
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docs/release-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Pre-release
6. Changelog is up to date
7. Tag and release on GitHub
8. Release is published to PyPI
9. Update dockerfile
10. Update .env.example (if necessary)

Post-release
- Clean install from PyPi works
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,4 @@ supabase_mcp/_version.py

# Docs
.llms-full.txt
COMMIT_CONVENTION.md
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM python:3.12-slim-bookworm

WORKDIR /app

# Install PostgreSQL client libraries (required for psycopg2) and curl for uv installation
RUN apt-get update && apt-get install -y \
libpq-dev \
gcc \
curl \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*

# # Install uv with fixed version
ENV UV_VERSION="0.6.1"
ADD https://astral.sh/uv/${UV_VERSION}/install.sh /uv-installer.sh
RUN sh /uv-installer.sh && rm /uv-installer.sh
# Ensure the installed binary is on the `PATH`
ENV PATH="/root/.local/bin/:$PATH"

# # Copy the project into the image
COPY . /app
WORKDIR /app

# Create venv and install dependencies with version set
ENV SETUPTOOLS_SCM_PRETEND_VERSION="0.3.6"
RUN uv venv && \
. .venv/bin/activate && \
uv pip install .

# Set the entrypoint to use the venv
ENTRYPOINT ["uv", "run", "supabase-mcp-server"]
39 changes: 38 additions & 1 deletion smithery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,44 @@ startCommand:
supabaseDbPassword:
type: string
description: The database password of Supabase project you want to connect to.
supabaseRegion:
type: string
description: Region where your Supabase project is hosted.
default: "us-east-1"
enum:
- "us-west-1"
- "us-east-1"
- "us-east-2"
- "ca-central-1"
- "eu-west-1"
- "eu-west-2"
- "eu-west-3"
- "eu-central-1"
- "eu-central-2"
- "eu-north-1"
- "ap-south-1"
- "ap-southeast-1"
- "ap-northeast-1"
- "ap-northeast-2"
- "ap-southeast-2"
- "sa-east-1"
supabaseAccessToken:
type: string
description: Your Supabase access token (required for Management API tools).
supabaseServiceRoleKey:
type: string
description: Your Supabase service role key (required for Auth Admin SDK tools).
commandFunction:
# A function that produces the CLI command to start the MCP on stdio.
|-
(config) => ({ command: 'uv', args: ['--directory', '.', 'run', 'main.py'], env: { SUPABASE_PROJECT_REF: config.supabaseProjectRef, SUPABASE_DB_PASSWORD: config.supabaseDbPassword } })
(config) => ({
command: 'supabase-mcp-server',
args: [],
env: {
SUPABASE_PROJECT_REF: config.supabaseProjectRef,
SUPABASE_DB_PASSWORD: config.supabaseDbPassword,
SUPABASE_REGION: config.supabaseRegion,
SUPABASE_ACCESS_TOKEN: config.supabaseAccessToken,
SUPABASE_SERVICE_ROLE_KEY: config.supabaseServiceRoleKey
}
})

0 comments on commit 29e3619

Please sign in to comment.