mcp-steampipe-adapter
Facilitates the integration of generative AI models with the Steampipe data query engine, enabling automated execution of arbitrary SQL against diverse data stores. This utility centralizes structured data retrieval for enhanced AI workflow capabilities.
Author

b0ttle-neck
Quick Info
Actions
Tags
Steampipe Tool Connector
This implementation serves as a minimal Steampipe Model Context Protocol (MCP) intermediary layer. It bridges interactions between your chosen large language model (LLM) and the Steampipe execution environment.
Essential Dependencies
To successfully deploy and utilize this component, ensure the following software components are correctly installed and configured:
- Python version 3.10 or newer.
- The uv package manager (recommended) alongside the mcp[cli] dependency.
- A fully operational Steampipe installation.
- Necessary Steampipe plugins (e.g., 'github') provisioned with requisite authentication credentials (e.g., stored in ~/.steampipe/config/github.spc).
- An LLM capable of utilizing the MCP specification (e.g., Anthropic's Claude).
- Node.js and npx are required, often for running associated debugging utilities like the MCP Inspector.
Validating Tool Operation via Interceptor
This procedure confirms that the MCP server is correctly exposed and functional for the LLM to invoke:
- Launch the Interceptor: Execute the following command from the project directory:
npx -y @modelcontextprotocol/inspector uv --directory . run steampipe_mcp_server.py
- UI Access: A web interface for inspection should automatically launch in your default browser (typically accessible at http://localhost:XXXX).
- Connection Check: Verify that the status indicator on the left panel shows "Connected".
- Tool Discovery: Navigate to the 'Tools' tab to confirm the run_steampipe_query function is listed, along with its operational description.
- Testing Invocation: Select the tool name. In the 'Arguments' input field, supply a syntactically correct Steampipe SQL statement, such as:
{ "query": "select login, starred_count from github_repository where owner = 'turbot'" }
- Result Verification: Execute the command and inspect the returned JSON dataset.
Operationalizing the Tool
Once testing validates functionality via the interceptor, integrate the server configuration details into your LLM's environment. Subsequently, enable the tool selection mechanism within your LLM interface.
Troubleshooting Common Issues
- Tool Not Appearing: If the interceptor fails to enumerate the function, review the application of the
@mcp.tool()decorator within the Python implementation. - Execution Failure: Examine the 'Result' pane within the Inspector alongside the server's standard error stream (stderr) output in your console. Determine if the failure originated from Steampipe execution, an underlying SQL error, an operational timeout, or an issue with JSON serialization/deserialization. Adjust the adapter script based on this diagnosis. tail -f ~/Library/Logs/Claude/mcp.log tail -f ~/Library/Logs/Claude/mcp-server-steampipe.log
Security Advisory This Proof-of-Concept (POC) permits the LLM to issue SQL commands unchecked via Steampipe, leveraging pre-configured access credentials. This introduces a substantial risk of unauthorized data exposure or modification via arbitrary query execution.
