Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment: Dockerfile and Smithery config #4

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use the official Node.js image as a base
FROM node:18-alpine AS builder

# Set working directory
WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json package-lock.json ./

# Install dependencies
RUN npm install --ignore-scripts

# Copy the source code and tsconfig.json
COPY src ./src
COPY tsconfig.json ./

# Build the project
RUN npm run build

# Use a smaller image for the final release
FROM node:18-alpine AS release

# Set working directory
WORKDIR /app

# Copy the build output from the builder stage
COPY --from=builder /app/build ./build

# Copy the package.json and package-lock.json
COPY --from=builder /app/package.json /app/package-lock.json ./

# Set the API key as an environment variable
ENV SEARCH1API_KEY=YOUR_SEARCH1API_KEY

# Install only production dependencies
RUN npm ci --omit=dev

# Define the command to run the application
ENTRYPOINT ["node", "build/index.js"]
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Search1API MCP Server

[![smithery badge](https://smithery.ai/badge/search1api-mcp)](https://smithery.ai/server/search1api-mcp)

A Model Context Protocol (MCP) server that provides search and crawl functionality using Search1API.

https://github.com/user-attachments/assets/58bc98ae-3b6b-442c-a7fc-010508b5f028
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:
- search1ApiKey
properties:
search1ApiKey:
type: string
description: The API key for accessing the Search1API service.
commandFunction:
# A function that produces the CLI command to start the MCP on stdio.
|-
(config) => ({ command: 'node', args: ['build/index.js'], env: { SEARCH1API_KEY: config.search1ApiKey } })