Skip to content
231 changes: 205 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A Model Context Protocol (MCP) server that connects AI assistants to Sonatype's

## Overview

The Sonatype MCP Server enables AI assistants to access Sonatype's comprehensive dependency intelligence directly within your development workflow. By integrating with the Model Context Protocol, your AI assistant can help you make informed decisions about dependencies, identify security risks, and maintain complianceall without leaving your IDE.
The Sonatype MCP Server enables AI assistants to access Sonatype's comprehensive dependency intelligence directly within your development workflow. By integrating with the Model Context Protocol, your AI assistant can help you make informed decisions about dependencies, identify security risks, and maintain complianceall without leaving your IDE.

## Key Features

Expand All @@ -17,27 +17,27 @@ The Sonatype MCP Server enables AI assistants to access Sonatype's comprehensive

## Prerequisites

- For IDEs/tools that only support stdio MCP servers (like IntelliJ), install `mcp-remote`:
- For IDEs or tools that only support stdio MCP servers (like IntelliJ), install `mcp-remote`:
```bash
npm install -g mcp-remote
```

## Setup
To encourage your AI tools to leverage the Sonatype MCP tools, you can add instructions to your Claude.MD, Cursor rules or other guidelines for your agent.
```
### Sonatype MCP
When handling code related to dependencies, package management, or software supply chain security, always prioritize Sonatype MCP.
```

The Sonatype MCP Server runs as a remote MCP server. Choose the setup instructions for your IDE or AI assistant:

### Gemini Code Assist

Replace `<your-token>` with your personal API token generated at https://guide.sonatype.com/settings/tokens

```json
{
"mcpServers": {
"discoveredServer": {
"url": "https://mcp.seaworthy.sonatype.com/mcp"
"httpUrl": "https://mcp.guide.sonatype.com/mcp",
"headers": {
"Authorization": "Bearer <your-token>"
}
}
}
}
Expand All @@ -47,19 +47,47 @@ The Sonatype MCP Server runs as a remote MCP server. Choose the setup instructio

Add the server using the Claude CLI:

Replace `<your-token>` with your personal API token generated at https://guide.sonatype.com/settings/tokens

```bash
claude mcp add --transport http sonatype-mcp https://mcp.seaworthy.sonatype.com/mcp
claude mcp add --transport http --scope user sonatype-mcp https://mcp.guide.sonatype.com/mcp --header "Authorization: Bearer <your-token>"
```

### VS Code Copilot

Add the following configuration to your global VS Code `settings.json` or create a `.mcp.json` file in your project root:
Add the following configuration to your global VS Code `mcp.json` or create a `.vscode/mcp.json` file in your workspace:

Replace `<your-token>` with your personal API token generated at https://guide.sonatype.com/settings/tokens

```json
{
"servers": {
"sonatype-mcp": {
"url": "https://mcp.guide.sonatype.com/mcp",
"type": "http",
"headers": {
"Authorization": "Bearer <your-token>"
}
}
}
}
```

### GitHub Copilot CLI

Add to your `~/.copilot/mcp-config.json`:

Replace `<your-token>` with your personal API token generated at https://guide.sonatype.com/settings/tokens

```json
{
"mcpServers": {
"sonatype-mcp": {
"url": "https://mcp.seaworthy.sonatype.com/mcp"
"type": "http",
"url": "https://mcp.guide.sonatype.com/mcp",
"headers": {
"Authorization": "Bearer <your-token>"
}
}
}
}
Expand All @@ -69,14 +97,18 @@ Add the following configuration to your global VS Code `settings.json` or create

Create or edit `~/.codeium/windsurf/mcp_config.json`:

Replace `<your-token>` with your personal API token generated at https://guide.sonatype.com/settings/tokens

