MCP Server

Give AI agents access to Ossprey scans via the Model Context Protocol endpoint.

Ossprey exposes a Model Context Protocol (MCP) server, so AI agents and MCP-capable clients can scan packages and read results as first-class tools.

Endpoints

EndpointAuth
https://api.ossprey.com/dashboard/v1/mcpOAuth (sign in with your Ossprey account)
https://api.ossprey.com/public/v1/mcpAPI key

Transport and auth

  • Transport — stateless Streamable HTTP: each request is a JSON-RPC 2.0 message (or batch) POSTed to the endpoint.
  • Auth — either an API key or OAuth (see Authentication).
  • Methods — initialize, ping, tools/list, tools/call, and notifications/* acknowledgements. Requests (with an id) get a 200 JSON-RPC response; notifications (no id) are acknowledged with 202 and no body.

Authentication

Two options. Use OAuth for interactive clients; use an API key for scripts and CI.

OAuth (recommended for interactive clients)

The server supports the MCP authorization spec. Use the https://api.ossprey.com/dashboard/v1/mcp endpoint. Clients that support the spec (Claude, Claude Code, Cursor, VS Code, etc.) sign you in through the browser. No key to copy or rotate.

How it works:

  1. Discovery — an unauthenticated request returns 401 with WWW-Authenticate: Bearer. The client then reads the protected resource metadata at https://api.ossprey.com/.well-known/oauth-protected-resource. It points to the authorization server https://auth.ossprey.com/.
  2. Client registration — the client registers itself via dynamic client registration at https://auth.ossprey.com/oidc/register.
  3. Sign in — the client opens your browser at https://auth.ossprey.com/authorize. You log in with your normal Ossprey account (authorization code flow with PKCE, S256).
  4. Token — the client exchanges the code at https://auth.ossprey.com/oauth/token and sends Authorization: Bearer <access_token> on every MCP request.
  5. Refresh — the client refreshes the token automatically. Request the offline_access scope to get a refresh token.

Notes:

  • Tools act as the signed-in user.
  • Scopes: openid, profile, email.
  • Removing the connector in your client only deletes local credentials. It does not revoke the grant. To end access, revoke the refresh token at https://auth.ossprey.com/oauth/revoke.

API key

Use the https://api.ossprey.com/public/v1/mcp endpoint. Send the same x-api-key header as the rest of the public API. The key is also accepted as Authorization: Bearer <key>, for MCP clients and agent platforms that can only send a bearer token.

Available tools

The MCP tools wrap the public scan API:

ToolWraps
list_scansGET /public/v1/scans
get_scanGET /public/v1/scans/{sbom_id}
get_scan_statusGET /public/v1/scans/status
submit_scanPOST /public/v1/scans

Connecting a client

With OAuth

Add the OAuth endpoint with no headers. The client starts the browser sign-in on first use.

Claude Code:

claude mcp add ossprey --transport http https://api.ossprey.com/dashboard/v1/mcp

Then run /mcp in Claude Code and pick ossprey → Authenticate.

Claude (claude.ai / desktop): add a custom connector with URL https://api.ossprey.com/dashboard/v1/mcp, then click Connect. See Anthropic's custom connector guide for where to find it on your plan.

Other clients: add https://api.ossprey.com/dashboard/v1/mcp as a remote (Streamable HTTP) server and follow the client's sign-in prompt.

With an API key

Point any MCP client that supports Streamable HTTP with custom headers at https://api.ossprey.com/public/v1/mcp. For example, with Claude Code:

claude mcp add ossprey --transport http https://api.ossprey.com/public/v1/mcp \
  --header "x-api-key: $OSSPREY_API_KEY"

Calling it directly

The endpoint is plain JSON-RPC, so you can drive it with curl:

# Discover the tools
curl -X POST "https://api.ossprey.com/public/v1/mcp" \
  -H "x-api-key: $OSSPREY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/list" }'

# Call one
curl -X POST "https://api.ossprey.com/public/v1/mcp" \
  -H "x-api-key: $OSSPREY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "tools/call",
    "params": { "name": "list_scans", "arguments": {} }
  }'

Malformed JSON or an invalid JSON-RPC request returns a 400 carrying a standard JSON-RPC error envelope.


Did this page help you?