This project is forked from https://github.com/danvega/javaone-mcp [https://www.youtube.com/watch?v=w5YVHG1j3Co](YouTube video is here)
JavaOne MCP Server is a lightweight Java application that implements the Model Context Protocol (MCP), allowing AI models to access information. This server exposes data through standardized MCP tools, making it easy to integrate with AI assistants that support the protocol.
- Java 18
- Maven 3.8+
- Model Context Protocol SDK 0.9.0
- SLF4J for logging
This project relies on the following key components:
<!-- MCP SDK -->
<dependency>
<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp</artifactId>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</dependency>
After cloning the repository, you can build the project using Maven:
mvn clean package
Or run build-jar
run configuration in IntelliJ IDEA.
This will create an executable JAR file in the target
directory with all dependencies included.
Execute the JAR file to start the MCP server:
java -jar target/test-mcp-server-0.0.1.jar
The application starts an MCP server that communicates via standard input/output (STDIO) and provides access to data.
- Application.java: Main entry point that configures and starts the MCP server
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("test-mcp-server", "0.0.1")
.capabilities(McpSchema.ServerCapabilities.builder()
.tools(true)
.logging()
.build())
.tools(syncToolSpecification)
.build();
The server exposes the following MCP tool:
- get_list: Returns a list of all items by categories
The MCP Inspector is a helpful tool for testing and debugging your MCP server. Follow these steps to test your MCP Server:
- Install Node.js if you haven't already
- Navigate to your project directory and get the absolute path to the JAR file:
# On Linux/macOS
FULL_PATH=$(pwd)/target/test-mcp-server-0.0.1.jar
echo $FULL_PATH
# On Windows PowerShell
$FULL_PATH="$(Get-Location)\target\test-mcp-server-0.0.1.jar"
echo $FULL_PATH
- Run the MCP Inspector with your server using the full path:
npx @modelcontextprotocol/inspector java -jar $FULL_PATH
- In the Inspector interface:
- Verify the server connection in the connection pane
- Navigate to the "Tools" tab to see the
get_list
tool - Test the tool by clicking on it and viewing the response
- Monitor logs in the Notifications pane
To use this MCP server with Claude Desktop, add the following configuration:
- First, get the absolute path to your JAR file:
# On Linux/macOS
FULL_PATH=$(pwd)/target/test-mcp-server-0.0.1.jar
echo $FULL_PATH
# On Windows PowerShell
$FULL_PATH="$(Get-Location)\target\test-mcp-server-0.0.1.jar"
echo $FULL_PATH
- Open Claude Desktop preferences
- Navigate to the "MCP Servers" section
- Add a new server with the following configuration (replace the path with your actual full path):
{
"javaone-mcp": {
"command": "java",
"args": [
"-jar",
"$FULL_PATH"
]
}
}
Implement more tools to expose different functionality:
// Example of adding a tool to search presentations by title
var searchToolSpec = new McpServerFeatures.SyncToolSpecification(
new McpSchema.Tool("search_items", "Search items by title", searchSchema),
(exchange, arguments) -> {
String query = arguments.get("query").asText();
List<Presentation> results = presentationTools.searchPresentations(query);
// Convert results to MCP content and return
}
);
- Add resource subscriptions for real-time updates
- Implement asynchronous tools for long-running operations
- Add authentication and authorization mechanisms
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.