1. Conduid
  2. Developer Tools
  3. JAVA
MCP server · Developer Tools

JAVA

mcp-java-server

Unclaimed devtools
34Low

Scored 11 days ago · breakdown

About JAVA

JAVA is an MCP server published by cobra30299 in the Developer Tools category: mcp-java-server.

The repository has 1 stars and 1 forks, with the last commit 2 months ago. Recent commit activity is the strongest signal that reported issues will get attention.

Install

From source
git clone https://github.com/cobra30299/MCP_SERVER_JAVA

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Tools (5)

addAdd two numbers together

Parameters not published.

ai_chatSend prompts to Azure AI Foundry agent and get AI-powered responses

Parameters not published.

get_current_timeGet the current server time

Parameters not published.

greetGreet a person by name

Parameters not published.

multiplyMultiply two numbers

Parameters not published.

Ask AI

✦

Ask AI about JAVA

Powered by Claude · Grounded in docs

I know everything about JAVA. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ✓README presentThe repository ships documentation.

5 checks have not been run yet.

README

MCP Server Java

A Model Context Protocol (MCP) server implementation in Java, demonstrating the core MCP features including tools, resources, and prompts.

Features

This MCP server provides:

Tools

  • add: Add two numbers together
  • multiply: Multiply two numbers
  • get_current_time: Get the current server time
  • greet: Greet a person by name
  • ai_chat: Send prompts to Azure AI Foundry agent and get AI-powered responses

Resources

  • server-info: Information about the MCP server
  • documentation: Server documentation and usage examples

Prompts

  • math_helper: Get help with mathematical calculations
  • current_time: Get the current time

Prerequisites

  • Java 17 or higher
  • Maven 3.6+

Building the Server

Build the project using Maven:

mvn clean package

This will create an executable JAR file: target/mcp-server-java-1.0.0.jar

Running the Server

Run the server directly:

Export the Azure OpenAI API Key in Powershell : $env:AZURE_OPENAI_API_KEY="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
Check that the environment variable is set c:>echo $env:AZURE_OPENAI_API_KEY

🚀 Usage

Start HTTP Server:

java -jar target/mcp-server-java-1.0.0.jar --http

java -jar target/mcp-server-java-1.0.0.jar 

Run Java Server:

Working Solution Step 1: Start the HTTP Server (in one terminal) java -jar target/mcp-server-java-1.0.0.jar --http (need http server to be running first)

Run Java Client:

Step 2: Run the Java Client (in another terminal) mvn exec:java "-Dexec.mainClass=com.example.mcp.client.McpJavaClient"

NPX Node Package eXecute

nxp command to test over web page

npx @modelcontextprotocol/inspector java -jar target/mcp-server-java-1.0.0.jar create a npx test harness to check out and test the functionality !

Testing out the tools :

HTTP JSON API Server started successfully! API Endpoints: http://localhost:8080/tools - List available tools http://localhost:8080/tools/add - Add two numbers http://localhost:8080/tools/multiply - Multiply two numbers http://localhost:8080/tools/time - Get current time http://localhost:8080/tools/greet - Greet by name http://localhost:8080/tools/ai_chat - Chat with AI agent

List all tools

curl -X GET http://localhost:8080/tools

Add two numbers

curl -X POST http://localhost:8080/tools/add -H "Content-Type: application/json" -d '{"a":"7","b":"51"}'

Multiply two numbers

curl -X POST http://localhost:8080/tools/multiply -H "Content-Type: application/json" -d '{"x":"7","y":"70"}'

Get current time

curl -X GET http://localhost:8080/tools/time

Greet someone

curl -X POST http://localhost:8080/tools/greet -H "Content-Type: application/json" -d '{"name":"Steve"}'

Chat with AI Agent

curl -X POST http://localhost:8080/tools/ai_chat -H "Content-Type: application/json" -d '{"prompt": "What is Azure AI Foundry?"}'

curl -X POST http://localhost:8080/tools/ai_chat -H "Content-Type: application/json" -d '{"prompt": "Hello"}'

Chat with AI Agent with Optional Parameters

curl -X POST http://localhost:8080/tools/ai_chat -H "Content-Type: application/json" -d '{"prompt": "Explain Model Context Protocol in simple terms", "max_tokens": 200, "temperature": 0.5 }'

