Logo de Maven Indexer MCP Server

Maven Indexer MCP Server

Comunidade
tangcent

MCP server that indexes local Maven and Gradle caches so AI agents can search classes, implementations, method signatures, and source code from internal/private Java dependencies.

Publicado portangcent
Repositóriomaven-indexer-mcp
IdiomaTypeScript
Forks
4
Estrelas
23
Ferramentas disponíveis
4
Tipo de transportestdio
Categorias
LicençaISC
Links
  • Conecte ferramentas a fluxos de trabalho de IA

    Maven Indexer MCP Server disponibiliza recursos MCP que podem ser usados por clientes e agentes de IA compatíveis.

  • Ferramentas disponíveis: 4

    Confira abaixo as ações que o cliente MCP pode executar, com nomes e descrições quando fornecidos pelo servidor.

  • Configuração pronta para copiar

    Use os exemplos de instalação para configurar este servidor no seu cliente MCP preferido.

  • Indicadores da comunidade de código aberto

    Estrelas: 23 e forks: 4 no repositório vinculado.

Maven Indexer MCP Server

npm version Tests

A Model Context Protocol (MCP) server that indexes your local Maven repository (~/.m2/repository) and Gradle cache ( ~/.gradle/caches/modules-2/files-2.1) to provide AI agents with tools to search for Java classes, method signatures, and source code.

Key Use Case: While AI models are well-versed in popular public libraries (like Spring, Apache Commons, Guava), they often struggle with:

  1. Internal Company Packages: Private libraries that are not public.
  2. Non-Well-Known Public Packages: Niche or less popular open-source libraries.

This server bridges that gap by allowing the AI to "read" your local dependencies, effectively giving it knowledge of your private and obscure libraries.

Features

  • Semantic Class Search: Search for classes by name or purpose.
  • Inheritance Search: Find all implementations of an interface or subclasses of a class.
  • On-Demand Analysis: Extracts method signatures and Javadocs directly from JARs.
  • Source Code Retrieval: Provides full source code if available.
  • Real-time Monitoring: Automatically updates the index when repositories change.

Maven Indexer MCP vs Maven Indexer CLI

This package provides an MCP interface into the Maven/Gradle index. If you are using a coding agent in the terminal, you might benefit from using the CLI + SKILL instead.

  • CLI: Modern coding agents increasingly favor CLI-based workflows exposed as SKILLs over MCP because CLI invocations are more token-efficient: they avoid loading large tool schemas into the model context, allowing agents to act through concise, purpose-built commands. This makes CLI + SKILLs better suited for high-throughput coding agents that must balance dependency lookups with large codebases and reasoning within limited context windows.Learn more about Maven Indexer CLI with SKILLS.

  • MCP: MCP remains the better choice for IDE-integrated agents (Cursor, Kiro, Windsurf, etc.) that benefit from persistent background indexing, automatic repository watching, and seamless tool invocation without any CLI setup. The MCP server indexes your repository in the background and keeps the index up to date automatically.

Getting Started

Add the following config to your MCP client:

json
{
  "mcpServers": {
    "maven-indexer": {
      "command": "npx",
      "args": [
        "-y",
        "maven-indexer-mcp@latest"
      ]
    }
  }
}

This will automatically download and run the latest version of the server. It will auto-detect your Maven repository location (usually ~/.m2/repository) and Gradle cache.

MCP Client configuration

Follow Cline's MCP guide and use the config provided above.

Follow the configure MCP guide using the standard config from above.

Click the button to install:

Cursor

Or install manually:

Go to Cursor Settings -> MCP -> New MCP Server. Use the config provided above.

Go to Settings | Tools | AI Assistant | Model Context Protocol (MCP) -> Add. Use the config provided above. The same way maven-indexer can be configured for JetBrains Junie in Settings | Tools | Junie | MCP Settings ->Add. Use the config provided above.

In Kiro Settings, go to Configure MCP > Open Workspace or User MCP Config > Use the configuration snippet provided above.

Or, from the IDE Activity Bar > Kiro > MCP Servers > Click Open MCP Config. Use the configuration snippet provided above.

In Qoder Settings, go to MCP Server > + Add > Use the configuration snippet provided above.

Alternatively, follow the MCP guide and use the standard config from above.

Go to Settings -> MCP -> + Add -> Add Manually to add an MCP Server. Use the config provided above.

Follow the configure MCP guide using the standard config from above.

Your first prompt

Enter the following prompt in your MCP Client to check if everything is working:

text
Find the class `StringUtils` in my local maven repository and show me its methods.

Your MCP client should read the class StringUtils from your local Maven repository and show its methods.

Configuration (Optional)

