loading…
Search for a command to run...
loading…
Enables natural language database querying through GPT-powered SQL generation and execution with metadata-driven validation and intermediate representation.
Enables natural language database querying through GPT-powered SQL generation and execution with metadata-driven validation and intermediate representation.
mcp-sql-api/ ├── app/ │ ├── main.py # FastAPIエントリポイント │ ├── api/ # エンドポイント層 │ │ ├── sql.py # 生SQL実行(step1) │ │ ├── query.py # クエリ実行API(step3) │ │ └── agent.py # GPT連携(step2) │ │ │ ├── core/ # コアロジック │ │ ├── db.py # DB接続(PostgreSQL) │ │ └── security.py # SQL制御(SELECT制限など) │ │ │ ├── services/ # ビジネスロジック │ │ ├── sql_executor.py # SQL実行エンジン │ │ ├── query_service.py # テンプレクエリ実行 │ │ ├── llm_service.py # GPTでSQL生成 │ │ └── ir_service.py # 中間表現 → SQL変換(step4) │ │ │ ├── models/ # データモデル │ │ ├── schema.py # DBスキーマ定義 │ │ ├── query.py # クエリ定義(意味付き) │ │ └── ir.py # 中間表現(超重要) │ │ │ ├── repositories/ # DBアクセス層 │ │ └── base.py │ │ │ └── utils/ │ ├── logger.py │ └── validator.py │ ├── metadata/ # ← MCPの核 │ ├── schema.yaml # テーブル定義(LLM用) │ ├── metrics.yaml # KPI定義 │ └── queries.yaml # 意味のあるAPI定義 │ ├── prompts/ # GPT用プロンプト │ ├── sql_generation.txt │ └── ir_generation.txt │ ├── tests/ │ ├── test_sql.py │ ├── test_query.py │ └── test_ir.py │ ├── requirements.txt └── README.md
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"mcp-sql-api": {
"command": "npx",
"args": []
}
}
}