MCP Toolbox SDK Java
Java SDK for interacting with the MCP Toolbox for Databases.
What is MCP Toolbox SDK Java?
MCP Toolbox SDK Java is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to java sdk for interacting with the mcp toolbox for databases.
Java SDK for interacting with the MCP Toolbox for Databases.
This server falls under the Databases category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Java SDK for interacting with the MCP Toolbox for Databases.
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx mcp-toolbox-sdk-javaConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use MCP Toolbox SDK Java
The MCP Toolbox SDK for Java is a Google Cloud client library that allows Java applications to discover and invoke tools registered in the MCP Toolbox for Databases service. It handles authentication (application default credentials, OIDC for Cloud Run, or API keys), asynchronous tool invocation via CompletableFuture, and dynamic parameter binding, enabling Java-based AI agents and LLM integrations to safely query databases through a managed toolbox layer without writing raw SQL or managing connections directly.
Prerequisites
- Java 11 or later
- Maven or Gradle build tool
- A running MCP Toolbox for Databases service endpoint (Google Cloud or self-hosted)
- Google Cloud credentials configured via 'gcloud auth application-default login', GOOGLE_APPLICATION_CREDENTIALS env var, or an API key
- An MCP-compatible agent framework (e.g., Spring AI, LangChain4j) to wire tools into an LLM pipeline
Add the SDK dependency to your project
Add the mcp-toolbox-sdk-java artifact to your Maven pom.xml or Gradle build file. Check the GitHub releases page for the latest version number.
<!-- Maven -->
<dependency>
<groupId>com.google.cloud.mcp</groupId>
<artifactId>mcp-toolbox-sdk-java</artifactId>
<version>0.2.0</version>
</dependency>
// Gradle
implementation("com.google.cloud.mcp:mcp-toolbox-sdk-java:0.2.0")Configure Google Cloud credentials
For local development, authenticate with the gcloud CLI. For production (Cloud Run, GKE), service account credentials are picked up automatically. For CI/CD or on-premise, set the GOOGLE_APPLICATION_CREDENTIALS environment variable.
# Local development
gcloud auth application-default login
# CI/CD / on-premise
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account-key.jsonBuild an MCP Toolbox client
Create an McpToolboxClient pointing at your running Toolbox service endpoint.
import com.google.cloud.mcp.sdk.McpToolboxClient;
McpToolboxClient client = McpToolboxClient.builder()
.baseUrl("https://my-toolbox-service.a.run.app/mcp")
.build();Invoke a tool asynchronously
Call invokeTool with the tool name and a parameter map. Results come back as CompletableFuture.
client.invokeTool("get-toy-price", Map.of("description", "plush dinosaur"))
.thenAccept(result -> System.out.println(result.content().get(0).text()))
.join();Load and bind a toolset
Load all tools from a named toolset for use with an LLM agent framework. Tools can have static (compile-time) or dynamic (per-request) parameter bindings.
// Load all tools from a toolset
var toolset = client.loadToolset("my-toolset").join();
// Or load a single tool by name
var tool = client.loadTool("search-products").join();MCP Toolbox SDK Java Examples
Maven dependency and client setup
Complete Maven dependency and minimal Java snippet to connect to an MCP Toolbox service and invoke a tool.
<!-- pom.xml -->
<dependency>
<groupId>com.google.cloud.mcp</groupId>
<artifactId>mcp-toolbox-sdk-java</artifactId>
<version>0.2.0</version>
</dependency>Prompts to try (via an LLM agent wired to the SDK)
Example natural language queries an LLM agent can answer by invoking database tools through the SDK.
- "Find the price of a plush dinosaur toy"
- "Search for all products in the electronics category under $100"
- "Get the order history for customer ID 12345"
- "List all available toolsets registered in the MCP Toolbox service"Troubleshooting MCP Toolbox SDK Java
Authentication error when connecting to the Toolbox service
Run 'gcloud auth application-default login' for local development. For Cloud Run, ensure the service account has the required IAM roles. For on-premise, set GOOGLE_APPLICATION_CREDENTIALS to a valid service account JSON key file path.
Tool invocation returns empty or unexpected results
Verify the tool name and parameter map match exactly what the Toolbox service has registered. Use client.loadToolset() to discover available tools and their parameter schemas before invoking them.
CompletableFuture never completes or times out
Check that the Toolbox service URL is reachable from your environment (firewall rules, VPC settings, Cloud Run ingress). Add a timeout: client.invokeTool(...).get(30, TimeUnit.SECONDS).
Frequently Asked Questions about MCP Toolbox SDK Java
What is MCP Toolbox SDK Java?
MCP Toolbox SDK Java is a Model Context Protocol (MCP) server that java sdk for interacting with the mcp toolbox for databases. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install MCP Toolbox SDK Java?
Follow the installation instructions on the MCP Toolbox SDK Java GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with MCP Toolbox SDK Java?
MCP Toolbox SDK Java works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is MCP Toolbox SDK Java free to use?
Yes, MCP Toolbox SDK Java is open source and available under the Apache-2.0 license. You can use it freely in both personal and commercial projects.
MCP Toolbox SDK Java Alternatives — Similar Databases Servers
Looking for alternatives to MCP Toolbox SDK Java? Here are other popular databases servers you can use with Claude, Cursor, and VS Code.
Excelize
★ 20.6kGo language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
MCP Toolbox for Databases
★ 15.3kOpen source MCP server specializing in easy, fast, and secure tools for Databases.
DBHub
★ 2.8kA universal database gateway MCP server that enables AI assistants to connect to and query multiple databases (PostgreSQL, MySQL, MariaDB, SQL Server, SQLite) with support for schema exploration, SQL execution, and secure connections via SSH tunnels.
Tabularis
★ 2.1kA lightweight, cross-platform database client for developers. Supports MySQL, PostgreSQL and SQLite. Hackable with plugins. Built for speed, security, and aesthetics.
Postgres AI Guide
★ 1.7kMCP server and Claude plugin for Postgres skills and documentation. Helps AI coding tools generate better PostgreSQL code.
Anyquery
★ 1.7k🏎️ 🏠 ☁️ - Query more than 40 apps with one binary using SQL. It can also connect to your PostgreSQL, MySQL, or SQLite compatible database. Local-first and private by design.
Browse More Databases MCP Servers
Explore all databases servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up MCP Toolbox SDK Java in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use MCP Toolbox SDK Java?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.