From 5cf3bc23d397e75dac9aa3453fca97301fa38680 Mon Sep 17 00:00:00 2001 From: Henry Mao <1828968+calclavia@users.noreply.github.com> Date: Wed, 12 Feb 2025 13:01:36 +0800 Subject: [PATCH 1/3] Add Dockerfile --- Dockerfile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4fa980f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile +# Use a Python image with uv pre-installed +FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS uv + +# Set the working directory +WORKDIR /app + +# Enable bytecode compilation +ENV UV_COMPILE_BYTECODE=1 + +# Copy the pyproject.toml file first for caching layer +COPY pyproject.toml /app/pyproject.toml + +# Install the project's dependencies +RUN --mount=type=cache,target=/root/.cache/uv \ + --mount=type=bind,source=pyproject.toml,target=pyproject.toml \ + uv sync --frozen --no-install-project --no-dev --no-editable + +# Then, add the rest of the project source code and install it +# Installing separately from its dependencies allows optimal layer caching +ADD . /app +RUN --mount=type=cache,target=/root/.cache/uv \ + uv sync --frozen --no-dev --no-editable + +# Set the environment variable for the API key +ENV SEARCH_API_KEY=your_api_key_here + +# Default command to run the server +CMD ["uv", "--directory", "/app/src", "run", "search.server"] From f24b8acc84b16873ab2acdc8485518b9dafe8050 Mon Sep 17 00:00:00 2001 From: Henry Mao <1828968+calclavia@users.noreply.github.com> Date: Wed, 12 Feb 2025 13:01:37 +0800 Subject: [PATCH 2/3] Add Smithery configuration --- smithery.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 smithery.yaml diff --git a/smithery.yaml b/smithery.yaml new file mode 100644 index 0000000..82e6cd4 --- /dev/null +++ b/smithery.yaml @@ -0,0 +1,17 @@ +# 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: + - searchApiKey + properties: + searchApiKey: + type: string + description: The API key for the Brave Search server. + commandFunction: + # A function that produces the CLI command to start the MCP on stdio. + |- + (config) => ({command:'uv', args:['--directory', '/app/src', 'run', 'search.server'], env:{SEARCH_API_KEY:config.searchApiKey}}) From b1a99f015d9c1da6717e81e2c5d74d2b7c269896 Mon Sep 17 00:00:00 2001 From: Henry Mao <1828968+calclavia@users.noreply.github.com> Date: Wed, 12 Feb 2025 13:01:38 +0800 Subject: [PATCH 3/3] Update README --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index b0a7e51..5d64b64 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Search MCP Server +[![smithery badge](https://smithery.ai/badge/@fengin/search-server)](https://smithery.ai/server/@fengin/search-server) ![image](./images/logo.png) 一个基于MCP协议的搜索服务实现,提供网络搜索和本地搜索功能,Cursor和Claude Desktop能与之无缝集成。 @@ -64,8 +65,6 @@ pip install ``` -## 配置说明 - ### 下载源码 ```bash