maven-mcp is kirich1409's open-source project on GitHub (MIT license), providing Maven and Gradle dependency intelligence for AI coding agents. It is both an MCP server and an agent plugin for Claude Code, Grok Build, Cursor, and Codex.
Uses
- Query artifact versions (latest version, available versions)
- Scan projects for outdated dependencies
- Check dependencies for vulnerabilities (CVEs)
- Retrieve changelogs
- Dependency intelligence related to licenses and project audits
Main capabilities
- Bundles a single-file Python 3 MCP server (plugin/server/server.py), using MCP over stdio (JSON-RPC 2.0 over stdin/stdout), or communicating via a stateless Streamable HTTP endpoint.
- Uses only the Python standard library, with zero pip dependencies.
- The plugin registers the server via .mcp.json (Claude Code, Grok Build) and mcp.json (Cursor, Codex), with the command always python3.
- Version queries use the repositories declared in the build files; when no repository is declared in that scope, Maven Central, Google Maven, and the Gradle Plugin Portal are used. Private repositories require credentials.
- Gradle scanning runs the project wrapper once, reads the production runtime classpath (*RuntimeClasspath), then merges sources declared in the build files and version catalogs.
- Maven scanning reads pom.xml locally.
- The pre-edit hook pre-edit-deps.sh runs before editing Gradle, Maven, or version catalog files, and can intercept coordinates suspected of being hallucinated or flagged as malicious, and can prompt about critical/high CVEs, typosquatted package names, or toolchain mismatches; post-edit-deps.sh reminds you to run /check-deps. Both are fail-open: if jq, timeout/gtimeout is missing, or the server errors, the edit is allowed.
- Claude Code has a context budget for the names and descriptions of installed skills (about the model context window's 1%), and descriptions are dropped when they overflow; therefore, only workflow skills that go beyond a single tool call remain model-routed, while the rest are manual invocation (disable-model-invocation: true), but the slash commands and underlying MCP tools remain unchanged.
Usage
- Supported build systems: Gradle (build.gradle, build.gradle.kts, settings.gradle, settings.gradle.kts), Maven (pom.xml), version catalogs (gradle/libs.versions.toml).
- Python 3.9+ must be on PATH; the server uses only the standard library.
- jq and timeout/gtimeout are used by the write-time hooks; on macOS, timeout comes from brew install coreutils (gtimeout). Without these the hooks do not take effect, and editing proceeds as usual; the MCP server itself does not need them.
- Claude Code and Grok Build are installed via the marketplace, and require --trust to run the bundled MCP server and write guard hooks; after installation, reload the plugin or start a new session.
- Cursor and Codex are installed via npx plugins, and the CLI detects installed agents and installs each one. Under plugin/, three manifests are provided for the same set of skills, server, and hook scripts; a root plugin.json (Agent Plugins 1.0 manifest) is deliberately not provided, to avoid Codex loading it through its Agent Plugins loader and silently disabling all hooks.
- For local paths (development), the plugin automatically registers the bundled server via .mcp.json, with no separate installation or build required.
- Non-plugin clients use uv (uvx maven-mcp, or run maven-mcp after uv tool install maven-mcp). uv downloads Python 3.9+, and local Claude Code, Codex, and Grok do not come with uv preinstalled; the Claude Code cloud VM already has Python and uv; Web ChatGPT cannot spawn local processes and is HTTP-only.
- With any MCP client compatibility: Codex, Cursor, Claude Desktop, Gemini CLI, and Kimi can all run the published console script, with the command uvx maven-mcp.
- Kimi Code configuration is located at ~/.kimi-code/mcp.json (user-level) or .kimi-code/mcp.json (project-level), using the mcpServers object, with command as uvx and args as ["maven-mcp"]; Cursor uses ~/.cursor/mcp.json, Claude Desktop uses claude_desktop_config.json, Gemini CLI uses ~/.gemini/settings.json, and Codex uses ~/.codex/config.toml. Environment variables (such as GITHUB_TOKEN, MAVEN_MCP_OFFLINE) can be passed in via each client's env field.
- HTTP mode (remote/cloud proxy): after starting the server, the MCP endpoint is http://<host>:<port>/mcp (a single POST endpoint, JSON responses, no SSE). Kimi Code uses the url field, Gemini CLI uses the httpUrl field, and Codex sets url in config.toml. MAVEN_MCP_HTTP_HOST defaults to 127.0.0.1, and MAVEN_MCP_HTTP_PORT defaults to 8765. HTTP transport has no authentication; bind only to localhost or a trusted network; if it needs to be exposed to a cloud proxy on the internet, it should be placed behind a reverse proxy that terminates TLS and enforces authentication.
Applicable scenarios and limitations
- Suitable for Java projects built with Gradle or Maven, used with MCP-supporting AI coding agents for dependency upgrades, vulnerability investigation, and auditing.
- HTTP transport itself has no authentication and defaults to localhost only; private repositories require credentials; the pre-edit hook is fail-open; the hook depends on jq and timeout/gtimeout, and does not take effect if they are missing.
- Codex will still apply apply_patch after deny. npm, Homebrew, and MCPB bundle are not installation channels.
- Contribution branches start from develop, and the coding agent contract is described in AGENTS.md; releases are dispatched as Release on main. The license is MIT, see LICENSE for details.