Nexus

io.github.addozhang由 GitHub 账号 addozhang 发布v0.1.1更新于 Oct 24, 2026

Query Sonatype Nexus Repository (OSS/Pro) for Maven, Python, and Docker artifacts

概览

AI 生成的概览

只读 MCP 服务器,让助手查询 Sonatype Nexus Repository Manager 3 中的 Maven、Python 和 Docker 制品。

可以做什么
搜索 Maven 制品并按分页列出某个制品的所有版本,可按 group、artifact 和仓库筛选。搜索 Python 包并按分页列出其版本。列出仓库中的 Docker 镜像,并获取指定镜像的所有标签。六个工具全部只读取 Nexus REST API,不提供创建、更新或删除操作。
适用场景
当你使用自建的 Nexus Repository Manager 3(OSS 或 Pro),并希望助手在添加依赖或部署前确认存在哪些制品、包或镜像版本时适用。若只使用公共仓库或没有 Nexus 实例,则无需安装。
运行要求
需要一个可通过网络访问的 Nexus Repository Manager 3.x 实例,以及对该仓库有读取权限的 Nexus 账号。服务器是本地运行的 Python 包(nexus-mcp-server)或 Docker 镜像,监听主机和端口(默认 0.0.0.0:8000),使用 SSE 或 streamable-http 传输。凭据通过 X-Nexus-Url、X-Nexus-Username 和 X-Nexus-Password 请求头逐次传入,或使用 NEXUS_BASE_URL、NEXUS_USERNAME 和 NEXUS_PASSWORD。
安装前请注意
服务器需要 Nexus 凭据:X-Nexus-Password 请求头或 NEXUS_PASSWORD 密钥,它们会保存在 MCP 客户端配置中并随每次请求发送。可选的 X-Nexus-Verify-SSL 请求头设为 false 会关闭证书校验,仅应对可信的自签名实例使用。默认绑定地址 0.0.0.0 会在所有网络接口上暴露服务,建议尽量限制为 localhost。所有工具均为只读,不会修改 Nexus 中的数据。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Nexus,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Nexus MCP Server

English | 简体中文

MCP (Model Context Protocol) server for Sonatype Nexus Repository Manager 3 (OSS and Pro), enabling AI assistants to query Maven, Python (PyPI), and Docker repositories.

Features

  • Multiple transport modes - SSE (default) or streamable-http transport
  • HTTP streaming transport - Modern SSE-based transport with header authentication
  • Per-request authentication - Credentials passed via HTTP headers (no hardcoded secrets)
  • Maven support - Search artifacts, list versions, get metadata
  • Python support - Search packages, list versions, get metadata
  • Docker support - List images, get tags, image metadata
  • FastMCP framework - Fast, modern Python implementation

Compatibility

Supported Nexus versions:

  • ✅ Nexus Repository Manager 3.x OSS (Open Source)
  • ✅ Nexus Repository Manager 3.x Pro

This server uses the standard Nexus REST API v1 (/service/rest/v1), which is available in both OSS and Pro editions.

Available Tools

This MCP server provides 6 read-only tools for querying Nexus repositories:

📦 Maven Tools

ToolDescriptionParameters
search_maven_artifactSearch for Maven artifactsgroup_id, artifact_id, version, repository
get_maven_versionsGet all versions of a Maven artifact (paginated)group_id, artifact_id, repository, page_size, continuation_token

🐍 Python/PyPI Tools

ToolDescriptionParameters
search_python_packageSearch for Python packagesname, repository
get_python_versionsGet all versions of a Python package (paginated)package_name, repository, page_size, continuation_token

🐳 Docker Tools

ToolDescriptionParameters
list_docker_imagesList all Docker images in a repositoryrepository
get_docker_tagsGet all tags for a Docker imagerepository, image_name

Note: All tools are read-only and safe to use. No write operations (create/update/delete) are supported.

Installation

From Source

bash
# Clone the repositorygit clone https://github.com/your-org/nexus-mcp-server.gitcd nexus-mcp-server
# Create virtual environmentpython -m venv venvsource venv/bin/activate  # or venv/bin/activate.fish
# Install in development modepip install -e ".[dev]"
# Run the server (defaults to http://0.0.0.0:8000)python -m nexus_mcp

Using Docker

bash
# Quick startdocker run -p 8000:8000 addozhang/nexus-mcp-server:latest
# Or use docker-composedocker-compose up
# See DOCKER.md for detailed deployment guide

For detailed deployment guide, see DOCKER.md.

Configuration

Server Configuration

The server can be configured using command line arguments or environment variables:

VariableCLI ArgumentDescriptionDefault
NEXUS_MCP_HOST--hostHost to bind to0.0.0.0
NEXUS_MCP_PORT--portPort to listen on8000
NEXUS_MCP_TRANSPORT--transportTransport mode (sse or streamable-http)sse

Priority: CLI arguments > Environment variables > Default values

Transport Modes:

  • sse (default) - Server-Sent Events transport, compatible with most MCP clients
  • streamable-http - Streamable HTTP transport for clients that prefer this protocol

Running the Server

Local Development
bash
# SSE mode (default)python -m nexus_mcp
# Streamable-HTTP modepython -m nexus_mcp --transport streamable-http
# Custom portpython -m nexus_mcp --port 9000
# Custom host and portpython -m nexus_mcp --host 127.0.0.1 --port 9000
Using Docker
bash
# SSE mode (default)docker run -p 8000:8000 addozhang/nexus-mcp-server:latest
# Streamable-HTTP modedocker run -e NEXUS_MCP_TRANSPORT=streamable-http -p 8000:8000 addozhang/nexus-mcp-server:latest
# Custom portdocker run -e NEXUS_MCP_PORT=9000 -p 9000:9000 addozhang/nexus-mcp-server:latest
# Or use docker-composedocker-compose up
# See DOCKER.md for detailed deployment guide

For detailed deployment guide, see DOCKER.md.

Authentication via HTTP Headers

Credentials are passed as HTTP headers with each request:

HeaderDescriptionExampleRequired
X-Nexus-UrlNexus instance URLhttps://nexus.company.comYes
X-Nexus-UsernameUsernameadminYes
X-Nexus-PasswordPasswordsecret123Yes
X-Nexus-Verify-SSLVerify SSL certificatesfalseNo (default: true)

Note: Set X-Nexus-Verify-SSL: false when connecting to self-hosted Nexus instances with self-signed certificates.

MCP Client Configuration (Claude Desktop)

Add to your Claude Desktop configuration (~/.config/claude/claude_desktop_config.json):

json
{  "mcpServers": {    "nexus": {      "url": "http://localhost:8000/mcp",      "headers": {        "X-Nexus-Url": "https://nexus.company.com",        "X-Nexus-Username": "admin",        "X-Nexus-Password": "secret123"      }    }  }}

For self-signed certificates:

json
{  "mcpServers": {    "nexus": {      "url": "http://localhost:8000/mcp",      "headers": {        "X-Nexus-Url": "https://nexus.company.com",        "X-Nexus-Username": "admin",        "X-Nexus-Password": "secret123",        "X-Nexus-Verify-SSL": "false"      }    }  }}

MCP Client Configuration (Other Clients)

For other MCP clients that support HTTP transport:

json
{  "url": "http://localhost:8000/mcp",  "headers": {    "X-Nexus-Url": "https://nexus.company.com",    "X-Nexus-Username": "your-username",    "X-Nexus-Password": "your-password"  }}

MCP Tools

Maven Tools

ToolDescriptionParameters
search_maven_artifactSearch Maven repositoriesgroup_id, artifact_id, version, repository
get_maven_versionsGet versions of an artifact (paginated)group_id, artifact_id, repository, page_size (default 50), continuation_token

Pagination example:

python
# First pageresponse = get_maven_versions("com.example", "myapp")# response contains: versions, hasMore, continuationToken (if hasMore is true)
# Next pageif response["hasMore"]:    next_response = get_maven_versions(        "com.example",         "myapp",         continuation_token=response["continuationToken"]    )

Python Tools

ToolDescriptionParameters
search_python_packageSearch Python packagesname, repository
get_python_versionsGet versions of a package (paginated)package_name, repository, page_size (default 50), continuation_token

Pagination: Same pattern as Maven - check hasMore and use continuationToken for subsequent pages.

Docker Tools

ToolDescriptionParameters
list_docker_imagesList images in a repositoryrepository
get_docker_tagsGet tags for an imagerepository, image_name

Development

Running Tests

bash
pytest tests/ -v

Type Checking

bash
mypy src/

Linting

bash
ruff check src/ tests/

Project Structure

nexus-mcp-server/├── specs/                    # Requirements documents│   ├── authentication.md│   ├── maven-support.md│   ├── python-support.md│   ├── docker-support.md│   ├── mcp-architecture.md│   └── http-streaming.md├── src/nexus_mcp/           # Source code│   ├── __init__.py          # Package init with version│   ├── __main__.py          # CLI entry point│   ├── server.py            # FastMCP server with tools│   ├── nexus_client.py      # Nexus REST API client│   ├── auth.py              # Authentication types│   ├── dependencies.py      # Credential extraction from headers│   └── tools/               # Tool implementations│       ├── __init__.py│       └── implementations.py├── tests/                   # Test suite│   ├── conftest.py          # Fixtures and sample data│   ├── test_nexus_client.py # Client unit tests│   ├── test_tools.py        # Tool integration tests│   └── test_http_transport.py # HTTP transport tests├── AGENTS.md                # Operational guide├── IMPLEMENTATION_PLAN.md   # Task tracking└── pyproject.toml           # Python project metadata

Troubleshooting

Connection Errors

  • Verify the MCP server is running (python -m nexus_mcp)
  • Check that port 8000 is accessible
  • Verify X-Nexus-Url header is correct and accessible
  • Check network connectivity to your Nexus instance
  • Ensure HTTPS certificates are valid (or use HTTP for local instances)

Authentication Errors

  • Verify X-Nexus-Username and X-Nexus-Password headers are correct
  • Ensure the user has read permissions on the repositories
  • Check if the Nexus instance requires specific authentication methods

Missing Credentials Error

  • Ensure all three headers are set: X-Nexus-Url, X-Nexus-Username, X-Nexus-Password
  • Check that your MCP client supports HTTP headers

Empty Results

  • Verify the repository name is correct
  • Check that the package/artifact exists in Nexus
  • For Python packages, try both hyphen and underscore naming

Transport Mode Issues

Connection timeout with streamable-http:

  • Ensure your client supports streamable-http transport
  • Try using SSE mode instead: python -m nexus_mcp --transport sse
  • Check firewall rules allow HTTP connections

Tools not appearing:

  • Both SSE and streamable-http expose the same tools
  • Verify headers are correctly passed (X-Nexus-*)
  • Check server logs for authentication errors

License

MIT

Contributing

Contributions welcome! Please run tests and linting before submitting PRs.

来源:README.md,提交 0c4a68a

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.1最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。