Skip to content

javieridcglobal/javier_mcp_tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCP Calculator Tool

A simple Model Context Protocol (MCP) stdio server implementing a calculator tool.

Building and Running

# Build the project
./gradlew build

# Run the server
java -jar build/libs/JaviMcp-1.0-SNAPSHOT.jar

Protocol

The server implements a simple MCP protocol with a calculator tool that supports addition, subtraction, multiplication, and division operations.

Tool Definition

On startup, the server sends an initialization message defining the available tools:

{
  "type": "init",
  "version": "1",
  "tools": {
    "calculator": {
      "description": "A simple calculator tool",
      "params": {
        "operation": {
          "type": "string",
          "description": "Operation to perform: add, subtract, multiply, or divide"
        },
        "a": {
          "type": "number",
          "description": "First operand"
        },
        "b": {
          "type": "number",
          "description": "Second operand"
        }
      }
    }
  }
}

Request Format

To use the calculator tool, send a request in the following format:

{
  "id": "request-id",
  "type": "tool_call",
  "params": {
    "name": "calculator",
    "params": {
      "operation": "add",
      "a": 5,
      "b": 3
    }
  }
}

Response Format

The server will respond with:

{
  "id": "request-id",
  "type": "tool_response",
  "status": "success",
  "result": 8
}

In case of an error:

{
  "id": "request-id",
  "type": "tool_response",
  "status": "error",
  "error": "Error message"
}

Example Usage

echo '{"id":"123","type":"tool_call","params":{"name":"calculator","params":{"operation":"add","a":5,"b":3}}}' | java -jar build/libs/JaviMcp-1.0-SNAPSHOT.jar

Expected output:

{"type":"init","version":"1","tools":{"calculator":{"description":"A simple calculator tool","params":{"operation":{"type":"string","description":"Operation to perform: add, subtract, multiply, or divide"},"a":{"type":"number","description":"First operand"},"b":{"type":"number","description":"Second operand"}}}}}
{"id":"123","type":"tool_response","status":"success","result":8.0}

Additional Tools

AskGemini Tool

This project also includes an AskGemini tool for intelligent project analysis powered by Google Gemini AI. The tool provides:

  • Intelligent Code Analysis: Ask questions about project architecture, design patterns, security, and performance
  • Configuration-Driven File Selection: Customize which files to analyze via AskGemini.config
  • External File Integration: Include files outside the project directory (configs, logs, documentation)
  • Comprehensive Logging: Track all analysis interactions with detailed context
  • Flexible Analysis Modes: Source-only or comprehensive file analysis

Quick Example

{
  "project_folder": "/path/to/your/project",
  "question": "What is the main purpose of this application?",
  "context": "This is a microservice for user authentication",
  "extra_files": "/etc/config.yml;../deployment/docker-compose.yml"
}

Documentation

The AskGemini tool is perfect for:

  • Code reviews and security analysis
  • Understanding unfamiliar codebases
  • Architecture documentation and analysis
  • Performance optimization recommendations
  • Migration planning and dependency analysis

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages