MCP Toolbox SDK Java

v1.0.0Databasesstable

Java SDK for interacting with the MCP Toolbox for Databases.

databasesjavallmsmcp
Share:
18
Stars
0
Downloads
0
Weekly
0/5

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

Java database integration
MCP toolbox database access
googleapis

Maintainer

LicenseApache-2.0
Languagejava
Versionv1.0.0
UpdatedMay 5, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-toolbox-sdk-java

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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")
2

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.json
3

Build 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();
4

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();
5

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.

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.

Quick Config Preview

{ "mcpServers": { "mcp-toolbox-sdk-java": { "command": "npx", "args": ["-y", "mcp-toolbox-sdk-java"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides