mcp-sql-api
mcp-sql-api/ ├── app/ │ ├── main.py # FastAPI 入口点 │ ├── api/ # 端点层 │ │ ├── sql.py # 原生 SQL 执行(步骤 1) │ │ ├── query.py # 查询执行 API(步骤 3) │ │ └── agent.py # GPT 集成(步骤 2) │ │ │ ├── core/ # 核心逻辑 │ │ ├── db.py # 数据库连接(PostgreSQL) │ │ └── security.py # SQL 控制(SELECT 限制等) │ │ │ ├── services/ # 业务逻辑 │ │ ├── sql_executor.py # SQL 执行引擎 │ │ ├── query_service.py # 模板查询执行 │ │ ├── llm_service.py # 使用 GPT 生成 SQL │ │ └── ir_service.py # 中间表示 → SQL 转换(步骤 4) │ │ │ ├── models/ # 数据模型 │ │ ├── schema.py # 数据库模式定义 │ │ ├── query.py # 查询定义(带语义) │ │ └── ir.py # 中间表示(至关重要) │ │ │ ├── repositories/ # 数据库访问层 │ │ └── 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
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/o-kunimatsu/sql_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server