mcp-javadoc-search

DynoDynoDynoDyno/mcp-javadoc-search

3.3

If you are the rightful owner of mcp-javadoc-search and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

An MCP server for efficient searching of EternalClient API JavaDocs.

Tools
5
Resources
0
Prompts
0

MCP JavaDoc Search

An MCP (Model Context Protocol) server that provides efficient searching capabilities for EternalClient API JavaDocs.

Features

  • Full-text search across classes, methods, and packages
  • Fuzzy matching for flexible search queries
  • Multiple search tools:
    • search_all: Search across all documentation
    • search_classes: Search specifically for classes
    • search_methods: Search for methods (with optional class filtering)
    • get_class_details: Get detailed information about a specific class
    • list_packages: List and filter available packages
  • URL generation for direct links to JavaDoc pages
  • Efficient indexing using Fuse.js for fast searches

Installation

  1. Clone or copy this directory to your machine
  2. Install dependencies:
    cd mcp-javadoc-search
    npm install
    
  3. Build the TypeScript code:
    npm run build
    

Setup

  1. Make sure the javadocs_complete.json file is in the parent directory of the MCP server

  2. Add the server to your Claude Code configuration:

    Edit your Claude Code settings file (usually ~/Library/Application Support/Claude/claude_code_config.json on macOS):

    {
      "mcpServers": {
        "javadoc-search": {
          "command": "node",
          "args": ["/path/to/mcp-javadoc-search/dist/index.js"],
          "env": {}
        }
      }
    }
    

    Or if you prefer to use npm start:

    {
      "mcpServers": {
        "javadoc-search": {
          "command": "npm",
          "args": ["start"],
          "cwd": "/path/to/mcp-javadoc-search",
          "env": {}
        }
      }
    }
    

Usage

Once configured, you can use the following tools in Claude:

Search All

Search across classes, methods, and packages:

Use the search_all tool with query "AbstractEvent"

Search Classes

Search specifically for classes:

Use the search_classes tool with query "Event" and limit 5

Search Methods

Search for methods, optionally filtered by class:

Use the search_methods tool with query "setEventTimeout" and className "AbstractEvent"

Get Class Details

Get detailed information about a specific class:

Use the get_class_details tool with className "Package net.eternalclient.api.events.AbstractEvent"

List Packages

List all packages or filter by name:

Use the list_packages tool with filter "events"

Development

  • Run in development mode: npm run dev
  • Build: npm run build
  • The server uses TypeScript and ES modules
  • Search indexing is performed on startup using Fuse.js

Testing

The project includes comprehensive unit and integration tests:

Run Tests

# Run all tests
npm test

# Run tests once (no watch mode)
npm run test:run

# Run tests with coverage
npm run test:coverage

Test the Server Manually

# Build first
npm run build

# Run the interactive test script
node test-server.js

This will:

  • Start the MCP server
  • Send test requests for all available tools
  • Display the results
  • Verify the server is working correctly

How It Works

  1. Data Loading: The server loads the javadocs_complete.json file on startup
  2. Index Building: Creates three separate Fuse.js indices for classes, methods, and packages
  3. Search: Uses fuzzy matching with configurable thresholds
  4. URL Generation: Automatically generates links to the online JavaDoc pages

Search Examples

  • Find a class: "AbstractEvent", "ClientMode", "AccountSettings"
  • Find methods: "setEventTimeout", "onLoop", "getValue"
  • Find packages: "events", "utilities", "wrappers"
  • Partial matches work: "Event" will find "AbstractEvent", "ClientModeEvent", etc.

Troubleshooting

  • Server not found: Make sure the path in your Claude Code config is correct
  • No results: Try broader search terms or check if the JavaDoc data file exists
  • Build errors: Ensure you have Node.js 16+ and have run npm install

License

MIT