If the auto-detection fails, or if you want to filter which packages are indexed, you can add environment variables to the configuration:

  • MAVEN_REPO: Absolute path to your local Maven repository (e.g., /Users/yourname/.m2/repository). Use this if your repository is in a non-standard location.
  • GRADLE_REPO_PATH: Absolute path to your Gradle cache (e.g., /Users/yourname/.gradle/caches/modules-2/files-2.1).
  • INCLUDED_PACKAGES: Comma-separated list of package patterns to index (e.g., com.mycompany.*,org.example.*). Default is * (index everything).
  • MAVEN_INDEXER_CFR_PATH: (Optional) Absolute path to a specific CFR decompiler JAR. If not provided, the server will attempt to use its bundled CFR version.
  • VERSION_RESOLUTION_STRATEGY: (Optional) Strategy to choose the version when multiple versions of an artifact are found and no specific coordinate is provided.
    • semver: (Default) Prefer the highest semantic version (e.g. 1.2.0 > 1.1.9).
    • latest-published: Prefer the version with the latest publish time (checks *.pom.lastUpdated first, then file modification time).
    • latest-used: Prefer the version most recently imported/used by the user (based on file creation time).

Example with optional configuration:

json
{
  "mcpServers": {
    "maven-indexer": {
      "command": "npx",
      "args": [
        "-y",
        "maven-indexer-mcp@latest"
      ],
      "env": {
        "MAVEN_REPO": "/Users/yourname/.m2/repository",
        "GRADLE_REPO_PATH": "/Users/yourname/.gradle/caches/modules-2/files-2.1",
        "INCLUDED_PACKAGES": "com.mycompany.*",
        "MAVEN_INDEXER_CFR_PATH": "/path/to/cfr-0.152.jar",
        "VERSION_RESOLUTION_STRATEGY": "semver"
      }
    }
  }
}

Local Development

If you prefer to run from source:

  1. Clone the repository:

    bash
    git clone https://github.com/tangcent/maven-indexer-mcp.git
    cd maven-indexer-mcp
  2. Install dependencies and build:

    bash
    npm install
    npm run build
  3. Use the absolute path in your config:

    json
    {
      "mcpServers": {
        "maven-indexer": {
          "command": "node",
          "args": ["/absolute/path/to/maven-indexer-mcp/build/index.js"]
        }
      }
    }

Available Tools

  • search_classes: Search for Java classes in the local Maven repository and Gradle caches.
    • WHEN TO USE: 1. Internal/Private Code: You need to find a class from a company-internal library. 2. Obscure Libraries: You are using a less common public library that the AI doesn't know well. 3. Version Verification: You need to check exactly which version of a class is present locally.

      • Note: For well-known libraries (e.g., standard Java lib, Spring), the AI likely knows the class structure already, so this tool is less critical.
    • Examples: "Show me the source of StringUtils", "What methods are available on DateTimeUtils?", "Where is this class imported from?".

    • Input: className (e.g., "StringUtils", "Json parser")

    • Output: List of matching classes with their artifacts.

  • get_class_details: Decompile and read the source code of external libraries/dependencies. Use this instead of 'SearchCodebase' for classes that are imported but defined in JAR files.
    • Key Value: "Don't guess what the internal library does—read the code."
    • Tip: Essential for internal/proprietary code where documentation is scarce or non-existent.
    • Input: className (required), artifactId (optional), type ("signatures", "docs", "source")
    • Output: Method signatures, Javadocs, or full source code.
    • Note: If artifactId is omitted, the tool automatically selects the best available artifact (preferring those with source code attached).
  • search_artifacts: Search for artifacts in Maven/Gradle caches by coordinate (groupId, artifactId).
  • search_implementations: Search for classes that implement a specific interface or extend a specific class. Useful for finding SPI implementations in external libraries.
    • Input: className (e.g. "java.util.List")
    • Output: List of implementation/subclass names and their artifacts.
  • refresh_index: Trigger a re-scan of the Maven repository.

Development

  • Run tests: npm test
  • Watch mode: npm run watch

License

ISC

Instalação

TypingMind
{
  "mcpServers": {
    "maven-indexer-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "maven-indexer-mcp@latest"
      ]
    }
  }
}

Ferramentas disponíveis

  • search_artifacts

    Search for artifacts in the local Maven repository

  • search_classes

    Search for Java classes. Can be used to find classes by name or to find classes for a specific purpose (by searching keywords in class names).

  • get_class_details

    Get details about a specific class from an artifact, including method signatures and javadocs (if source is available).

  • refresh_index

    Trigger a re-scan of the Maven repository

Use o MCP de Maven Indexer MCP Server com vários modelos de IA

O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho. Assim, após conectar Maven Indexer MCP Server, é possível usá-lo com diferentes modelos de IA no TypingMind, em vez de configurá-lo separadamente para cada modelo. Este MCP é executado localmente no seu dispositivo por meio do conector MCP do TypingMind.

Guia de configuração para usar o conector local

Use esta opção quando o servidor MCP precisar acessar arquivos locais, aplicativos ou recursos privados no seu computador.

1

Abra as configurações de MCP

