Java SDK with ready-to-use MySQL and Redis MCP servers

Java SDK with ready-to-use MySQL and Redis MCP servers

mcp-java•by6000fish

A Java SDK for building Model Context Protocol servers, bundled with runnable MySQL and Redis server implementations and annotation-based examples.

License: MIT•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Provides an SDK to build MCP servers in Java using code or annotations, with stdio and SSE transports.
  • •Ships a MySQL MCP server exposing database tools such as query, execute, list_databases, list_tables, describe_table, explain_query and get_table_status.
  • •Ships a Redis MCP server exposing cache tools such as get, set, del, keys, type, ttl, hget, hset, hgetall, lrange, llen, scard, smembers, info and dbsize.
  • •Includes a quick-start demo server exposing greet, current_time, calculate, text_transform tools and a server info resource.

BEST FOR

  • •Java developers who want to build their own MCP servers without wiring JSON-RPC by hand.
  • •Connecting MySQL databases to an AI Agent through MCP.
  • •Connecting Redis to an AI Agent through MCP.

ABOUT MCP-JAVA

Java SDK with ready-to-use MySQL and Redis MCP servers is cataloged as an MCP server attributed to 6000fish. A Java SDK for building Model Context Protocol servers, bundled with runnable MySQL and Redis server implementations and annotation-based examples. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Java SDK with ready-to-use MySQL and Redis MCP servers are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Can I build my own MCP server with this project in Java?

Yes, the project provides a small Java SDK and copyable annotation-based templates for building custom MCP servers.

What transports are supported?

The SDK supports stdio for local Agent integration and SSE for HTTP-based integrations.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 0f30331c3b4f · 采集于 2026-11-13 10:44:31 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

English | 中文

MCP Java SDK

Maven Central Release CI Java License

Java SDK for building custom Model Context Protocol (MCP) servers quickly, with runnable MySQL and Redis server examples.

MCP.so listings: MySQL MCP Server for Java · Redis MCP Server for Java

Why this project

  • Build custom MCP servers in Java with a small SDK.
  • Use stdio for local Agent integration and SSE for HTTP-based integrations.
  • Define tools, resources, and prompts with either Java code or annotations.
  • Start from copyable examples instead of wiring JSON-RPC by hand.
  • Use MySQL and Redis servers as ready-to-run examples for real data sources.

5-minute paths

GoalStart hereRequires external service
Run the fastest SDK demomcp-examples/quick-startNo
Copy a custom server templatemcp-examples/custom-server-templateNo
Build inside Spring Bootmcp-examples/spring-boot-exampleNo
Connect Redis to an Agentdocs/redis-server.mdRedis
Connect MySQL to an Agentdocs/mysql-server.mdMySQL

Full walkthrough: 5-Minute Quick Start.

Install from Maven Central

Core SDK:

<dependency>
    <groupId>io.github.6000fish</groupId>
    <artifactId>mcp-sdk</artifactId>
    <version>0.1.1</version>
</dependency>

Spring Boot starter:

<dependency>
    <groupId>io.github.6000fish</groupId>
    <artifactId>mcp-spring-boot-starter</artifactId>
    <version>0.1.1</version>
</dependency>

Fastest SDK demo

Build the no-database quick-start server:

mvn package -pl mcp-examples/quick-start -am -DskipTests

Add the runnable jar to your MCP Agent configuration:

{
  "mcpServers": {
    "quick-start": {
      "type": "stdio",
      "command": "java",
      "args": [
        "-jar",
        "/absolute/path/to/mcp-java/mcp-examples/quick-start/target/quick-start-0.1.1.jar"
      ]
    }
  }
}

Restart the Agent and ask:

Use the quick-start MCP server to greet Alice and get the current time.

The demo exposes greet, current_time, calculate, text_transform, and resource server://info.

Build your own MCP server

For a copyable annotation-based template:

mvn package -pl mcp-examples/custom-server-template -am -DskipTests

