Test and prototype in the cloud by launching the MCP server agent and chatbot ad-hoc into any Meshagent Room. Tools and chatbots are removed automatically when the Room closes. Environment Variables Required:
  • ES_URL: Endpoint for your Elasticsearch instance (e.g., http://localhost:9200)
  • ES_API_KEY: Your Elasticsearch API key (e.g., your-api-key)
Steps:
  1. Install Meshagent CLI:
    pip install "meshagent[all]"
    
  2. Sign Up & Authenticate:
  3. Start MCP Server Agent in a Room:
    meshagent service test --room=test --role=agent --image=meshagent/mcp-elasticsearch:latest \
    --env MESHAGENT_PORT=8001 --env ES_URL=http://localhost:9200 --env ES_API_KEY=your-api-key \
    --port="num=8001 path=/webhook liveness=/ type=meshagent.callable" --name=mcp-elasticsearch-service-test
    
    • This starts a Meshagent Room with MCP server tools available. Rooms are temporary and close if inactive.
  4. Launch a Chatbot with Elasticsearch Toolkit:
    meshagent chatbot join --room=test --agent-name=mcp-elasticsearch --name=mcp-elasticsearch --toolkit=mcp-elasticsearch
    
    • This creates a chatbot in the Room that can access all MCP Elasticsearch tools.
    • Room join link is provided in the command output.
  5. Try It Out:
    • Open the Room link in your browser and chat to interact with Elasticsearch using the agent’s tools.

Project Level Deployment (Persistent Tools & Bot)

For production, register agents and chatbots at the project level. This ensures tools and the chatbot automatically join every Room in the project—no need for local or manual processes.
  1. Register MCP Server as Persistent Project Service:
    meshagent service create --role=agent --image=meshagent/mcp-elasticsearch:latest \
    --env MESHAGENT_PORT=8001 --env ES_URL=http://localhost:9200 --env ES_API_KEY=your-api-key \
    --port="num=8001 path=/webhook liveness=/ type=meshagent.callable" --name=mcp-elasticsearch-service
    
  2. Register Persistent Chatbot for Project:
    meshagent service create --image="meshagent/cli:latest" \
    --port="num=9001 path=/agent liveness=/ type=meshagent.callable participant_name=mcp-elasticsearch-chatbot" \
    --env="MESHAGENT_PORT=9001" --name="mcp-elasticsearch-chatbot-service" \
    --command="meshagent chatbot service --agent-name=mcp-elasticsearch-chatbot --toolkit=mcp-elasticsearch"
    

Tools Available

Interact with your Elasticsearch indices through natural language conversations.

Summary

Tools provided by this ServerShort Description
get_mappingsGet field mappings for a specific Elasticsearch index
get_shardsGet shard information for all or specific indices
list_indicesList all available Elasticsearch indices
searchPerform an Elasticsearch search with the provided query DSL.

Tools Details

Tool: get_mappings

Get field mappings for a specific Elasticsearch index.
ParameterTypeDescription
indexstringName of the Elasticsearch index to get mappings for

Tool: get_shards

Get shard information for all or specific indices.
ParameterTypeDescription
indexstringoptional Optional index name to get shard information for

Tool: list_indices

List all available Elasticsearch indices.
ParameterTypeDescription
indexPatternstringIndex pattern of Elasticsearch indices to list
Perform an Elasticsearch search with the provided query DSL. Highlights are always enabled.
ParameterTypeDescription
indexstringName of the Elasticsearch index to search
queryBodyobjectComplete Elasticsearch query DSL object (can include query, size, from, sort, etc.)

Additional Resources

For more information about the Model Context Protocol (MCP): What is an MCP Server? Looking for insights on running MCP servers safely? Why is it safer to run MCP Servers with Docker?