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 分

    請在儲存庫或註冊中心條目中宣告授權條款。