turbot
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"steampipe": {
"args": [
"-y",
"@turbot/steampipe-mcp",
"postgresql://my_name:my_pw@workspace-name.usea1.db.pipes.turbot.com:9193/abc123"
],
"command": "npx"
}
}
}
可用工具 (5 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
steampipe_query
Query cloud infrastructure, SaaS, APIs, code and more with SQL. Queries are read-only and must use PostgreSQL syntax. For best performance: limit columns requested, use materialized CTEs instead of joins. Trust the search path unless sure you need to specify a schema. Check available tables and columns before querying using steampipe_table_list and steampipe_table_show.
该工具无需必填参数,直接调用即可
steampipe_table_list
List all available Steampipe tables. Use schema and filter parameters to narrow down results.
该工具无需必填参数,直接调用即可
steampipe_table_show
Get detailed information about a specific Steampipe table, including column definitions, data types, and descriptions.
该工具无需必填参数,直接调用即可
steampipe_plugin_list
List all Steampipe plugins installed on the system. Plugins provide access to different data sources like AWS, GCP, or Azure.
该工具无需必填参数,直接调用即可
steampipe_plugin_show
Get details for a specific Steampipe plugin installation, including version, memory limits, and configuration.
该工具无需必填参数,直接调用即可
服务介绍
Steampipe 模型上下文协议 (MCP) 服务器
通过 Steampipe 解锁由 AI 驱动的基础设施分析功能!此模型上下文协议服务器可以无缝连接像 Claude 这样的 AI 助手到您的云基础设施数据,使您能够以自然语言探索和分析整个云资产。
Steampipe MCP 在 AI 助手和您的基础设施数据之间架起桥梁,支持自然语言:
- 跨 AWS、Azure、GCP 和 100 多种云服务的查询
- 安全性和合规性分析
- 成本和资源优化
- 查询开发辅助
既支持本地 Steampipe 安装,也支持 Turbot Pipes 工作区,提供对所有云和 SaaS 数据的安全只读访问。
安装
前提条件
- Node.js v16 或更高版本(包含
npx) - 对于本地使用:已安装并运行 Steampipe (
steampipe service start) - 对于 Turbot Pipes:一个 Turbot Pipes 工作区和连接字符串
配置
将 Steampipe MCP 添加到您的 AI 助手配置文件中:
json
{
"mcpServers": {
"steampipe": {
"command": "npx",
"args": [
"-y",
"@turbot/steampipe-mcp"
]
}
}
}
默认情况下,这会连接到本地的 Steampipe 安装 postgresql://steampipe@localhost:9193/steampipe。请确保先运行 steampipe service start。
要改为连接到 Turbot Pipes 工作区,请在 args 中添加您的连接字符串:
json
{
"mcpServers": {
"steampipe": {
"command": "npx",
"args": [
"-y",
"@turbot/steampipe-mcp",
"postgresql://my_name:my_pw@workspace-name.usea1.db.pipes.turbot.com:9193/abc123"
]
}
}
}
AI 助手设置
| 助手 | 配置文件位置 | 设置指南 |
|---|---|---|
| Claude Desktop | claude_desktop_config.json |
Claude Desktop MCP 指南 → |
| Cursor | ~/.cursor/mcp.json |
Cursor MCP 指南 → |
保存配置文件并重启您的 AI 助手以使更改生效。
提示指南
首先,运行 MCP 服务器中包含的 best_practices 提示,以教您的 LLM 如何最好地与 Steampipe 协同工作。然后,您可以提出任何问题!
探索您的云基础设施:
你能看到哪些 AWS 账户?
简单且具体的问题效果很好:
显示上周创建的所有 S3 存储桶
生成基础设施报告:
列出我的 EC2 实例及其附加的 EBS 卷
深入安全分析:
查找在过去 90 天内未轮换访问密钥的任何 IAM 用户
获取合规性见解:
显示不符合我们标签标准的所有 EC2 实例
探索潜在风险:
分析我的 S3 存储桶的安全风险,包括公共访问、日志记录和加密
请记住:
- 明确指定您要分析的云资源(EC2、S3、IAM 等)
- 如果您对特定区域或账户感兴趣,请提及它们
- 在添加复杂条件之前,从简单的查询开始
- 使用自然语言 - LLM 会处理 SQL 翻译
- 大胆而富有探索性 - LLM 可以帮助您发现整个基础设施中的见解!
功能
工具
-
steampipe_query
- 使用 SQL 查询云和安全日志。
- 为了获得最佳性能:使用 CTE 而不是连接,并限制请求的列数。
- 所有查询都是只读的,并使用 PostgreSQL 语法。
- 输入:
sql(字符串):要使用 PostgreSQL 语法执行的 SQL 查询
-
steampipe_table_list
- 列出所有可用的 Steampipe 表。
- 可选输入:
schema(字符串):按特定模式筛选表- 可选输入:filter(字符串):通过 ILIKE 模式过滤表(例如%ec2%)
-
steampipe_table_show
- 获取特定表的详细信息,包括列定义、数据类型和描述。
- 输入:
name(字符串):要显示详细信息的表名(可以是模式限定的,例如aws_account或aws.aws_account) - 可选输入:
schema(字符串):包含该表的模式
-
steampipe_plugin_list
- 列出系统上安装的所有 Steampipe 插件。插件提供对不同数据源(如 AWS、GCP 或 Azure)的访问。
- 不需要输入参数
-
steampipe_plugin_show
- 获取特定 Steampipe 插件安装的详细信息,包括版本、内存限制和配置。
- 输入:
name(字符串):要显示详细信息的插件名称
提示
- best_practices
- 使用 Steampipe 数据的最佳实践
- 提供详细的指导:
- 响应样式和格式约定
- 使用 CTEs (WITH 子句) 与连接
- SQL 语法和风格约定
- 列选择和优化
- 模式探索和理解
- 查询结构和组织
- 性能考虑和缓存
- 错误处理和故障排除
资源
- status
- 表示 Steampipe 连接的当前状态
- 属性包括:
- connection_string: 当前数据库连接字符串
- status: 连接状态(已连接/未连接)
此资源使 AI 工具能够检查并验证到您的 Steampipe 实例的连接状态。
开发
克隆和设置
-
克隆仓库并导航到目录:
sh
git clone https://github.com/turbot/steampipe-mcp.git
cd steampipe-mcp -
安装依赖项:
sh
npm install -
构建项目:
sh
npm run build
测试
要使用支持 MCP 的 AI 工具测试本地开发构建,请更新您的 MCP 配置以使用本地 dist/index.js 而不是 npm 包。例如:
json
{
"mcpServers": {
"steampipe": {
"command": "node",
"args": [
"/absolute/path/to/steampipe-mcp/dist/index.js",
"postgresql://steampipe@localhost:9193/steampipe"
]
}
}
}
或者,使用 MCP Inspector 验证服务器实现:
sh
npx @modelcontextprotocol/inspector dist/index.js
环境变量
以下环境变量可用于配置 MCP 服务器:
STEAMPIPE_MCP_LOG_LEVEL:控制服务器日志详细程度(默认值:info)STEAMPIPE_MCP_WORKSPACE_DATABASE:覆盖默认的 Steampipe 连接字符串(默认值:postgresql://steampipe@localhost:9193/steampipe)
开源与贡献
此仓库在 Apache 2.0 许可 下发布。请参阅我们的 行为准则。我们期待与您合作!
Steampipe 是由 Turbot HQ, Inc 从这个开源软件中生产的。它根据我们的商业条款分发。其他人可以自行分发该软件,但不能使用任何 Turbot 商标、云服务等。您可以在我们的 开源常见问题 中了解更多信息。
参与进来
想帮忙但不知道从哪里开始?选择一个 help wanted 问题: