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
| Endpoint | Auth |
|---|---|
https://api.ossprey.com/dashboard/v1/mcp | OAuth (sign in with your Ossprey account) |
https://api.ossprey.com/public/v1/mcp | API 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, andnotifications/*acknowledgements. Requests (with anid) get a200JSON-RPC response; notifications (noid) are acknowledged with202and 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:
- Discovery — an unauthenticated request returns
401withWWW-Authenticate: Bearer. The client then reads the protected resource metadata athttps://api.ossprey.com/.well-known/oauth-protected-resource. It points to the authorization serverhttps://auth.ossprey.com/. - Client registration — the client registers itself via dynamic client registration at
https://auth.ossprey.com/oidc/register. - 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). - Token — the client exchanges the code at
https://auth.ossprey.com/oauth/tokenand sendsAuthorization: Bearer <access_token>on every MCP request. - Refresh — the client refreshes the token automatically. Request the
offline_accessscope 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:
| Tool | Wraps |
|---|---|
list_scans | GET /public/v1/scans |
get_scan | GET /public/v1/scans/{sbom_id} |
get_scan_status | GET /public/v1/scans/status |
submit_scan | POST /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/mcpThen 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.
Updated 23 days ago
