VAST 数据库 MCP 服务器实现了一系列数据库资源管理和操作功能,可通过 HTTP 请求对数据库架构、表进行查询和操作,还提供了交互式 SQL 执行工具。同时,文档介绍了与 AI 代理框架交互的注意事项、下一步计划、运行说明以及使用的注意事项。
uvicorn fastapi_mcp.main:app --reload
curl http://localhost:8000/schemas
curl http://localhost:8000/schemas/my_schema/tables
curl http://localhost:8000/schemas/my_schema/tables/my_table
curl http://localhost:8000/schemas/my_schema/tables/my_table/data
curl -X POST "http://localhost:8000/_api" \
-H "Content-Type: application/json" \
-d '{"name": "vast_sql_query", "params": {"sql": "SELECT * FROM my_table LIMIT 5", "format": "json"}}'
/schemas/schemas/{schema_name}/tablesname:表的名称type:表的类型(如:BASE TABLE)schema:表所属的架构名/schemas/{schema_name}/tables/{table_name}name:表名称type:表类型schema:架构名columns:列信息数组,每个列对象包含:
name:列名type:数据类型nullable:是否允许为空default_value:默认值(如果存在)/schemas/{schema_name}/tables/{table_name}/datavast_sql_querysql:需要执行的 SQL 查询字符串format:输出格式,可选值为 json 或 csv⚠️ 重要提示
绝对不要在发送给 LLM 的提示中包含 VAST 数据库凭证。
资源请求:
headers 字典:{'X-Vast-Access-Key': '...', 'X-Vast-Secret-Key': '...'}。vast:// URI 映射到实际运行中的 MCP 服务器 HTTP URL(例如 http://localhost:8088/)。工具使用:
vast_sql_query 工具并提供 sql 和 format 参数时,由 orchestrator 负责:
sql 和 format 参数用于工具调用。text/plain, application/json, text/csv)。文档未提及相关许可证信息。
⚠️ 重要提示
- 所有 API 请求均需包含认证 headers。
- 敏感操作需进行适当的权限控制与日志记录。