From edbf473cda2f14d42669470c2ef32ee055c9be59 Mon Sep 17 00:00:00 2001 From: Henry Mao <1828968+calclavia@users.noreply.github.com> Date: Sat, 15 Mar 2025 18:03:55 +0800 Subject: [PATCH 1/3] Add Dockerfile --- Dockerfile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b36bc4a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile +FROM python:3.11-slim + +# Set working directory +WORKDIR /app + +# Copy requirements from pyproject.toml and uv.lock if needed +# Install pip dependencies + +# Install system build dependencies +RUN apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libffi-dev \ + && rm -rf /var/lib/apt/lists/* + +# Copy the project files +COPY . /app + +# Install pip dependencies using pip (ignore scripts if needed) +RUN pip install --upgrade pip && pip install . + +# Expose port if needed + +# Command to run the MCP server +CMD ["python", "main.py"] From 28cce32c8c32943a9c6ee0e6e8033739d9644427 Mon Sep 17 00:00:00 2001 From: Henry Mao <1828968+calclavia@users.noreply.github.com> Date: Sat, 15 Mar 2025 18:03:56 +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..29f73e9 --- /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 + properties: + serperApiKey: + type: string + description: API key for the SERPER service + commandFunction: + # A JS function that produces the CLI command based on the given config to start the MCP on stdio. + |- + (config) => ({ command: 'python', args: ['main.py'], env: { SERPER_API_KEY: config.serperApiKey || '' } }) + exampleConfig: + serperApiKey: dummy-api-key-1234 From 71ff5bd75a37049f8a97315cd42fc7d4807c301e Mon Sep 17 00:00:00 2001 From: Henry Mao <1828968+calclavia@users.noreply.github.com> Date: Sat, 15 Mar 2025 18:03:57 +0800 Subject: [PATCH 3/3] Update README --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index e0b9b07..e18e34d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # MCP Server Example +[![smithery badge](https://smithery.ai/badge/@alejandro-ao/mcp-server-example)](https://smithery.ai/server/@alejandro-ao/mcp-server-example) This repository contains an implementation of a Model Context Protocol (MCP) server for educational purposes. This code demonstrates how to build a functional MCP server that can integrate with various LLM clients. @@ -41,6 +42,14 @@ MCP servers can provide three main types of capabilities: ## Getting Started +### Installing via Smithery + +To install MCP Server Example for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@alejandro-ao/mcp-server-example): + +```bash +npx -y @smithery/cli install @alejandro-ao/mcp-server-example --client claude +``` + ### Installing uv Package Manager On MacOS/Linux: