diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a3387f9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile +# Dockerfile for MCP Web Search Tool +FROM node:lts-alpine AS builder + +WORKDIR /app + +# Install dependencies without running prepare/build scripts +COPY package.json package-lock.json tsconfig.json ./ +RUN npm install --ignore-scripts + +# Copy source and build +COPY . . +RUN npm run build + +# Production image +FROM node:lts-alpine +WORKDIR /app +ENV NODE_ENV=production + +# Copy built artifacts and dependencies +COPY --from=builder /app/build ./build +COPY package.json package-lock.json ./ +RUN npm install --omit=dev --ignore-scripts + +# Run the MCP server via stdio +ENTRYPOINT ["node", "build/index.js"] diff --git a/README.md b/README.md index 638ad91..06d664b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # MCP Web Search Tool +[![smithery badge](https://smithery.ai/badge/@gabrimatic/mcp-web-search-tool)](https://smithery.ai/server/@gabrimatic/mcp-web-search-tool) A powerful Model Context Protocol (MCP) server providing real-time web search capabilities through pluggable search providers. Currently integrated with the [Brave Search API](https://api-dashboard.search.brave.com/app/documentation/web-search/get-started). @@ -19,6 +20,14 @@ A powerful Model Context Protocol (MCP) server providing real-time web search ca ## 🚀 Installation +### Installing via Smithery + +To install Web Search Tool for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@gabrimatic/mcp-web-search-tool): + +```bash +npx -y @smithery/cli install @gabrimatic/mcp-web-search-tool --client claude +``` + 1. **Clone the Repository**: ```bash git clone https://github.com/gabrimatic/mcp-web-search-tool.git diff --git a/smithery.yaml b/smithery.yaml new file mode 100644 index 0000000..2502ce0 --- /dev/null +++ b/smithery.yaml @@ -0,0 +1,37 @@ +# 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: + - braveApiKey + properties: + braveApiKey: + type: string + description: Brave Search API key + maxResults: + type: number + default: 10 + description: Maximum number of search results + requestTimeout: + type: number + default: 10000 + description: Request timeout in milliseconds + commandFunction: + # A JS function that produces the CLI command based on the given config to start the MCP on stdio. + |- + (config) => ({ + command: 'node', + args: ['build/index.js'], + env: { + BRAVE_API_KEY: config.braveApiKey, + MAX_RESULTS: String(config.maxResults ?? 10), + REQUEST_TIMEOUT: String(config.requestTimeout ?? 10000) + } + }) + exampleConfig: + braveApiKey: YOUR_BRAVE_API_KEY + maxResults: 10 + requestTimeout: 10000