关于 Steampipe
Steampipe 是一个 Python MCP 服务,可连接 LLM 与 Steampipe,让 MCP 客户端查询已配置插件的数据。适合希望通过 MCP 工具访问插件数据的用户。
主要功能
- 01运行 Steampipe 查询
- 02以 JSON 返回查询结果
- 03使用已配置的 Steampipe 插件
适用场景
- 01查询 GitHub 仓库数据
- 02获取已配置插件的数据
MCP 相关
该服务向 MCP 客户端提供 `run_steampipe_query` 工具,将提交的查询交给 Steampipe 并返回结果。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。
工具
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
Steampipe MCP
这是一个简单的 Steampipe MCP 服务,用作 AI 模型与 Steampipe 工具之间的桥梁。
前置条件
- 已安装 Python 3.10+。
- 已安装 uv(我的最爱)和 mcp[cli]。
- 已安装并正常运行 Steampipe。
- 已配置 Steampipe 插件(例如 github),并提供必要的凭据(例如,~/.steampipe/config/github.spc 中的 token)。
- 支持 MCP 的任意大模型。我在这里使用 Claude。
- 已安装 Node.js 和 npx(MCP Inspector 和运行某些 MCP 服务时可能需要)。
运行 MCP Interceptor
这是一个很棒的工具,可用于测试 MCP 服务是否按预期工作。
- 运行 Interceptor
npx -y @modelcontextprotocol/inspector uv --directory . run steampipe_mcp_server.py - A browser window should open with the MCP Inspector UI (usually at http://localhost:XXXX).
- Wait for the "Connected" status on the left panel.
- Go to the Tools tab.
- You should see the run_steampipe_query tool listed with its description.
- Click on the tool name.
- In the "Arguments" JSON input field, enter a valid Steampipe query:
{
"query": "select name, fork_count from github_my_repository "
}
- execute and view the json results
Running the tool
Pretty straightforward. Just run the interceptor and make sure the tool is working from the directory. Then add the server configuration to the respective LLM and select the tool from the LLM.
TroubleShooting
- If the tool is not found in the interceptor then that means @mcp.tool() decorator has some issue.
- Execution error - Look at the "Result" in the Inspector and the server logs (stderr) in your terminal. Did Steampipe run? Was there a SQL error? A timeout? A JSON parsing error? Adjust the Python script accordingly.
tail -f ~/Library/Logs/Claude/mcp.log
tail -f ~/Library/Logs/Claude/mcp-server-steampipe.log
Security Risk Claude blindly executes your sql query in this POC so there is possibility to generate and execute arbitary SQL Queries via Steampipe using your configured credentials.
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。