diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3458dea --- /dev/null +++ b/Dockerfile @@ -0,0 +1,41 @@ +# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile +# Use the Python 3.10 image with UV pre-installed +FROM ghcr.io/astral-sh/uv:python3.10-slim AS uv + +# Install the project into /app +WORKDIR /app + +# Enable bytecode compilation +ENV UV_COMPILE_BYTECODE=1 + +# Copy the required files for building the environment +COPY pyproject.toml /app +COPY uv.lock /app + +# Sync dependencies and update the lockfile +RUN --mount=type=cache,target=/root/.cache/uv \ + uv sync --frozen --no-install-project --no-dev --no-editable + +# Add the rest of the project source code and install it +ADD src /app/src + +RUN --mount=type=cache,target=/root/.cache/uv \ + uv sync --frozen --no-dev --no-editable + +# Use a lighter image for production +FROM python:3.10-slim + +WORKDIR /app + +COPY --from=uv /root/.local /root/.local +COPY --from=uv --chown=app:app /app/.venv /app/.venv + +# Place executables in the environment at the front of the path +ENV PATH="/app/.venv/bin:$PATH" + +# Define environment variables +ENV TB_API_URL= +ENV TB_ADMIN_TOKEN= + +# Run the MCP server +ENTRYPOINT ["mcp-tinybird", "stdio"] diff --git a/README.md b/README.md index 25e57f7..0f8fb08 100644 --- a/README.md +++ b/README.md @@ -27,10 +27,10 @@ It supports both SSE and STDIO modes. **Smithery** -To install Tinybird MCP for Claude Desktop automatically via [Smithery](https://smithery.ai/protocol/mcp-tinybird): +To install Tinybird MCP for Claude Desktop automatically via [Smithery](https://smithery.ai/server/mcp-tinybird): ```bash -npx @smithery/cli install @tinybirdco/mcp-tinybird --client claude +npx -y @smithery/cli install @tinybirdco/mcp-tinybird --client claude ``` **mcp-get** diff --git a/smithery.yaml b/smithery.yaml new file mode 100644 index 0000000..fb4033f --- /dev/null +++ b/smithery.yaml @@ -0,0 +1,21 @@ +# Smithery configuration file: https://smithery.ai/docs/config#smitheryyaml + +startCommand: + type: stdio + configSchema: + # JSON Schema defining the configuration options for the MCP. + type: object + required: + - tbApiUrl + - tbAdminToken + properties: + tbApiUrl: + type: string + description: The URL for the Tinybird API. + tbAdminToken: + type: string + description: The admin token for Tinybird. + commandFunction: + # A function that produces the CLI command to start the MCP on stdio. + |- + (config) => ({command:'uvx',args:['mcp-tinybird','stdio'],env:{TB_API_URL:config.tbApiUrl,TB_ADMIN_TOKEN:config.tbAdminToken}})