AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
MCP verified MIT Self-run

Mcp Java Sdk Examples

mcp-thought2code-mcp-java-sdk-examples · by thought2code

A collection of MCP server examples developed by various Java SDKs

No reviews yet
0 installs
4 views
0.0% view→install

Install

$ agentstack add mcp-thought2code-mcp-java-sdk-examples

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/mcp-thought2code-mcp-java-sdk-examples)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
1mo ago

Declared compatibility

Claude CodeClaude DesktopCursorWindsurf

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Mcp Java Sdk Examples? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

MCP Java SDK Examples

A collection of MCP examples developed with Java SDKs.

Requirements

  • Java 17 or later
  • Maven 3.9.16 or the included Maven Wrapper

What is MCP?

The Model Context Protocol (MCP) lets servers expose data and functionality to LLM applications in a standardized way. MCP servers can expose resources, tools, prompts, and more.

Examples

  • [JDBC Server](mcp-server-jdbc) - Exposes JDBC database metadata through an MCP resource

JDBC Server

The JDBC example includes an annotated-sdk implementation backed by a JDBC connection. The packaged server starts in STDIO mode by default.

Implemented resource:

  • db://schema - Returns database product/version plus table and column metadata as JSON

JDBC configuration for the MCP server process:

  • JDBC_URL is required
  • JDBC_USERNAME is optional
  • JDBC_PASSWORD is optional

Bundled sample database:

  • mcp-server-jdbc/mcp-server-jdbc-common/src/test/resources/sqlite3.db

Build the MCP server jar first:

./mvnw -pl mcp-server-jdbc/mcp-server-jdbc-annotated-sdk -am package

On Windows PowerShell, use .\mvnw.cmd instead of ./mvnw.

The jar is created at:

  • mcp-server-jdbc/mcp-server-jdbc-annotated-sdk/target/mcp-server-jdbc-annotated-sdk.jar

Use these paths in the examples below:

  • `` - absolute path to this repository
  • ` - /mcp-server-jdbc/mcp-server-jdbc-annotated-sdk/target/mcp-server-jdbc-annotated-sdk.jar`
  • ` - /mcp-server-jdbc/mcp-server-jdbc-common/src/test/resources/sqlite3.db`

For Windows paths in JSON/TOML, prefer forward slashes, for example C:/Users/me/code/mcp-java-sdk-examples/....

MCP Inspector

Start Inspector with the JDBC server as a STDIO server:

npx @modelcontextprotocol/inspector -e JDBC_URL=jdbc:sqlite: -- java -jar 

Open the Inspector URL printed in the terminal, then browse the db://schema resource.

Claude Desktop

Add the server to Claude Desktop MCP settings:

{
  "mcpServers": {
    "jdbc-mcp-server": {
      "command": "java",
      "args": ["-jar", ""],
      "env": {
        "JDBC_URL": "jdbc:sqlite:"
      }
    }
  }
}

Restart Claude Desktop, then browse the db://schema resource from the MCP tools/resources panel.

Codex

Add the server with the Codex CLI:

codex mcp add jdbc-mcp-server --env JDBC_URL=jdbc:sqlite: -- java -jar 

Or add it to ~/.codex/config.toml or a trusted project .codex/config.toml:

[mcp_servers.jdbc-mcp-server]
command = "java"
args = ["-jar", ""]

[mcp_servers.jdbc-mcp-server.env]
JDBC_URL = "jdbc:sqlite:"

Cursor

Add this server in Cursor MCP settings:

{
  "mcpServers": {
    "jdbc-mcp-server": {
      "command": "java",
      "args": ["-jar", ""],
      "env": {
        "JDBC_URL": "jdbc:sqlite:"
      }
    }
  }
}

Cline

Open Cline MCP settings and add:

{
  "mcpServers": {
    "jdbc-mcp-server": {
      "command": "java",
      "args": ["-jar", ""],
      "env": {
        "JDBC_URL": "jdbc:sqlite:"
      }
    }
  }
}

VS Code

Create or update .vscode/mcp.json:

{
  "servers": {
    "jdbc-mcp-server": {
      "type": "stdio",
      "command": "java",
      "args": ["-jar", ""],
      "env": {
        "JDBC_URL": "jdbc:sqlite:"
      }
    }
  }
}

For databases that require credentials, add them to the MCP server environment:

"env": {
  "JDBC_URL": "jdbc:postgresql://localhost:5432/example",
  "JDBC_USERNAME": "user",
  "JDBC_PASSWORD": "password"
}

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.