Sponsored by Deepsite.site

Maven Repository MCP Server

Created By
Yanick-Salzmann7 months ago
Content

Maven Repository MCP Server

A Model Context Protocol (MCP) server that provides comprehensive functionality to search and interact with Maven artifacts from mvnrepository.com and Maven Central.

🚀 Features

  • Search Maven Artifacts: Find Maven artifacts by keyword with detailed results
  • Version Management: Retrieve all available versions for any artifact
  • Dependency Management: Get ready-to-use dependency snippets for Maven, Gradle, and SBT
  • POM Access: Fetch complete POM.xml files directly from Maven Central
  • Multiple Transports: Support for both stdio and SSE (Server-Sent Events) protocols
  • Rate Limiting: Built-in intelligent rate limiting to respect mvnrepository.com

📋 Prerequisites

  • Node.js 18+
  • npm or yarn package manager

🛠️ Installation & Setup

  1. Clone and install dependencies:

    git clone <repository-url>
    cd mvn-repository-mcp-server
    npm install
    
  2. Build the project:

    npm run build
    
  3. Run the server:

    npm start
    

🚀 Usage

Transport Protocols

The server supports two communication protocols:

stdio Transport (Default)

Perfect for local development and MCP client integration:

# Using npm scripts
npm run start:stdio
npm run dev:stdio

# Direct execution
node dist/index.js stdio
node dist/index.js  # stdio is default

SSE Transport

Ideal for web-based clients and HTTP integration:

# Using npm scripts (port 3000)
npm run start:sse
npm run dev:sse

# Direct execution
node dist/index.js sse
node dist/index.js sse --port 8080  # custom port

SSE Endpoints:

  • SSE stream: http://localhost:<port>/sse
  • Message posting: http://localhost:<port>/message

Available Tools

1. search_maven_artifacts

Search for Maven artifacts using keywords.

Parameters:

  • query (string, required): Search term for Maven artifacts
  • maxResults (number, optional): Maximum results to return (default: 10)

Example:

{
  "name": "search_maven_artifacts",
  "arguments": {
    "query": "spring-boot-starter",
    "maxResults": 5
  }
}

2. get_artifact_versions

Retrieve all available versions for a specific artifact.

Parameters:

  • groupId (string, required): Maven group ID (e.g., 'org.springframework.boot')
  • artifactId (string, required): Maven artifact ID (e.g., 'spring-boot-starter')

Example:

{
  "name": "get_artifact_versions",
  "arguments": {
    "groupId": "junit",
    "artifactId": "junit"
  }
}

3. get_pom_xml

Fetch the complete POM.xml file for a specific artifact version.

Parameters:

  • groupId (string, required): Maven group ID
  • artifactId (string, required): Maven artifact ID
  • version (string, required): Specific version

Example:

{
  "name": "get_pom_xml",
  "arguments": {
    "groupId": "org.apache.commons",
    "artifactId": "commons-lang3",
    "version": "3.12.0"
  }
}

4. get_dependency_snippets

Generate dependency declarations for Maven, Gradle, and SBT.

Parameters:

  • groupId (string, required): Maven group ID
  • artifactId (string, required): Maven artifact ID
  • version (string, required): Specific version

Example:

{
  "name": "get_dependency_snippets",
  "arguments": {
    "groupId": "com.fasterxml.jackson.core",
    "artifactId": "jackson-core",
    "version": "2.15.2"
  }
}

🔧 Development

Available Scripts

  • npm run build - Compile TypeScript to JavaScript
  • npm run build:watch - Watch mode compilation
  • npm run start - Run compiled server (stdio transport)
  • npm run start:stdio - Explicitly use stdio transport
  • npm run start:sse - Use SSE transport (port 3000)
  • npm run dev:stdio - Build and run with stdio
  • npm run dev:sse - Build and run with SSE
  • npm run clean - Remove compiled files

Project Structure

mvn-repository-mcp-server/
├── src/
│   ├── index.ts      # Main server entry point & CLI
│   ├── types.ts      # TypeScript interfaces
│   └── searcher.ts   # Core search & retrieval logic
├── dist/             # Compiled JavaScript output
├── package.json      # Project configuration
├── tsconfig.json     # TypeScript configuration
└── README.md         # This file

🎯 Use Cases

For AI Assistants

  • Dependency Discovery: Help users find appropriate Maven dependencies
  • Version Management: Assist with dependency version selection and updates
  • Build File Generation: Generate dependency blocks for different build tools
  • Security Analysis: Identify artifacts with known vulnerabilities

For Developers

  • Quick Search: Rapidly find Maven artifacts without opening a browser
  • Dependency Analysis: Examine POM files and dependency structures
  • Multi-Build Support: Get snippets for Maven, Gradle, and SBT simultaneously
  • Version Comparison: Compare different versions of the same artifact

Integration Examples

With AI Coding Assistants:

User: "Find me the latest Spring Boot starter for web development"
Assistant: Uses search_maven_artifacts → "spring-boot-starter-web"
Assistant: Uses get_dependency_snippets → Provides Maven/Gradle configs

For Dependency Updates:

User: "Check if there are newer versions of JUnit available"
Assistant: Uses get_artifact_versions → Lists all JUnit versions with dates
Assistant: Highlights latest stable version and any security considerations

⚙️ Configuration

Rate Limiting

The server includes intelligent rate limiting to respect mvnrepository.com:

  • Minimum 3 seconds between requests
  • Additional random delay of 2-6 seconds
  • Automatic retry with exponential backoff on 403 errors

Timeout Settings

  • Default request timeout: 30 seconds
  • Maven Central POM requests: 15 seconds
  • Maximum of 3 retry attempts for failed requests

🔍 Troubleshooting

Common Issues

403 Access Denied Errors:

  • The server implements rate limiting to prevent this
  • If encountered, the server will automatically retry with backoff
  • Consider reducing request frequency if issues persist

Network Timeouts:

  • Check internet connectivity
  • Verify mvnrepository.com accessibility
  • Consider firewall or proxy settings

SSE Connection Issues:

  • Ensure the specified port is available
  • Check firewall settings for the chosen port
  • Verify no other services are using the same port

Debug Mode

Set environment variable for verbose logging:

DEBUG=mvn-repository-mcp-server npm start

🤝 Contributing

Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.

Development Setup

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
CursorThe AI Code Editor
Tavily Mcp
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Amap Maps高德地图官方 MCP Server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Serper MCP ServerA Serper MCP Server
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Playwright McpPlaywright MCP server
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
WindsurfThe new purpose-built IDE to harness magic
ChatWiseThe second fastest AI chatbot™
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
DeepChatYour AI Partner on Desktop