Configure the generated jar:

{
  "mcpServers": {
    "custom-template": {
      "type": "stdio",
      "command": "java",
      "args": [
        "-jar",
        "/absolute/path/to/mcp-java/mcp-examples/custom-server-template/target/custom-server-template-0.1.1.jar"
      ]
    }
  }
}

Then edit CustomMcpServer.java and add your own @McpTool, @McpResource, or @McpPrompt methods.

Minimal SDK API example:

McpServer server = DefaultMcpServer.builder()
        .name("my-server")
        .version("1.0.0")
        .build();

server.tool("greet", "Greet someone", arguments -> {
    String name = (String) arguments.getOrDefault("name", "World");
    return ToolCallResult.success("Hello, " + name + "!");
});

server.start(new StdioTransport());

Annotation example:

@McpServer(name = "my-server", version = "1.0.0")
public class MyServer {

    @McpTool(name = "hello", description = "Say hello")
    public String hello(@Param(name = "name") String name) {
        return "Hello, " + name + "!";
    }
}

Ready-to-use servers

Build the currently published ready-to-use server modules:

mvn package -pl mcp-server-collection/mcp-server-mysql -am -DskipTests
mvn package -pl mcp-server-collection/mcp-server-redis -am -DskipTests

MySQL server config:

{
  "mcpServers": {
    "mysql": {
      "type": "stdio",
      "command": "java",
      "args": [
        "-jar",
        "/absolute/path/to/mcp-java/mcp-server-collection/mcp-server-mysql/target/mcp-server-mysql-0.1.1.jar"
      ],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_PORT": "3306",
        "MYSQL_DATABASE": "mcp_demo",
        "MYSQL_USERNAME": "my_user",
        "MYSQL_PASSWORD": "your_password"
      }
    }
  }
}

Redis server config:

{
  "mcpServers": {
    "redis": {
      "type": "stdio",
      "command": "java",
      "args": [
        "-jar",
        "/absolute/path/to/mcp-java/mcp-server-collection/mcp-server-redis/target/mcp-server-redis-0.1.1.jar"
      ],
      "env": {
        "REDIS_HOST": "localhost",
        "REDIS_PORT": "6379",
        "REDIS_PASSWORD": ""
      }
    }
  }
}

Before connecting real data, read the Security Guide. Keep credentials in local Agent configuration or environment variables only.

Available server tools

ServerDescriptionTools
MySQLDatabase operationsquery, execute, list_databases, list_tables, describe_table, explain_query, get_table_status
RedisCache operationsget, set, del, keys, type, ttl, hget, hset, hgetall, lrange, llen, scard, smembers, info, dbsize

Documentation

User documentation:

Maintainer documentation:

Compatibility

The stdio servers are designed for mainstream MCP clients and Agents:

  • Claude Code: verified with MySQL and Redis stdio servers.
  • Codex: verified with MySQL stdio server, including tools/list, tools/call, and client _meta fields.
  • Other MCP clients such as opencode, OpenClaw, Gemini-related tooling: use the same stdio JSON-RPC flow and should use the documented config shape.

Compatibility safeguards include required inputSchema on tools, tolerant request parsing for client extension fields such as _meta, omitted null fields in stdio responses, and logging to stderr so stdout stays reserved for MCP JSON-RPC messages.

Project structure

mcp-java/
├── mcp-sdk/                      # Core SDK
├── mcp-spring-boot-starter/      # Spring Boot integration
├── mcp-server-collection/        # Ready-to-use server implementations
└── mcp-examples/                 # SDK examples and templates

Build from source

git clone https://github.com/6000fish/mcp-java.git
cd mcp-java
mvn clean install

Community

Maintainers

Release instructions are in docs/release.md. Do not commit Maven Central credentials, GPG passphrases, private keys, or settings.xml.

License

MIT

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Java SDK with ready-to-use MySQL and Redis MCP servers from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/mcp-java)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools