{"id":29024656,"url":"https://github.com/luoluoter/dify-mongodb-tools","last_synced_at":"2026-04-22T21:36:13.063Z","repository":{"id":301126118,"uuid":"1008220467","full_name":"luoluoter/dify-mongodb-tools","owner":"luoluoter","description":"一个用于与MongoDB交互的python应用，提供较为灵活的数据写入和查询功能，支持Dify工具集集成","archived":false,"fork":false,"pushed_at":"2025-06-25T08:42:46.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-25T09:40:08.272Z","etag":null,"topics":["dify","mongodb","tools"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luoluoter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-06-25T08:00:26.000Z","updated_at":"2025-06-25T08:42:49.000Z","dependencies_parsed_at":"2025-06-25T09:50:28.033Z","dependency_job_id":null,"html_url":"https://github.com/luoluoter/dify-mongodb-tools","commit_stats":null,"previous_names":["luoluoter/dify-mongodb-tools"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/luoluoter/dify-mongodb-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoluoter%2Fdify-mongodb-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoluoter%2Fdify-mongodb-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoluoter%2Fdify-mongodb-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoluoter%2Fdify-mongodb-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luoluoter","download_url":"https://codeload.github.com/luoluoter/dify-mongodb-tools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoluoter%2Fdify-mongodb-tools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32156604,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T17:06:48.269Z","status":"ssl_error","status_checked_at":"2026-04-22T17:06:19.037Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["dify","mongodb","tools"],"created_at":"2025-06-26T04:18:33.597Z","updated_at":"2026-04-22T21:36:12.956Z","avatar_url":"https://github.com/luoluoter.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dify MongoDB Tools\n\n一个用于与MongoDB交互的Flask应用，提供数据写入和查询功能，支持Dify工具集集成。\n\n## ✨ 功能特性\n\n- 🔄 **数据保存**: 支持任意结构数据的写入和更新\n- 📊 **灵活查询**: 支持复杂查询条件、排序和分页\n- 🗄️ **多数据库支持**: 完全动态的数据库和集合操作\n- 🔍 **健康检查**: 提供应用和数据库连接状态监控\n- 🛡️ **错误处理**: 完善的错误处理和日志记录\n\n## 🚀 快速开始\n\n### 环境要求\n\n- Docker 20.0+\n- MongoDB 4.0+\n\n### 推荐部署方式 (Docker)\n\n```bash\n# 克隆项目\ngit clone https://github.com/luoluoter/dify-mongodb-tools.git\ncd dify-mongodb-tools\n\n# 使用Docker一键部署\nbash start.sh --docker\n\n# 指定端口部署（避免端口冲突）\nPORT=3388 bash start.sh --docker  # 使用8080端口\n```\n\n### 其他部署方式\n\n- [📖 手动安装指南](docs/installation.md) - Python环境安装和配置\n- [🐳 Docker详细部署](docs/docker.md) - Docker部署详细说明\n- [🔧 开发环境设置](docs/development.md) - 开发环境配置\n\n## 📖 使用示例\n\n\u003e **注意**：下面示例中需要用实际部署的IP和端口\n\n### 保存数据\n\n```bash\ncurl -X POST http://localhost:3333/api/save \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"db_name\": \"my_db\",\n    \"collection_name\": \"my_collection\",\n    \"title\": \"测试数据\",\n    \"content\": \"{\\\"name\\\": \\\"张三\\\", \\\"age\\\": 25}\"\n  }'\n```\n\n### 查询数据\n\n```bash\ncurl \"http://localhost:3333/api/search?db_name=my_db\u0026collection_name=my_collection\u0026conditions=%7B%7D\u0026limit=10\"\n```\n\n### 健康检查\n\n```bash\ncurl http://localhost:3333/api/health\n```\n\n## 📚 文档\n\n- [📖 安装指南](docs/installation.md) - 详细的安装和配置说明\n- [🔧 API文档](docs/api.md) - 完整的API接口文档\n- [💻 开发指南](docs/development.md) - 开发环境设置和贡献指南\n\n## 🛠️ 开发工具\n\n```bash\n# 使用启动脚本\nbash start.sh --docker   # Docker一键部署 (推荐)\nbash start.sh --install  # 安装依赖\nbash start.sh --dev      # 开发模式运行\nbash start.sh --prod     # 生产模式运行\n```\n\n## 🔧 Dify集成\n\n### schema.json 文件\n\n项目根目录下的 `schema.json` 文件是用于 **Dify 创建自定义工具时导入的 OpenAPI 规范文件**。\n\n#### 使用方法\n\n1. **在Dify中创建自定义工具**：\n   - 登录Dify管理后台\n   - 进入\"工具\" → \"自定义工具\"\n   - 点击\"创建工具\"\n\n2. **导入API规范**：\n   - 选择\"导入OpenAPI规范\"\n   - 上传或粘贴 `schema.json` 文件内容\n   - Dify会自动解析API接口并生成工具配置\n\n3. **配置工具参数**：\n   - 根据实际需求调整数据库连接信息\n   - 配置必要的认证信息\n   - 测试工具连接\n\n#### 支持的API接口\n\n- **POST /api/save** - 保存数据到指定数据库和集合\n- **GET /api/search** - 搜索数据，支持复杂查询条件\n- **GET /api/health** - 健康检查\n\n#### 注意事项\n\n- 确保Dify能够访问到MongoDB Tools服务\n- 根据实际部署环境修改schema.json中的服务器URL\n- **端口配置**：如果使用了自定义端口（如8080、9000等），需要在schema.json中更新对应的URL\n- 建议在生产环境中配置适当的认证机制\n\n## 📋 API端点\n\n| 方法 | 端点 | 描述 |\n|------|------|------|\n| POST | `/api/save` | 保存数据到指定数据库和集合 |\n| GET | `/api/search` | 搜索数据，支持复杂查询 |\n| GET | `/api/health` | 健康检查 |\n\n## 🤝 贡献\n\n欢迎贡献代码！请查看 [开发指南](docs/development.md) 了解详情。\n\n## 📄 许可证\n\n本项目采用MIT许可证 - 查看 [LICENSE](LICENSE) 文件了解详情。\n\n## 🆘 支持\n\n- 📖 [文档](docs/)\n- 🐛 [Issues](https://github.com/luoluoter/dify-mongodb-tools/issues)\n- 💬 联系维护者\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluoluoter%2Fdify-mongodb-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluoluoter%2Fdify-mongodb-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluoluoter%2Fdify-mongodb-tools/lists"}