diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f61c91a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,41 @@ +# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile +# Use a Node.js image for building and running the server +FROM node:22.12-alpine AS builder + +# Set the working directory in the container +WORKDIR /app + +# Copy package files and the lock file +COPY package.json package-lock.json ./ + +# Install dependencies +RUN npm install + +# Copy the rest of the application source code +COPY src ./src +COPY tsconfig.json ./ + +# Build the server +RUN npm run build + +# Prepare the runtime image +FROM node:22-alpine AS runtime + +# Set the working directory +WORKDIR /app + +# Copy the built files from the builder stage +COPY --from=builder /app/build /app/build +COPY package.json package-lock.json ./ + +# Install production dependencies +RUN npm ci --only=production + +# Copy the .env file to the container +COPY .env ./ + +# Define the environment variable for the Kagi API key +ENV KAGI_API_KEY=your_api_key_here + +# Specify the command to run the MCP server +CMD ["node", "build/index.js"] \ No newline at end of file diff --git a/README.md b/README.md index dbdb5ec..3f7ccaf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # kagi-server MCP Server -[![smithery badge](https://smithery.ai/badge/kagi-server)](https://smithery.ai/protocol/kagi-server) +[![smithery badge](https://smithery.ai/badge/kagi-server)](https://smithery.ai/server/kagi-server) + MCP server for Kagi API integration This is a TypeScript-based MCP server that integrates the Kagi Search API. It demonstrates core MCP concepts by providing: @@ -50,10 +51,10 @@ Make sure to add `.env` to your `.gitignore` file to keep your API key secure. ### Installing via Smithery -To install Kagi Server for Claude Desktop automatically via [Smithery](https://smithery.ai/protocol/kagi-server): +To install Kagi Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/kagi-server): ```bash -npx @smithery/cli install kagi-server --client claude +npx -y @smithery/cli install kagi-server --client claude ``` To use with Claude Desktop, add the server config: @@ -113,4 +114,4 @@ This project is licensed under the MIT License. - Implement `kagi_enrich` tool for fetching enriched news results - Improve error handling and add more robust input validation - Add more comprehensive usage examples and documentation -- Publish the package to npm for easy installation and use with Claude Desktop and npx \ No newline at end of file +- Publish the package to npm for easy installation and use with Claude Desktop and npx diff --git a/smithery.yaml b/smithery.yaml new file mode 100644 index 0000000..bdda1a8 --- /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: + - kagiApiKey + properties: + kagiApiKey: + type: string + description: The API key for the Kagi Search server. + commandFunction: + # A function that produces the CLI command to start the MCP on stdio. + |- + (config) => ({command:'node', args:['build/index.js'], env:{KAGI_API_KEY: config.kagiApiKey}}) \ No newline at end of file