No TypingMind, acesse Configurações > Configurações avançadas > Model Context Protocol e selecione Configurar conector.

  1. Abra o TypingMind no navegador.
  2. Clique no ícone de Configurações.
  3. Acesse Configurações avançadas.
  4. Abra a seção Model Context Protocol.
  5. Clique em Configurar conector e selecione Este dispositivo.
Tela de configuração do conector MCP do TypingMind com a opção Este dispositivo selecionada
2

Execute o comando do conector

Selecione Este dispositivo, copie o comando do TypingMind e execute-o no Terminal. Mantenha o processo em execução enquanto usa o MCP.

  1. Copie o comando de configuração exibido pelo TypingMind.
  2. Abra o Terminal no macOS ou o Windows Terminal no Windows.
  3. Cole e execute o comando.
  4. Autorize a instalação do pacote se o Terminal pedir confirmação para continuar.
  5. Mantenha o processo em execução na janela do Terminal enquanto usa as ferramentas MCP.
3

Adicione Maven Indexer MCP Server como servidor

Quando o status do conector for Pronto, clique em Editar servidores e cole a configuração do servidor MCP.

  1. Aguarde até que o status do conector mostre Pronto.
  2. Clique em Editar servidores.
  3. Cole a configuração do servidor MCP de Maven Indexer MCP Server.
  4. Salve a lista de servidores.
  5. Se quiser confirmar que o conector ainda está pronto para uso, atualize a página.
Configurações de MCP do TypingMind mostrando um servidor ativo e o botão Editar servidores
{
  "mcpServers": {
    "maven-indexer-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "maven-indexer-mcp"
      ]
    }
  }
}
4

Use a conexão com diferentes modelos

Salve a lista de servidores, abra Plugins, ative as ferramentas MCP de Maven Indexer MCP Server, selecione qualquer modelo de IA compatível no TypingMind e use as ferramentas no chat ou atribua-as a um agente de IA.

  1. Abra a página Plugins no TypingMind.
  2. Ative as ferramentas MCP de Maven Indexer MCP Server.
  3. Inicie um chat e escolha o modelo de IA que deseja usar.
  4. Use as ferramentas MCP no chat ou atribua-as a um agente de IA.
  5. Mude para outro modelo de IA sempre que necessário, sem reconectar o MCP.
Chat do TypingMind usando ferramentas MCP ativadas com um modelo de IA selecionado
Pode usar Maven Indexer MCP Server para me ajudar nesta tarefa?
Maven Indexer MCP Server
Claro. Já li.
Veja o que encontrei usando Maven Indexer MCP Server.

Perguntas frequentes

Para que serve o servidor MCP Maven Indexer MCP Server?

Maven Indexer MCP Server é um servidor MCP que permite que aplicativos de IA compatíveis se conectem a ferramentas externas e informações de contexto. No TypingMind, basta adicionar esse servidor MCP uma vez para disponibilizar suas ferramentas no seu espaço de trabalho com IA.

Posso usar o MCP Maven Indexer MCP Server com vários modelos de IA no TypingMind?

Sim. O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho, permitindo usar Maven Indexer MCP Server com diferentes modelos de IA, como Claude, ChatGPT, Gemini ou outros modelos configurados no TypingMind, sem configurar o servidor MCP separadamente para cada modelo.

Por que usar o MCP Maven Indexer MCP Server com o TypingMind?

O TypingMind é uma das melhores interfaces de chat com LLMs porque reúne vários modelos de IA, prompts, plugins, agentes de IA, chaves de API e ferramentas MCP em um só espaço de trabalho. Com Maven Indexer MCP Server conectado, é possível usar suas ferramentas MCP nos seus modelos preferidos e manter seu fluxo de trabalho de chat organizado no TypingMind.

Como conecto o MCP Maven Indexer MCP Server ao TypingMind?

Maven Indexer MCP Server funciona por meio do conector MCP local do TypingMind. Essa é a melhor opção quando o servidor MCP precisa acessar arquivos locais, apps de desktop, ferramentas de linha de comando ou recursos privados no seu computador.

Quais ferramentas o MCP Maven Indexer MCP Server oferece no TypingMind?

Número de ferramentas MCP disponíveis em Maven Indexer MCP Server: 4. É possível ativá-las na página Plugins do TypingMind e usá-las no chat ou atribuí-las a agentes de IA.

Preciso compartilhar minhas chaves de API com o TypingMind para usar o MCP Maven Indexer MCP Server?

Não. O TypingMind prioriza o uso local e permite manter seus provedores de modelos, chaves de API, prompts e configuração MCP sob seu controle. Se Maven Indexer MCP Server exigir autenticação, adicione os cabeçalhos, as configurações OAuth ou a configuração local exigidos por esse servidor MCP ao criar a conexão.

Servidores MCP relacionados

Ver lista completa

Crie seu próprio espaço de trabalho com IA agora

Inscreva-se na nossa newsletter para receber avisos sobre novos recursos e futuros sorteios 👇