Skip to content

Deployment: Dockerfile and Smithery config #31

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

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
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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).

Expand Down Expand Up @@ -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]
Expand Down
41 changes: 41 additions & 0 deletions smithery.yaml
Original file line number Diff line number Diff line change
@@ -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