Connecting an MCP Host
Connect Claude Code, Cursor, or Visual Studio Code to GridGain MCP Server, from the JAR file or the container image, without storing the password in a settings file.
An MCP host is the application that runs your AI assistant, such as Claude Code, Cursor, or Visual Studio Code. The host starts GridGain MCP Server when it needs the server and talks to it through standard input and output. You do not start the server yourself. To connect a host, you add an entry for the server to the host's settings.
Before you begin:
Install the server. See Installing MCP Server.
Create a read-only account on the cluster. See Preparing a Cluster Account.
Choosing the Start Command
The command depends on how you installed the server.
To run the JAR file:
"command": "java",
"args": ["-jar", "/opt/gridgain-mcp/gridgain-mcp-<version>.jar"]Use the full path to the JAR file, because the host can start the server from any folder.
To run the container image:
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "GRIDGAIN_HOST",
"-e", "GRIDGAIN_USERNAME",
"-e", "GRIDGAIN_PASSWORD",
"gridgain/mcp:<version>"
]A -e option without a value, such as -e GRIDGAIN_PASSWORD, passes that variable from the host into the container. If you set more variables, add an -e option for each of them. To keep the audit log, also mount a volume, as described in Keeping the Audit Log.
Setting the Connection Variables
The host passes the variables from the env block of the entry to the server. At a minimum, set the following:
GRIDGAIN_HOST
The address of your cluster.
GRIDGAIN_USERNAME
The user name of the account for the server.
GRIDGAIN_PASSWORD
The password of the account.
For all other settings, see Configuring MCP Server.
Adding the Server to the Host
The examples below run the JAR file. To run the container image, replace command and args with the container form from Choosing the Start Command. You can also open the container example under each host. Replace <version> with the server version and db.example.com with the address of your cluster.
Create a .mcp.json file in the root of your project:
Claude Code replaces ${GRIDGAIN_PASSWORD} with the value of the environment variable, so set it in your shell before you start Claude Code:
If the variable is not set, Claude Code shows a warning in claude mcp list and passes the text ${GRIDGAIN_PASSWORD} to the server as the password. You can also write ${NAME:-default} to give a variable a default value.
The file contains no secrets, so you can commit it to share the server with your team.
To check the result, run claude mcp list, or type /mcp in a Claude Code session.
Add the server to the .cursor/mcp.json file in your project, or to ~/.cursor/mcp.json to use it in all projects:
Cursor replaces ${env:GRIDGAIN_PASSWORD} with the value of the environment variable. Set the variable before you start Cursor.
Add the server to the .vscode/mcp.json file in your workspace. To add it for all workspaces, run the MCP: Open User Configuration command and add it there.
The inputs block makes Visual Studio Code ask for the password the first time it starts the server. Visual Studio Code hides what you type and keeps the password in its secure storage, not in the file. To enter a different password, run the MCP: Reset Cached Inputs command.
Verifying the Connection
After you add the server, the host lists the server's tools. Ask the assistant to check the database connection. The assistant calls the check_database_connection tool and reports whether the cluster answered. If the call fails, see Troubleshooting.
Allowing the Tools
Hosts ask you for permission before the assistant uses a tool, unless you allow it in advance. All GridGain MCP Server tools are marked as read-only, so a host may offer to run them without asking. Before you allow this, read Security, especially the part about user-defined functions.
This page is: Copyright © 2026 MariaDB. All rights reserved.
Last updated
Was this helpful?

