Skip to content

Commit

Permalink
Merge pull request #1 from smithery-ai/smithery/config-puw2
Browse files Browse the repository at this point in the history
Deployment: Dockerfile and Smithery config
  • Loading branch information
fengin authored Feb 12, 2025
2 parents 3164354 + b1a99f0 commit 7d4def6
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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能与之无缝集成。
Expand Down Expand Up @@ -64,8 +65,6 @@
pip install
```

## 配置说明

### 下载源码

```bash
Expand Down
17 changes: 17 additions & 0 deletions smithery.yaml
Original file line number Diff line number Diff line change
@@ -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}})

0 comments on commit 7d4def6

Please sign in to comment.