文本转SQL代理服务

一个将自然语言文本转换为SQL查询的代理服务,支持多种数据库连接和查询工具。

  • by IS2aC
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 IS2aC/texttosql-mcp-agentic

使用说明

texttosql-mcp代理

首页

功能架构

代码架构

mcp-agentic-analytics/
│
├── server/                          # MCP Server
│   ├── main.py
│   ├── session.py
│   ├── connectors/
│   │   ├── base.py
│   │   ├── postgresql.py
│   │   ├── mysql.py
│   │   └── excel_csv.py
│   └── tools/
│       ├── schema_tools.py
│       └── query_tools.py
│
├── client/
│   ├── web/                         # Client Web Flask
│   │   ├── app.py
│   │   ├── config.py
│   │   ├── core/
│   │   │   ├── __init__.py
│   │   │   ├── mcp_client.py        # execute_tool, load_mcp_tools
│   │   │   ├── agent.py             # run_agent, agentic loop
│   │   │   └── session_store.py     # USER_SESSIONS (→ Redis ready)
│   │   ├── routes/
│   │   │   ├── __init__.py
│   │   │   ├── home.py
│   │   │   ├── register.py
│   │   │   └── chat.py
│   │   ├── templates/
│   │   │   ├── home.html
│   │   │   ├── register.html
│   │   │   └── chat.html
│   │   └── static/
│   │
│   └── cli/                         # Client CLI
│       └── main.py
│
├── shared/                          # Partagé web + CLI
│   ├── __init__.py
│   ├── prompt_generator.py          # SystemPromptGenerator
│   └── prompts/                     # .txt par db_type
│       ├── postgresql.txt
│       ├── mysql.txt
│       ├── excel.txt
│       ├── csv.txt
│       └── demo.txt
│
├── logs/
├── .env
└── requirements.txt