curl -X POST http://localhost:8080/tools/ai_chat -H "Content-Type: application/json" -d '{"prompt": "Write a haiku about coding", "max_tokens": 200, "temperature": 0.5 }'

🚀 Usage

Start HTTP Server:

java -jar target/mcp-server-java-1.0.0.jar --http

Start STDIO Server:

java -jar target/mcp-server-java-1.0.0.jar

git hub integration

in command prompt in git directory: git status On branch main nothing to commit, working tree clean PS C:\Users\stethompson\Microsoft\MCP_Server_Java> git init Reinitialized existing Git repository in C:/Users/stethompson/Microsoft/MCP_Server_Java/.git/ PS C:\Users\stethompson\Microsoft\MCP_Server_Java> git add . PS C:\Users\stethompson\Microsoft\MCP_Server_Java> git remote add origin https://github.com/SteveThompson_msftcae/MCP_SERVER_JAVA.git git remove -v (check remote exists) PS C:\Users\stethompson\Microsoft\MCP_Server_Java> git branch -M main PS C:\Users\stethompson\Microsoft\MCP_Server_Java> git push -u origin main info: please complete authentication in your browser... fatal: The request is not supported Username for 'https://github.com': (authenticated with code) PS C:\Users\stethompson\Microsoft\MCP_Server_Java> git push -u origin main Enumerating objects: 48, done. Counting objects: 100% (48/48), done. Delta compression using up to 8 threads Compressing objects: 100% (31/31), done. Writing objects: 100% (48/48), 23.38 KiB | 1.80 MiB/s, done. Total 48 (delta 8), reused 0 (delta 0), pack-reused 0 (from 0) remote: Resolving deltas: 100% (8/8), done. To https://github.com/SteveThompson_msftcae/MCP_SERVER_JAVA.git * [new branch] main -> main branch 'main' set up to track 'origin/main'.

With Claude Desktop

Add the server to your Claude Desktop configuration:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "mcp-server-java": {
      "command": "java",
      "args": [
        "-jar",
        "C:\\absolute\\path\\to\\target\\mcp-server-java-1.0.0.jar"
      ]
    }
  }
}

Replace the path with the absolute path to your JAR file.

With VS Code

The server is already configured in .vscode/mcp.json. After building:

  1. Open VS Code
  2. Press Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows)
  3. Select "MCP: Add server..."
  4. The server will be available to connect

Development

Project Structure

mcp-server-java/
├── src/
│   └── main/
│       └── java/
│           └── com/
│               └── example/
│                   └── mcp/
│                       ├── Main.java              # Entry point
│                       ├── ToolsProvider.java     # Tool implementations
│                       ├── ResourcesProvider.java # Resource implementations
│                       └── PromptsProvider.java   # Prompt implementations
├── .vscode/
│   └── mcp.json                  # VS Code MCP configuration
├── pom.xml                       # Maven configuration
└── README.md                     # This file

Adding New Tools

To add a new tool:

  1. Open src/main/java/com/example/mcp/ToolsProvider.java
  2. Add the tool definition in registerTools()
  3. Implement the tool logic in the switch statement

Example:

// In the list tools handler
Tool myTool = new Tool();
myTool.setName("my_tool");
myTool.setDescription("Description of what my tool does");
// ... set input schema
tools.add(myTool);

// In the call tool handler
case "my_tool":
    // Your implementation here
    break;

Adding New Resources

To add a new resource:

  1. Open src/main/java/com/example/mcp/ResourcesProvider.java
  2. Add the resource in registerResources()
  3. Implement the read handler for your resource URI

Testing with MCP Inspector

You can test your server using the MCP Inspector:

npx @modelcontextprotocol/inspector java -jar target/mcp-server-java-1.0.0.jar

Debugging

The server uses SLF4J for logging. Logs are written to stderr and will appear in your terminal or the client's log viewer.

To enable verbose logging, you can adjust the logging level in your slf4j configuration.

Learn More

License

MIT License - See LICENSE file for details

README copy captured when this server was indexed; it may lag the repository. The original is authoritative.

Questions

About JAVA

How do I install JAVA?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is JAVA safe to use with an AI agent?

Its trust score is 34 out of 100 (low). It passes 1 of the 1 static security checks run so far. It has no ConduID identity yet, so agent calls to it are not receipted.

Is JAVA still maintained?

Yes — the last commit was 2 months ago. The repository has 1 stars and 1 forks.