Skip to content

Commit 36310af

Browse files
authored
Add Claude Desktop screenshots (#47)
1 parent 0151f16 commit 36310af

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

_posts/2025-05-18-elasticsearch-mcp.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ img_excerpt:
1111

1212
Large Language Models (LLMs) are getting better every day at understanding all sorts of data, but they still suffer from knowledge cut-off when dealing with data that were not part of their pre-training. By integrating LLMs with external systems and knowledge bases, LLMs could achieve their true potential as they allow users to query and analyze complex data with natural conversations. [Model Context Protol (MCP)](https://modelcontextprotocol.io/) is one way of enable LLMs and AI assistants like Claude Desktop to perform actions, query data, and leverage the capabilities of other applications.
1313

14-
In this blog post, we explore how to implement in Python using the `fastmcp` library an MCP server for Elasticsearch that enables Claude Desktop (or any AI Agent) to directly query and analyze data from an Elasticsearch cluster. We'll then see how to configure Claude Desktop to use this server.
14+
In this blog post, we explore how to implement in Python using the `fastmcp` library an MCP server for Elasticsearch that enables Claude Desktop (or any AI Agent) to directly query and analyze data from an Elasticsearch cluster. We'll then see how to configure Claude Desktop to use this server. Full source code can be found at [GitHub](https://github.com/dzlab/snippets/tree/master/elasticsearch_mcp).
1515

1616
## What is MCP?
1717

@@ -89,7 +89,7 @@ ES_PASSWORD=your_password
8989
ES_CA_CERT=/path/to/http_ca.crt # Optional, for HTTPS verification
9090
```
9191

92-
Next, in our python code we laod environment variables from `.env` and then create an Elasticsearch client instance with one of the following authentication methods:
92+
Next, in our python code we load environment variables from `.env` and then create an Elasticsearch client instance with one of the following authentication methods:
9393
1. API key authentication
9494
2. Username/password authentication
9595
3. No authentication for local development
@@ -226,12 +226,21 @@ This configuration tells Claude Desktop how to launch the Elasticsearch MCP serv
226226
2. It specifies the working directory where the server code is located
227227
3. It runs the `server.py` script
228228

229+
After editing the config file, restart Claude Desktop app and check that the new MCP server connected was connected successfully as illustrated in the following screenshot:
230+
231+
![MCP server connected]({{ "/assets/2025/05/20250518-claude-mcp-server-connected.png" | absolute_url }}){: .center-image }
232+
233+
If case of connection issues, you can check the logs of the MCP server
234+
235+
```shell
236+
tail -n 20 -f ~/Library/Logs/Claude/mcp-server-ElasticsearchServer.log
237+
```
229238

230239
### Using the Elasticsearch MCP Server with Claude
231240

232241
With our MCP server implemented and Claude Desktop configured, we can now interact with our Elasticsearch cluster directly from Claude. For this, simply launch Claude Desktop and start a new conversation, that's it.
233242

234-
We ask Claude questions about our Elasticsearch cluster and it will use the `list_indices`, `get_mappings`, or `search` tools accordingly to fulfill the requests.
243+
We can ask Claude questions about our Elasticsearch cluster and it will use the `list_indices`, `get_mappings`, or `search` tools accordingly to fulfill the requests.
235244

236245
Here are few questions and answers:
237246

@@ -277,6 +286,10 @@ This appears to be an index storing Hacker News posts along with their associate
277286
Would you like me to show you how to query this data in a specific way?
278287
```
279288

289+
> Notes: Claude Desktop will ask confirmation before using external tools as illustrated below
290+
291+
![Claude confirmation dialog for using external tools]({{ "/assets/2025/05/20250518-claude-confirmation.png" | absolute_url }}){: .center-image }
292+
280293

281294
## Conclusion
282295

42.2 KB
Loading
Loading

0 commit comments

Comments
 (0)