{"id":28606180,"url":"https://github.com/capelabs/opensearch-mcp-server","last_synced_at":"2026-03-04T15:32:14.198Z","repository":{"id":295730965,"uuid":"989142986","full_name":"capelabs/opensearch-mcp-server","owner":"capelabs","description":"OpenSearch 3.0 with MCP Server","archived":false,"fork":false,"pushed_at":"2025-05-27T05:37:50.000Z","size":1052,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-23T07:08:46.892Z","etag":null,"topics":["docker","llm","mcp","mcp-server","opensearch"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/capelabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-23T16:13:25.000Z","updated_at":"2025-06-12T09:14:31.000Z","dependencies_parsed_at":"2025-05-27T05:32:30.089Z","dependency_job_id":null,"html_url":"https://github.com/capelabs/opensearch-mcp-server","commit_stats":null,"previous_names":["capelabs/opensearch-mcp-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/capelabs/opensearch-mcp-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capelabs%2Fopensearch-mcp-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capelabs%2Fopensearch-mcp-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capelabs%2Fopensearch-mcp-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capelabs%2Fopensearch-mcp-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/capelabs","download_url":"https://codeload.github.com/capelabs/opensearch-mcp-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capelabs%2Fopensearch-mcp-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30084969,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T13:22:36.021Z","status":"ssl_error","status_checked_at":"2026-03-04T13:20:45.750Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","llm","mcp","mcp-server","opensearch"],"created_at":"2025-06-11T19:39:28.202Z","updated_at":"2026-03-04T15:32:14.190Z","avatar_url":"https://github.com/capelabs.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenSearch MCP Server\n\nA Model Context Protocol (MCP) server for OpenSearch that provides seamless integration between LangChain agents and OpenSearch, enabling natural language search and data analysis capabilities.\n\n## 1. Getting Started\n\nOpenSearch MCP Server provides the following key features:\n\n- **Natural Language Search**: Perform OpenSearch queries using natural language through GPT models\n- **Index Management**: List indices, view mapping information, and manage data structures\n- **Real-time Search**: Convert complex search queries from natural language to OpenSearch queries\n- **Docker-based Deployment**: Easy installation and execution through docker-compose\n\n### Prerequisites\n\n- Docker and Docker Compose\n- Python 3.10+ (for running the agent)\n- OpenAI API key (for GPT model usage)\n\n## 2. Architecture\n\n```\nOpenSearch MCP Server\n├── opensearch/              # OpenSearch configuration files\n│   └── opensearch.yml       # OpenSearch configuration\n├── scripts/                 # Initialization scripts\n│   └── enable-mcp-server.sh # MCP server activation script\n├── agents/                  # LangChain agents\n│   ├── agent.py            # Main agent script\n│   ├── requirements.txt    # Python dependencies\n│   └── .env               # Environment variables\n├── img/                    # Documentation images\n│   └── screenshot.png      # Example screenshot\n├── docker-compose.yml      # Docker Compose configuration\n└── Dockerfile             # Custom OpenSearch image\n```\n\n### Service Components\n\n- **OpenSearch**: Search engine (port 9200)\n- **OpenSearch Dashboards**: Web UI (port 5601)\n- **MCP Server**: Bridge between OpenSearch and LangChain\n- **LangChain Agent**: Natural language processing agent\n\n## 3. Installation\n\n### Docker Environment Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/capelabs/opensearch-mcp-server.git\ncd opensearch-mcp-server\n\n# Start services with Docker Compose\ndocker-compose up -d\n```\n\n### Python Agent Environment Setup\n\n```bash\ncd agents\n\n# Create and activate virtual environment (recommended)\npython -m venv venv\nsource venv/bin/activate  # Linux/Mac\n# or venv\\Scripts\\activate  # Windows\n\n# Install dependencies\npip install -r requirements.txt\n```\n\n### Environment Variables Configuration\n\nSet your OpenAI API key in the `agents/.env` file:\n\n```env\nOPENAI_API_KEY=your_openai_api_key_here\n```\n\n## 4. Usage\n\n### 1. Starting Services\n\n```bash\n# Start all services with Docker Compose\ndocker-compose up -d\n\n# Check service status\ndocker ps\n```\n\n### 2. Verify MCP Server Status\n\nAfter OpenSearch is fully started, the MCP server will be automatically activated. You can verify this with the following commands:\n\n```bash\n# Check OpenSearch cluster settings\ncurl -X GET \"localhost:9200/_cluster/settings?pretty\"\n```\n\n### 3. Accessing OpenSearch Dashboards \u0026 Add Sample Data\n\nOpen a web browser and navigate to `http://localhost:5601` to open the OpenSearch dashboard and add sample data.\nYou can add any sample data you like, In this case `Sample flight data` in this README.\n\n![Add Data Screenshot](img/add_sample_data.png)\n\n### 4. Running the LangChain Agent\n\n```bash\ncd agents\npython agent.py\n```\n\n### 5. Natural Language Search\n\nOnce the agent is running, you can ask questions in natural language:\n\n```\nInput: Show me all indices\nInput: What's the mapping for the user index?\nInput: Find users where name is \"john\"\nInput: Search for logs from the last 24 hours\n```\n\n![OpenSearch MCP Server Screenshot](img/screenshot.png)\n\n### Available MCP Tools\n\n1. **ListIndexTool**: Retrieve list of all indices\n2. **IndexMappingTool**: Get mapping information for specific indices\n3. **SearchIndexTool**: Execute complex search queries\n\n## 5. Contributing\n\nWe welcome contributions to the project! Please follow these steps:\n\n### Development Environment Setup\n\n```bash\n# Fork and clone the repository\ngit clone https://github.com/your-username/opensearch-mcp-server.git\ncd opensearch-mcp-server\n\n# Create a development branch\ngit checkout -b feature/your-feature-name\n```\n\n### Code Style Guidelines\n\n- Python code should follow PEP 8 style guidelines\n- Docker-related files should include clear comments\n- New features should be submitted with appropriate test code\n\n### Pull Request Process\n\n1. Write clear commit messages describing your changes\n2. Update documentation for new features\n3. Ensure all tests pass\n4. Create a Pull Request and request review\n\n### Issue Reporting\n\nPlease submit bugs or feature requests through GitHub Issues. Include the following information:\n\n- Clear description of the issue\n- Steps to reproduce\n- Expected vs actual results\n- Environment information (OS, Docker version, etc.)\n\n## 6. Additional Information\n\n### License\n\nThis project is distributed under the MIT License.\n\n### Troubleshooting\n\n#### OpenSearch Connection Failed\n\n```bash\n# Check OpenSearch container logs\ndocker-compose logs opensearch\n\n# Check for port conflicts\nnetstat -tulpn | grep :9200\n```\n\n#### MCP Server Activation Failed\n\n```bash\n# Restart MCP activation script\ndocker-compose restart enable_mcp_server\n```\n\n#### Python Agent Errors\n\n```bash\n# Reinstall dependencies\npip install --upgrade -r requirements.txt\n\n# Verify OpenAI API key\necho $OPENAI_API_KEY\n```\n\n### Performance Optimization\n\n- For large datasets, adjust JVM heap memory size in `opensearch.yml`\n- Enable security plugins for production environments\n- Optimize index shard and replica settings\n\n### Additional Resources\n\n- [OpenSearch Official Documentation](https://opensearch.org/docs/)\n- [LangChain MCP Adapters](https://github.com/langchain-ai/langchain-mcp-adapters)\n- [Model Context Protocol Specification](https://modelcontextprotocol.io/)\n\n### Contact\n\nFor questions or suggestions, please reach out through GitHub Issues.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapelabs%2Fopensearch-mcp-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapelabs%2Fopensearch-mcp-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapelabs%2Fopensearch-mcp-server/lists"}