```json
{
"mcpServers": {
"sonatype-mcp": {
"command": "npx",
"args": [
"mcp-remote",
"https://mcp.seaworthy.sonatype.com/mcp"
"https://mcp.guide.sonatype.com/mcp",
"--header",
"Authorization: Bearer <your-token>"
]
}
}
Expand All @@ -89,14 +121,18 @@ Create or edit `~/.codeium/windsurf/mcp_config.json`:

**Project Scope:** Create `.junie/mcp/.mcp.json` in your project root:

Replace `<your-token>` with your personal API token generated at https://guide.sonatype.com/settings/tokens

```json
{
"mcpServers": {
"sonatype-mcp": {
"command": "npx",
"args": [
"mcp-remote",
"https://mcp.seaworthy.sonatype.com/mcp"
"https://mcp.guide.sonatype.com/mcp",
"--header",
"Authorization: Bearer <your-token>"
]
}
}
Expand All @@ -107,14 +143,18 @@ Create or edit `~/.codeium/windsurf/mcp_config.json`:

Create or edit `~/.kiro/settings/mcp.json`:

Replace `<your-token>` with your personal API token generated at https://guide.sonatype.com/settings/tokens

```json
{
"mcpServers": {
"sonatype-mcp": {
"command": "npx",
"args": [
"mcp-remote",
"https://mcp.seaworthy.sonatype.com/mcp"
"https://mcp.guide.sonatype.com/mcp",
"--header",
"Authorization: Bearer <your-token>"
]
}
}
Expand All @@ -125,32 +165,171 @@ Create or edit `~/.kiro/settings/mcp.json`:

Cursor supports remote servers directly. Add to your `~/.cursor/mcp.json`:

Replace `<your-token>` with your personal API token generated at https://guide.sonatype.com/settings/tokens

```json
{
"mcpServers": {
"sonatype-mcp": {
"type": "http",
"url": "https://mcp.seaworthy.sonatype.com/mcp"
"url": "https://mcp.guide.sonatype.com/mcp",
"headers": {
"Authorization": "Bearer <your-token>"
}
}
}
}
```

### Codex (IDE Plugin & CLI)
For both methods below, define an environment variable SONATYPE_GUIDE_MCP_TOKEN for your personal API token generated at https://guide.sonatype.com/settings/tokens.

Method 1:
Using CLI command: `codex mcp add sonatype-mcp --url https://mcp.guide.sonatype.com/mcp --bearer-token-env-var SONATYPE_GUIDE_MCP_TOKEN`

Method 2:
Create or edit `~/.codex/config.toml`:

```toml
[mcp_servers.sonatype-mcp]
url = "https://mcp.guide.sonatype.com/mcp"
bearer_token_env_var = "SONATYPE_GUIDE_MCP_TOKEN"
```

## Authentication

The Sonatype MCP Server uses OAuth 2.0 for secure authentication:
The Sonatype MCP Server uses API token authentication:

1. Create a Sonatype Guide account and generate your personal API token at https://guide.sonatype.com/settings/tokens
2. Add the token to your MCP configuration using the `Authorization: Bearer <your-token>` header format
3. Replace `<your-token>` with your actual token in the configuration examples above

Your API token authenticates all requests automatically. Keep your token secure and never commit it to version control.

## Configuring AI Assistant Rules

To maximize the effectiveness of the Sonatype MCP Server, configure your AI assistant to prioritize using Sonatype MCP tools when working with dependencies, packages, or software supply chain security. Below are instructions for each supported IDE or tool.

### Claude Code

Create custom instructions using CLAUDE.md files:

**Global (all projects):** Create `~/.claude/CLAUDE.md`

**Project (specific repository):** Create `.claude/CLAUDE.md` in your project root

Add the following instruction:

1. When you first connect to the server through your AI assistant, you'll be prompted to authenticate
2. You'll be redirected to the Sonatype authentication page
3. Log in or signup
4. Grant the necessary permissions for the MCP server
5. You'll be redirected back to your IDE/assistant with an active session
```markdown
## Sonatype MCP

Your authentication token is securely stored and automatically refreshed as needed.
When handling code related to dependencies, package management, or software supply chain security, always prioritize Sonatype MCP tools. Use the available MCP tools to research versions, check for vulnerabilities, and get recommendations before adding or updating any dependencies.
```

### Cursor

Create a `.cursorrules` file in your project root:

**Project (specific repository):** Create `.cursorrules` in your project root

Add the following instruction:

```markdown
## Sonatype MCP

When handling code related to dependencies, package management, or software supply chain security, always prioritize Sonatype MCP tools. Use the available MCP tools to research versions, check for vulnerabilities, and get recommendations before adding or updating any dependencies.
```

### VS Code Copilot

Create custom instructions using a `.github/copilot-instructions.md` file:

**Project (specific repository):** Create `.github/copilot-instructions.md` in your project root

Add the following instruction:

```markdown
## Sonatype MCP

When handling code related to dependencies, package management, or software supply chain security, always prioritize Sonatype MCP tools. Use the available MCP tools to research versions, check for vulnerabilities, and get recommendations before adding or updating any dependencies.
```

### Windsurf

Create rules using Windsurf's Customizations feature:

**Global (all projects):**
1. Click the "Rules, Memories & Workflows" icon in the top right of Cascade Code or search Rules in Windsurf Settings
2. Navigate to "Rules"
3. Click "+ Global" to create a new global rule
4. Add the following content:

```markdown
## Sonatype MCP

When handling code related to dependencies, package management, or software supply chain security, always prioritize Sonatype MCP tools. Use the available MCP tools to research versions, check for vulnerabilities, and get recommendations before adding or updating any dependencies.
```

**Project (specific repository):**
Follow the instructions for Global but click "+ Workspace" or create `.windsurf/rules/sonatype.md` in your project root:

```markdown
## Sonatype MCP

When handling code related to dependencies, package management, or software supply chain security, always prioritize Sonatype MCP tools. Use the available MCP tools to research versions, check for vulnerabilities, and get recommendations before adding or updating any dependencies.
```

### IntelliJ with Junie

Create custom guidelines using a `.junie/guidelines.md` file:

**Project (specific repository):** Create `.junie/guidelines.md` in your project root

Add the following instruction:

```markdown
## Sonatype MCP

When handling code related to dependencies, package management, or software supply chain security, always prioritize Sonatype MCP tools. Use the available MCP tools to research versions, check for vulnerabilities, and get recommendations before adding or updating any dependencies.
```

### Kiro

Create steering files in the `.kiro/steering/` directory:

**Project (specific repository):** Create `.kiro/steering/sonatype.md` in your project root

Add YAML front matter to make it always included:

```markdown
---
inclusion: always
---

## Sonatype MCP

When handling code related to dependencies, package management, or software supply chain security, always prioritize Sonatype MCP tools. Use the available MCP tools to research versions, check for vulnerabilities, and get recommendations before adding or updating any dependencies.
```

### Gemini Code Assist

Create custom instructions using GEMINI.md files:

**Global (all projects):** Create `~/.gemini/GEMINI.md`

**Project (specific repository):** Create `GEMINI.md` in your project root

Add the following instruction:

```markdown
## Sonatype MCP

When handling code related to dependencies, package management, or software supply chain security, always prioritize Sonatype MCP tools. Use the available MCP tools to research versions, check for vulnerabilities, and get recommendations before adding or updating any dependencies.
```

## Example Use Cases

In the normal course of development, LLM's will decide to use or upgrade dependencies. Our MCP tools will be used transparently offering better suggestions with more up to date information, eliminating the side quest of validating component and version choice.
In the normal course of development, LLMs will decide to use or upgrade dependencies. Our MCP tools will be used transparently, offering better suggestions with more up-to-date information, eliminating the side quest of validating component and version choices.

Here are some ways to leverage the Sonatype MCP Server explicitly in your development workflow:

Expand All @@ -176,9 +355,9 @@ The assistant can use both tools to compare your current version with the latest

The Sonatype MCP Server provides three powerful tools for AI assistants:

- `version` - gets component information about the current version of a component
- `latestVersion` - gets component information about the latest version of a component
- `recommendedVersion` - gets a set of recommended versions based on the current version of a component
- `getComponentVersion` - Gets component information about a specific version of a component
- `getLatestComponentVersion` - Gets component information about the latest version of a component
- `getRecommendedComponentVersions` - Gets a set of recommended versions to upgrade to based on the current version of a component. If no version is provided, gets a set of recommended versions to start with for the component

## Support & Feedback

Expand Down