Choosing Between elastic/mcp-server-elasticsearch and Elasticsearch API for Natural Language Querying in ASP.NET Core

Hey @NavaneethaKannan ,

In your specific use case, the Elasticsearch MCP server doesn’t provide any clear advantages especially if your target is efficiency with the additional token overhead and extra execution steps.

You can potentially tweak the system prompt to include the mappings since it won’t change and try to prevent it from calling that tool but again, you will still incur additional token costs.

Since LLM outputs are non-deterministic and can change with different models, you’d want to implement some deterministic guardrails like validating the generated DSL against a schema especially if this is going to be used in production environments.

I would stick to the alternative choice of using the Elasticsearch API directly since you’re only targeting a single index with static mappings. This will give you a lot more control over your token usage, mapping context and your outputs.

Hope this helps!