mcp通过ssh本地中专调用远程公网转内网数据库实战

📅 2026/7/15 8:24:09 👁️ 阅读次数 📝 编程学习
mcp通过ssh本地中专调用远程公网转内网数据库实战

公司使用dm数据库, tcp方式访问, nginx转发需要插件
首先是本地运行命令

// xxx.xxx.xxx.xxx:5236 为内网ip
// yyy.yyy.yyy.yyy:22 是ssl请求
// 15236是本地端口 我们访问就用127.0.0.1:15236
ssh -L 15236:xxx.xxx.xxx.xxx:5236 root@yyy.yyy.yyy.yyy -p 22 -N

连接后输入密码
image

然后配置mcp
image

就可以愉快的用ai轰炸数据库了..

请勿连接正式数据库 注意审核ai的mcp执行内容