Read-only queries against IBM Db2 for i (IBM i, AS/400); users sign in with their own IBM i credentials.
接入配置
选择客户端,复制配置,再按项目文档补齐环境变量。
claude mcp add db2i --env DB2I_HOSTNAME='<DB2I_HOSTNAME>' --env DB2I_USERNAME='<DB2I_USERNAME>' --env DB2I_PASSWORD='<DB2I_PASSWORD>' -- npx -y mcp-server-db2i~/.codex/config.toml
[mcp_servers.db2i]
command = "npx"
args = ["-y", "mcp-server-db2i"]
env = { DB2I_HOSTNAME = "<DB2I_HOSTNAME>", DB2I_USERNAME = "<DB2I_USERNAME>", DB2I_PASSWORD = "<DB2I_PASSWORD>" }
# codex mcp add db2i --env DB2I_HOSTNAME='<DB2I_HOSTNAME>' --env DB2I_USERNAME='<DB2I_USERNAME>' --env DB2I_PASSWORD='<DB2I_PASSWORD>' -- npx -y mcp-server-db2i~/.cursor/mcp.json
{
"mcpServers": {
"db2i": {
"command": "npx",
"args": [
"-y",
"mcp-server-db2i"
],
"env": {
"DB2I_HOSTNAME": "<DB2I_HOSTNAME>",
"DB2I_USERNAME": "<DB2I_USERNAME>",
"DB2I_PASSWORD": "<DB2I_PASSWORD>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"db2i": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mcp-server-db2i"
],
"env": {
"DB2I_HOSTNAME": "<DB2I_HOSTNAME>",
"DB2I_USERNAME": "<DB2I_USERNAME>",
"DB2I_PASSWORD": "<DB2I_PASSWORD>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"db2i": {
"command": "npx",
"args": [
"-y",
"mcp-server-db2i"
],
"env": {
"DB2I_HOSTNAME": "<DB2I_HOSTNAME>",
"DB2I_USERNAME": "<DB2I_USERNAME>",
"DB2I_PASSWORD": "<DB2I_PASSWORD>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"db2i": {
"command": "npx",
"args": [
"-y",
"mcp-server-db2i"
],
"env": {
"DB2I_HOSTNAME": "<DB2I_HOSTNAME>",
"DB2I_USERNAME": "<DB2I_USERNAME>",
"DB2I_PASSWORD": "<DB2I_PASSWORD>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"db2i": {
"command": "npx",
"args": [
"-y",
"mcp-server-db2i"
],
"env": {
"DB2I_HOSTNAME": "<DB2I_HOSTNAME>",
"DB2I_USERNAME": "<DB2I_USERNAME>",
"DB2I_PASSWORD": "<DB2I_PASSWORD>"
}
}
}
}需要的环境变量
DB2I_HOSTNAMEDB2I_USERNAMEDB2I_PASSWORD
把占位值换成你自己的密钥;不要把密钥提交到代码仓库。