steampipe-mcp

by turbot
Apache 2.0
9

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 助手的配置文件中:

{ "mcpServers": { "steampipe": { "command": "npx", "args": [ "-y", "@turbot/steampipe-mcp" ] } } }

默认情况下,这将连接到您本地的 Steampipe 安装,地址为postgresql://steampipe@localhost:9193/steampipe 。请确保先运行steampipe service start

要连接到Turbot Pipes工作区,请将连接字符串添加到参数:

{ "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_config.jsonClaude Desktop MCP 指南 →
光标~/.cursor/mcp.json光标 MCP 指南 →

保存配置文件并重新启动 AI 助手以使更改生效。

提示指南

首先,运行 MCP 服务器自带的best_practices提示符,教你的法学硕士如何最好地使用 Steampipe。然后,你可以问任何问题!

探索您的云基础设施:

What AWS accounts can you see?

简单、具体的问题很有效:

Show me all S3 buckets that were created in the last week

生成基础设施报告:

List my EC2 instances with their attached EBS volumes

深入安全分析:

Find any IAM users with access keys that haven't been rotated in the last 90 days

获取合规性见解:

Show me all EC2 instances that don't comply with our tagging standards

探索潜在风险:

Analyze my S3 buckets for security risks including public access, logging, and encryption

请记住:

  • 具体说明您想要分析哪些云资源(EC2、S3、IAM 等)
  • 如果您对特定地区或帐户感兴趣,请提及
  • 在添加复杂条件之前先从简单查询开始
  • 使用自然语言 - LLM 将处理 SQL 翻译
  • 大胆探索——法学硕士可以帮助您发现整个基础设施的见解!

功能

工具

  • 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 (字符串):显示详细信息的插件名称

提示

  • 最佳实践
    • 使用 Steampipe 数据的最佳实践
    • 提供以下方面的详细指导:
      • 响应样式和格式约定
      • 使用 CTE(WITH 子句)与连接
      • SQL 语法和样式约定
      • 色谱柱选择与优化
      • 模式探索和理解
      • 查询结构和组织
      • 性能考虑和缓存
      • 错误处理和故障排除

资源

  • 地位
    • 表示 Steampipe 连接的当前状态
    • 属性包括:
      • connection_string:当前数据库连接字符串
      • 状态:连接状态(已连接/已断开连接)

该资源使 AI 工具能够检查和验证与 Steampipe 实例的连接状态。

发展

克隆和设置

  1. 克隆存储库并导航到目录:
git clone https://github.com/turbot/steampipe-mcp.git cd steampipe-mcp
  1. 安装依赖项:
npm install
  1. 构建项目:
npm run build

测试

如需使用支持 MCP 的 AI 工具测试本地开发版本,请更新 MCP 配置以使用本地dist/index.js包(而非 npm 包)。例如:

{ "mcpServers": { "steampipe": { "command": "node", "args": [ "/absolute/path/to/steampipe-mcp/dist/index.js", "postgresql://steampipe@localhost:9193/steampipe" ] } } }

或者,使用 MCP 检查器来验证服务器实现:

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 许可证发布。请参阅我们的行为准则。我们期待与您合作!

SteampipeTurbot HQ, Inc.独家基于此开源软件开发的产品。该产品根据我们的商业条款进行分发。其他方可以自行分发该软件,但不得使用 Turbot 的任何商标、云服务等。您可以访问我们的开源常见问题解答了解更多信息。

介入

在 Slack 上加入 #steampipe →

想帮忙却不知从何下手?那就从以下help wanted中选择一张吧:

Related MCP Servers

  • -
    security
    F
    license
    -
    quality
    An MCP server that connects Claude to FL Studio, allowing the AI to compose music, control instruments, and live record melodies, chords, and drums to the piano roll.
    Last updated -
    8
    Python
    • Apple
  • -
    security
    -
    license
    -
    quality
    This is an MCP written for steampipe. This Steampipe MCP tool allows Claude to interact directly with your Steampipe installation using natural language requests. It executes provided SQL queries via the Steampipe CLI and returns the data results as JSON back to Claude.
    Last updated -
    Python
    MIT License

View all related MCP servers

ID: i4a149hwmy