mcp-sql-api
Allows interaction with a PostgreSQL database, enabling SQL queries and data retrieval through an MCP interface.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-sql-apishow me the top 5 customers by revenue"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
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