From f2a1ecad8a2fa166d5caf44f01eed5a0c8b216fd Mon Sep 17 00:00:00 2001 From: Gerardo Sabetta Date: Fri, 4 Dec 2026 13:46:57 -0300 Subject: [PATCH] docs: drop anonymous mode references (SURF-2364) --- README.md | 8 ++++---- docs/service.md | 11 +++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 0fade991..c036e460 100644 --- a/README.md +++ b/README.md @@ -25,10 +25,10 @@ Connect your MCP client to the hosted server at `https://mcp.socket.dev/` and au ### Option 1: Use the public Socket MCP server (recommended) -Connect to `https://mcp.socket.dev/` and sign in with Socket OAuth to use protected tools. If your client lists tools without prompting, start sign-in from the client. You do not need an API key. See [Compatibility](#compatibility). +Connect to `https://mcp.socket.dev/` and sign in with Socket OAuth. You do not need an API key. See [Compatibility](#compatibility). > [!NOTE] -> **Starting with the next Socket MCP release after 0.6.0**, once it is deployed to the hosted server, every tool needs sign-in, including package scoring and package file reads, and the hosted server has no anonymous mode. A client that connects without signing in gets HTTP `401` on its first request, before any tool is listed. The `WWW-Authenticate` header points to the server's OAuth metadata and names the scopes to request: `packages:list`, `alerts:list`, and `threat-feed:list`. Clients that support MCP authorization start sign-in from that response. Others need an explicit sign-in step. +> **Since 0.7.0**, every tool needs sign-in, including package scoring and package file reads, and the hosted server has no anonymous mode. A client that connects without signing in gets HTTP `401` on its first request, before any tool is listed. The `WWW-Authenticate` header points to the server's OAuth metadata and names the scopes to request: `packages:list`, `alerts:list`, and `threat-feed:list`. Clients that support MCP authorization start sign-in from that response. Others need an explicit sign-in step. - [Install in VS Code](https://vscode.dev/redirect/mcp/install?name=socket-mcp&config=%7B%22url%22%3A%22https%3A%2F%2Fmcp.socket.dev%2F%22%2C%22type%22%3A%22http%22%7D) - [Install in Cursor](https://cursor.com/install-mcp?name=socket-mcp&config=eyJ0eXBlIjoiaHR0cCIsInVybCI6Imh0dHBzOi8vbWNwLnNvY2tldC5kZXYvIn0%3D) @@ -188,7 +188,7 @@ Reuse saved authorization while it remains valid. If a browser reports connectio See the [self-hosted server instructions](docs/commands.md#self-hosted-server) for installation, stdio and HTTP setup, environment variables, and OAuth configuration. > [!WARNING] -> **After 0.6.0, self-hosted HTTP clients must authenticate every MCP request.** With OAuth off, configure each client to send its own Socket API token as `Authorization: Bearer `, starting with `initialize`. Requests without it return `401`, even when the server has `SOCKET_API_TOKEN` set. Local stdio setup is unchanged. +> **Since 0.7.0, self-hosted HTTP clients must authenticate every MCP request.** With OAuth off, configure each client to send its own Socket API token as `Authorization: Bearer `, starting with `initialize`. Requests without it return `401`, even when the server has `SOCKET_API_TOKEN` set. Local stdio setup is unchanged. > [!IMPORTANT] > **A shared or hosted deployment must enable OAuth.** Set `SOCKET_OAUTH_ISSUER`, `SOCKET_OAUTH_INTROSPECTION_CLIENT_ID` and `SOCKET_OAUTH_INTROSPECTION_CLIENT_SECRET` together. Clients then sign in through their MCP client's OAuth flow, and an anonymous request gets `401` with a `WWW-Authenticate` challenge that points at the server's OAuth metadata. Without OAuth, the server runs in raw API-token mode and offers no sign-in. The public server at `https://mcp.socket.dev/` runs with OAuth enabled. @@ -342,7 +342,7 @@ Only `organizations` and `depscore` were tested. Token refresh, server-side revo ### Sign-in and scope step-up by client -Protected tools need sign-in. If a saved token lacks a scope a tool needs, the server answers `403 insufficient_scope` and names the scopes to request. Clients that step up sign in again for the missing scope. With the others, clear the saved token and sign in again. +Every tool needs sign-in. If a saved token lacks a scope a tool needs, the server answers `403 insufficient_scope` and names the scopes to request. Clients that step up sign in again for the missing scope. With the others, clear the saved token and sign in again. This table covers clients whose current official documentation describes this behavior. diff --git a/docs/service.md b/docs/service.md index b94412af..07c735e5 100644 --- a/docs/service.md +++ b/docs/service.md @@ -163,17 +163,17 @@ Search a single file from a package for lines matching a JavaScript regular expr ### Authentication for organization-scoped tools -The hosted server supports anonymous tool discovery. Sign in with Socket OAuth to call protected tools. +Sign in with Socket OAuth to use the hosted server. -`depscore`, `organizations`, `alerts`, `threat_feed`, and `package_files` use a Socket API token. `package_file_contents` and `package_file_grep` use a blob hash and do not take a token. +Every tool uses the caller's Socket API token, including `depscore`, `package_file_contents`, and `package_file_grep`. > [!NOTE] -> **Starting with the next Socket MCP release after 0.6.0**, every tool call needs the caller's token, including `depscore`, `package_file_contents`, and `package_file_grep`, and `depscore` no longer falls back to the server's startup token. Once that release is deployed, the hosted server has no anonymous mode: every request, `initialize` included, needs an OAuth access token, and a request without one gets `401` with a `WWW-Authenticate` challenge that names the protected-resource metadata URL and the scopes to request. +> **Since 0.7.0**, every tool call needs the caller's token, and `depscore` no longer falls back to the server's startup token. The hosted server has no anonymous mode: every request, `initialize` included, needs an OAuth access token, and a request without one gets `401` with a `WWW-Authenticate` challenge that names the protected-resource metadata URL and the scopes to request. How the server resolves a token depends on the transport: - **stdio mode** uses the saved browser OAuth session created by `socket-mcp login`. It refreshes the session while the process runs. A token environment variable remains a fallback and takes precedence when set, but the CLI warns against raw-token use. Accepted names, in priority order, are `SOCKET_API_TOKEN`, `SOCKET_API_KEY`, `SOCKET_CLI_API_TOKEN`, `SOCKET_CLI_API_KEY`, `SOCKET_SECURITY_API_TOKEN`, and `SOCKET_SECURITY_API_KEY`. -- **HTTP mode without OAuth** accepts a Socket API token in an `Authorization: Bearer ` header on each request. Tools scoped to an organization use the caller's token and do not fall back to a shared operator token. `depscore` can fall back to the server's startup token because package scores are public data. +- **HTTP mode without OAuth** accepts a Socket API token in an `Authorization: Bearer ` header on each request. Every tool uses the caller's token and never falls back to the server's startup token. - **HTTP mode with OAuth** requires an OAuth access token on every MCP request. The server validates it through introspection and uses that caller credential for Socket API calls. A raw Socket API token is rejected with a `401` challenge. Scopes are checked per tool: a token without a tool's scope gets a `403 insufficient_scope` challenge for that tool only. See [Enabling OAuth](commands.md) for the scope each tool needs. When a token is missing, every affected tool returns the same message: @@ -247,7 +247,6 @@ Events are sent only for failures on the server's side: - A tool handler throws. - A tool call fails because the Socket API answered with a 5xx, the connection failed, the request timed out, or the response could not be handled. -- An anonymous call falls back to the deployment's `SOCKET_API_TOKEN`, and the Socket API rejects that token with 401 or 403. - The MCP handler or the Node adapter reports a serving failure, request routing or body reading throws, or OAuth token verification throws. Invalid arguments, unknown tools, a caller's missing or rejected token, other upstream 4xx answers, and clients that disconnect are the caller's doing. They send no event; each adds a breadcrumb to the next one. @@ -259,7 +258,7 @@ Every event carries these tags: | `mcp.tool` | A registered tool name, or `unknown` | | `mcp.client` | The request's `clientInfo.name` (2026-07-28 requests), else the client family of the `User-Agent`'s first product token (such as `claude-code`, `cursor` or `curl`; `other` when not listed), else `unknown`. Lowercased and capped at 64 characters. | | `mcp.client_version` | The matching version, when it looks like one and fits in 32 characters | -| `auth.outcome` | `anonymous`, `bearer_ok`, `bearer_denied`, `operator_denied` (the deployment's own token was rejected), or `unknown` for errors outside a tool call | +| `auth.outcome` | `bearer_ok`, `bearer_denied`, `operator_denied` (the deployment's own token was rejected), or `unknown` for errors outside a tool call | | `tool.outcome` | `failure` or `denied`, on tool-call events | | `failure.cause` | `thrown`, `upstream_5xx`, `network`, `timeout`, `exception`, or `upstream_denied`, on tool-call events | | `upstream.status` | The upstream HTTP status, when there was one |