diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a3f2a41 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile +FROM node:lts-alpine + +# Set working directory +WORKDIR /app + +# Copy package.json and package-lock.json if available +COPY package.json yarn.lock ./ + +# Install dependencies +RUN yarn install --frozen-lockfile --ignore-scripts + +# Copy rest of project +COPY . . + +# Build project +RUN yarn build + +# Expose any ports if necessary (not strictly required for MCP over stdio) + +# Start the MCP server +CMD [ "node", "dist/index.js" ] diff --git a/README.md b/README.md index c9c00c8..32a3aaf 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Elasticsearch MCP Server +[![smithery badge](https://smithery.ai/badge/@elastic/mcp-server-elasticsearch)](https://smithery.ai/server/@elastic/mcp-server-elasticsearch) Connect to your Elasticsearch data directly from any MCP Client (like Claude Desktop) using the Model Context Protocol (MCP). @@ -27,6 +28,14 @@ https://github.com/user-attachments/assets/5dd292e1-a728-4ca7-8f01-1380d1bebe0c ## Installation & Setup +### Installing via Smithery + +To install Elasticsearch MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@elastic/mcp-server-elasticsearch): + +```bash +npx -y @smithery/cli install @elastic/mcp-server-elasticsearch --client claude +``` + ### Using the Published NPM Package > [!TIP] diff --git a/smithery.yaml b/smithery.yaml new file mode 100644 index 0000000..bcb94bb --- /dev/null +++ b/smithery.yaml @@ -0,0 +1,41 @@ +# 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: + - esUrl + properties: + esUrl: + type: string + description: Elasticsearch instance URL + esApiKey: + type: string + description: Elasticsearch API key for authentication (optional if using + username/password) + esUsername: + type: string + description: Elasticsearch username for basic authentication (optional) + esPassword: + type: string + description: Elasticsearch password for basic authentication (optional) + esCaCert: + type: string + description: Path to a custom CA certificate if needed (optional) + commandFunction: + # A JS function that produces the CLI command based on the given config to start the MCP on stdio. + |- + (config) => ({ + command: 'node', + args: ['dist/index.js'], + env: Object.assign({ + ES_URL: config.esUrl + }, config.esApiKey ? { ES_API_KEY: config.esApiKey } : {}, + config.esUsername && config.esPassword ? { ES_USERNAME: config.esUsername, ES_PASSWORD: config.esPassword } : {}, + config.esCaCert ? { ES_CA_CERT: config.esCaCert } : {}) + }) + exampleConfig: + esUrl: http://localhost:9200 + esApiKey: your-elasticsearch-api-key