Choose either plaintext configuration or environment-variable configuration.
claude mcp add --transport http --scope user sqltunnel \
"http://127.0.0.1:3000/mcp" \
--header "Authorization: Bearer replace-with-a-random-secret"export SQLTUNNEL_MCP_URL="http://127.0.0.1:3000/mcp"
export SQLTUNNEL_API_KEY="replace-with-a-random-secret"
claude mcp add --transport http --scope user sqltunnel "$SQLTUNNEL_MCP_URL" \
--header "Authorization: Bearer $SQLTUNNEL_API_KEY"Use --scope project instead of --scope user to add the server only to the current project.
Choose either plaintext configuration or environment-variable configuration in .mcp.json at the project root.
{
"mcpServers": {
"sqltunnel": {
"type": "http",
"url": "http://127.0.0.1:3000/mcp",
"headers": {
"Authorization": "Bearer replace-with-a-random-secret"
}
}
}
}export SQLTUNNEL_MCP_URL="http://127.0.0.1:3000/mcp"
export SQLTUNNEL_API_KEY="replace-with-a-random-secret"{
"mcpServers": {
"sqltunnel": {
"type": "http",
"url": "${SQLTUNNEL_MCP_URL}",
"headers": {
"Authorization": "Bearer ${SQLTUNNEL_API_KEY}"
}
}
}
}Do not commit a real API key in .mcp.json.
First tell Claude Code:
You can use SQLTunnel to query databases.
Then describe each request in natural language. For example:
List the databases I can access.
List the tables in prod-postgres.
Query the 10 most recent orders. Inspect the relevant table schemas before running the query.