DJ

danvega/javaone-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

17 stars 7 forks 质量 48 趋势 21

Java One 磁共振 服务器是一个轻量级的Java应用程序,它执行"模型背景协议"(MCP),允许AI模型访问关于JavaOne会议演示文稿的信息.

概览

Java One 磁共振 服务器是一个轻量级的Java应用程序,它执行"模型背景协议"(MCP),允许AI模型访问关于JavaOne会议演示文稿的信息. 这个服务器通过标准化的MCP工具来曝光演示数据,使得它容易与支持协议的AI助手集成. - Java 24 - 马文 3.8+ - 模型上下文协议 SDK 0.9.0 - 用于伐木的SLF4J 该项目依靠以下关键组成部分: 克隆寄存器后,您可以使用 Maven 构建工程 : 这将在目标目录中创建一个可执行的 JAR 文件,其中包含所有依赖性 。 执行 JAR 文件启动 MCP 服务器 : 应用程序启动一个MCP服务器,通过标准输入/输出(STDIO)进行通信,并提供JavaOne演示文稿数据的访问权限. - : 配置和启动 MCP 服务器的主要切入点 - : 代表 JavaOne 演示文稿的数据模型 - : 提供演示文稿数据和操作的服务

概述(AI 翻译)

^ 一个用于访问 JavaOne 演示文稿的上下文模式服务器

Java One 磁共振 服务器是一个轻量级的Java应用程序,它执行"模型背景协议"(MCP),允许AI模型访问关于JavaOne会议演示文稿的信息. 这个服务器通过标准化的MCP工具来曝光演示数据,使得它容易与支持协议的AI助手集成.

□ 项目要求

  • 爪哇24号
  • 马文 3.8+
  • 示范背景协议SDK 0.9.0
  • 用于伐木的SLF4J

□ 依赖性

该项目依靠以下关键组成部分:

∮开始∮

克隆寄存器后,您可以使用 Maven 构建工程 :

这将在 [[T0] 目录中创建一个可执行的 JAR 文件,其中包含所有依赖性 。

□ 如何运行应用程序

执行 JAR 文件启动 MCP 服务器 :

应用程序启动一个MCP服务器,通过标准输入/输出(STDIO)进行通信,并提供JavaOne演示文稿数据的访问权限.

□ 了解项目结构

  • 核心组成部分
  • 应用.java:配置和启动MCP服务器的主要切入点
  • 介绍.java:代表JavaOne演示文稿的数据模型

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

JavaOne MCP Server

A Model Context Protocol Server for Accessing JavaOne Presentations

JavaOne MCP Server is a lightweight Java application that implements the Model Context Protocol (MCP), allowing AI models to access information about JavaOne conference presentations. This server exposes presentation data through standardized MCP tools, making it easy to integrate with AI assistants that support the protocol.

Project Requirements

  • Java 24
  • Maven 3.8+
  • Model Context Protocol SDK 0.9.0
  • SLF4J for logging

Dependencies

This project relies on the following key components:


    io.modelcontextprotocol.sdk
    mcp

    org.slf4j
    slf4j-api

    org.slf4j
    slf4j-simple

Getting Started

After cloning the repository, you can build the project using Maven:

mvn clean package

This will create an executable JAR file in the target directory with all dependencies included.

How to Run the Application

Execute the JAR file to start the MCP server:

java -jar target/javaone-mcp-0.0.2.jar

The application starts an MCP server that communicates via standard input/output (STDIO) and provides access to JavaOne presentation data.

Understanding the Project Structure

Core Components

  • Application.java: Main entry point that configures and starts the MCP server
  • Presentation.java: Data model representing a JavaOne presentation
  • PresentationTools.java: Service that provides presentation data and operations

MCP Server Configuration

The server is configured with:

  • STDIO transport provider for communication
  • Server information (name and version)
  • Tool capabilities for accessing presentation data
McpSyncServer syncServer = McpServer.sync(transportProvider)
    .serverInfo("javaone-mcp-server", "0.0.1")
    .capabilities(McpSchema.ServerCapabilities.builder()
            .tools(true)
            .logging()
            .build())
    .tools(syncToolSpecification)
    .build();

Available Tools

The server exposes the following MCP tool:

  • get_presentations: Returns a list of all JavaOne presentations

Testing with MCP Inspector

The MCP Inspector is a helpful tool for testing and debugging your MCP server. Follow these steps to test your JavaOne MCP Server:

  1. Install Node.js if you haven’t already
  2. Navigate to your project directory and get the absolute path to the JAR file:
# On Linux/macOS
FULL_PATH=$(pwd)/target/javaone-mcp-0.0.2.jar
echo $FULL_PATH

# On Windows PowerShell
$FULL_PATH="$(Get-Location)\target\javaone-mcp-0.0.2.jar"
echo $FULL_PATH
  1. Run the MCP Inspector with your server using the full path:
npx @modelcontextprotocol/inspector java -jar $FULL_PATH
在 GitHub 查看完整 README

安装

npx @modelcontextprotocol/inspector java -jar $FULL_PATH
新手?先看 mcpskill.org 教程 →