Skip to main content
Glama
Socket MCP Server

Socket MCP Server

by SocketDev

Socket MCP Server

Follow @SocketSecurity Follow @socket.dev on Bluesky

Socket MCP lets AI assistants query Socket's dependency security scores and metadata through the Model Context Protocol (MCP). Use it to score a package, audit a package.json, or identify risky dependencies in a conversation. Connect your MCP client to the hosted server at https://mcp.socket.dev/ and authenticate through OAuth, or run the npm package yourself.

✨ Features

  • πŸ” Dependency Security Scanning - Get comprehensive security scores for npm, PyPI, cargo, Maven, NuGet, RubyGems, Go Modules, and more (supported ecosystems)

  • 🌐 Public Hosted Service - Use our public server at https://mcp.socket.dev/ and sign in through your MCP client's OAuth flow

  • πŸš€ Multiple Deployment Options - Run locally via stdio, HTTP, or use our service

  • πŸ€– AI Assistant Integration - Connect from MCP-compatible clients; OAuth behavior varies by client

  • πŸ“Š Batch Processing - Check multiple dependencies in a single request

  • πŸ”’ OAuth Sign-In - Public server authenticates through your MCP client's OAuth flow; no API key to copy or manage

πŸ› οΈ This project is in early development and rapidly evolving.

Related MCP server: MCP NVD Server

Install

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.

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.

Add the hosted server through Claude's custom connector settings. The Developer configuration file is for local servers.

  1. Open Customize > Connectors in Claude.

  2. Select Add custom connector and enter https://mcp.socket.dev/ as the server URL. On Team and Enterprise plans, an organization owner adds the connector through Organization settings > Connectors first.

  3. Select Connect and complete the Socket authorization flow when prompted.

  4. Enable the connector for your conversation, then ask Claude "Check the security score for express version 4.18.2".

For Claude Code, add the server:

claude mcp add --transport http socket-mcp https://mcp.socket.dev/

Then run /mcp, select socket-mcp, choose Authenticate (or Re-authenticate, if shown), and approve access in your browser. An "authenticated" status before sign-in does not mean organization tools are ready.

Add the server:

codex mcp add socket-mcp --url https://mcp.socket.dev/

Codex starts sign-in during this command and asks for the scopes the server advertises. You may see an invalid_scope page before Codex automatically retries with the three MCP read permissions. Complete the browser authorization on the retry.

Don't pin scopes in ~/.codex/config.toml or pass --scopes to codex mcp login. A pinned list overrides discovery, and Codex doesn't step up when the server answers 403 insufficient_scope, so a token missing a scope stays stuck (see openai/codex#20518 and this production case). If you must pin, list all three scopes, and update the list whenever Socket MCP adds a scope:

[mcp_servers.socket-mcp]
url = "https://mcp.socket.dev/"
scopes = ["packages:list", "alerts:list", "threat-feed:list"]

If Codex reports 403 insufficient_scope, the saved token is missing a scope. There are two common causes:

  • A pinned scopes list that leaves a scope out.

  • An older sign-in. Some earlier sign-ins granted only packages:list. Refreshing a token keeps the scopes it was first granted, so the token stays short of alerts:list and threat-feed:list and Codex keeps failing at startup.

Signing in again doesn't fix this while Codex holds the old token. Clear it first, remove any pinned scopes line, then sign in:

codex mcp logout socket-mcp
# If present, delete `scopes = [...]` under [mcp_servers.socket-mcp] in ~/.codex/config.toml
codex mcp login socket-mcp

Complete the browser authorization when it opens.

With dynamic client registration, each sign-in creates a new OAuth client with Socket.

# For VS Code with GitHub Copilot
code --add-mcp '{"name":"socket-mcp","type":"http","url":"https://mcp.socket.dev/"}'

Or add to .vscode/mcp.json:

{
  "servers": {
    "socket-mcp": {
      "type": "http",
      "url": "https://mcp.socket.dev/"
    }
  }
}

Cursor Settings β†’ MCP β†’ Add new MCP Server. Name socket-mcp, http type, URL https://mcp.socket.dev/.

{
  "mcpServers": {
    "socket-mcp": {
      "type": "http",
      "url": "https://mcp.socket.dev/"
    }
  }
}

Windsurf does not support http type MCP servers. Use the stdio configuration in Option 2 below, or the serverUrl form:

{
  "mcpServers": {
    "socket-mcp": {
      "serverUrl": "https://mcp.socket.dev/mcp"
    }
  }
}

Factory is an AI-powered software engineering platform. Install the Socket MCP server with the Factory CLI:

droid mcp add socket https://mcp.socket.dev/ --type http

To self-host with an API key instead, see Option 2 below and register the stdio command with droid mcp add.

Alternatively, type /mcp within the Factory droid to manage MCP servers from an interactive UI. Learn more in the Factory MCP documentation.

Clients that need a local bridge

Prefer your client's native remote HTTP connection to https://mcp.socket.dev/ when available. For clients that only launch local stdio servers, install mcp-remote 0.8.3:

pnpm add --global mcp-remote@0.8.3

Add this local server configuration to your MCP client:

{
  "mcpServers": {
    "socket": {
      "command": "mcp-remote",
      "args": ["https://mcp.socket.dev/"]
    }
  }
}

The bridge runs on your computer and receives OAuth redirects at http://localhost:<port>/oauth/callback. Keep it running while you authorize. Version 0.3.3 introduced the mid-session authorization fix; the forwarding and reauthorization retry paths were verified against the published 0.8.3 package. This verification does not cover a complete browser sign-in.

Reuse saved authorization while it remains valid. If a browser reports connection refused at the localhost callback, check the bridge's version and process. The callback listener belongs to the bridge; changing the hosted MCP URL does not start it.

Option 2: Self-host the Socket MCP server

See the self-hosted server instructions 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 <token>, 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.

Usage

Once installed, ask your AI assistant questions like:

  • "Check the security score for express version 4.18.2"

  • "Analyze the security of my package.json dependencies"

  • "What are the vulnerability scores for react, lodash, and axios?"

Documentation

Tools exposed

The complete tool roster, schemas, parameters, and result examples are in the service reference.

depscore

See depscore.

organizations

See organizations.

alerts

See alerts.

threat_feed

See threat_feed.

package_files

See package_files.

package_file_contents

See package_file_contents.

package_file_grep

See package_file_grep.

Authentication

See the authentication reference for local tokens, per-request HTTP credentials, and hosted OAuth.

Worked example: organization details and alerts

See the organization and alerts example.

Adjusting tool usage via client rules

See client rule examples.

Claude Code Hook (Optional)

The optional Socket package guard is documented in the commands and workflows reference.

Setup

See the hook setup instructions.

How it works

See how the hook works.

Limitations

See the hook limitations.

Inspired by Jimmy Vo's dependency hook.

Development

This repo uses pnpm, and every command runs from the repo root. Node.js 24+ is required.

git clone https://github.com/SocketDev/socket-mcp.git
cd socket-mcp
pnpm install

Run from source. No build step is needed, because Node 24 strips the TypeScript itself:

node index.mts login
pnpm run server-stdio

Or in HTTP mode:

pnpm run server-http

The stdio server uses the saved browser OAuth session. A SOCKET_API_TOKEN environment variable remains available as a discouraged fallback. The HTTP script reads SOCKET_API_TOKEN (falling back to SOCKET_API_KEY) from your environment. Append :debug to either script (pnpm run server-http:debug) to set SOCKET_DEBUG=1 and get per-request tracing on stderr.

Audit events

Audit-event destinations and record behavior are documented in the service reference.

Error reporting

HTTP mode can report server-side failures to Sentry. It is off unless SOCKET_MCP_SENTRY_DSN is set, and SOCKET_MCP_SENTRY_ENVIRONMENT names the environment. stdio mode never reports. What is sent, and what is scrubbed, is documented in the service reference.

Health check endpoint

The HTTP health response is documented in the service reference.

Troubleshooting

See service troubleshooting.

Getting help

Compatibility

MCP is still evolving, and client implementations differ in how they handle parts of the protocol. We proactively track compatibility gaps and work to offer the best possible experience with Claude Code, Codex, Cursor, and Zed. The table below summarizes the latest tests and known gaps.

Snapshot dated October 2, 2026; tests ran September 29–October 1. Each result applies to the listed client version and setup.

Client and tested setup

Hosted OAuth result

Verified tools and continuity

Important limit or workaround

Claude Code 2.1.285, hosted HTTP

First organizations call failed with a sign-in request; explicit OAuth then completed.

The 2.1.285 run verified the initial failure and successful login. organizations and depscore passed after login in a separate 2.1.284 run.

The pre-login β€œauthenticated” label was misleading; see upstream issue #98942.

Codex CLI 0.159.2, hosted HTTP

Works after explicit login.

organizations and depscore passed after login, including a new conversation and idle checks.

A broad scope request showed invalid_scope before Codex retried with the three MCP read permissions; see upstream issue #15643.

Cursor 3.22.12, hosted HTTP OAuth

Fails in tested conditions: organizations remained Unauthorized; the Authenticate card did not establish access.

organizations only; no successful hosted OAuth call verified.

Cursor 3.20 recurrence was manually reported; no fix version is known. A related forum reply describes an unsuccessful workaround attempt but identifies a separate Cursor 3.18.9 marketplace-import blocker.

Cursor, local stdio with API token (version not recorded)

Not applicable; this setup bypasses hosted OAuth.

depscore passed; restart continuity was reported manually.

This does not verify hosted OAuth, organizations, or other tools.

Zed Agent 1.22.0, hosted HTTP

Works after explicit OAuth.

organizations and depscore passed after login, restart, and a six-minute idle check.

Intermittent timeouts after idle, cause under investigation; four client timeouts matched fast server HTTP 400 responses.

Only organizations and depscore were tested. Token refresh, server-side revocation, and all-tool coverage were not tested. Claude Desktop, VS Code, Windsurf, and Factory were not tested in this matrix.

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.

This table covers clients whose current official documentation describes this behavior.

Client

OAuth sign-in with dynamic client registration

Step-up on 403 insufficient_scope

Clear the token or work around

Claude Code

Yes (docs)

No automatic retry. The call fails with a message naming the scope, and /mcp shows the server as needing authentication (docs)

/mcp β†’ Re-authenticate, or claude mcp logout socket-mcp. A pinned oauth.scopes list must include every scope

Claude Desktop and web

Yes (custom connectors)

Yes: Claude asks you to authorize again, then retries the call (docs)

Disconnect the connector in Claude's settings, then connect again

VS Code (GitHub Copilot)

Yes, since 1.101 (release notes)

Yes, since 1.106 (release notes)

Sign out from the Accounts menu, or run Authentication: Remove Dynamic Authentication Providers

Codex CLI

Yes (docs)

No (openai/codex#20518)

codex mcp logout socket-mcp, then codex mcp login socket-mcp; see Manual install - Codex CLI

Other clients that support OAuth 2.1 with dynamic client registration should work the same way. If your client reports 403 insufficient_scope, clear its saved Socket MCP sign-in and authorize again. If the error persists, report an issue.

License

MIT

Available Tools

1 tool
depscoreDependency Score ToolA
Read-only

Get the dependency score of packages with the depscore tool from Socket. Use 'unknown' for version if not known. Use this tool to scan dependencies for their quality and security on existing code or when code is generated. Stop generating code and ask the user how to proceed when any of the scores are low. When checking dependencies, make sure to also check the imports in the code, not just the manifest files (pyproject.toml, package.json, etc).

Inputs: packages (required), platform.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 1 tool

    Disambiguation5/5

    Only one tool exists, so there is no possibility of confusion between tools.

    Naming Consistency5/5

    Single tool named 'depscore' is clear and concise; no inconsistency arises with only one tool.

    Tool Count2/5

    With only one tool, the server feels underdeveloped for its stated purpose of dependency security, lacking features like package listing or alert management.

    Completeness2/5

    The single tool provides dependency scoring but misses other essential operations such as checking for known vulnerabilities, updating packages, or generating detailed reports, leaving significant gaps.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      A
      maintenance
      A Model Context Protocol server that enables AI-powered analysis of NPM packages through multiple tools for security vulnerability scanning, dependency analysis, package comparison, and quality assessment.
      10
      19
      1,038 npm
      20
      TypeScript
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server that retrieves CVE information from the National Vulnerability Database, allowing AI models to access up-to-date vulnerability data.
      1
      7
      Apache 2.0
    • A
      license
      A
      quality
      D
      maintenance
      A Model Context Protocol server providing security vulnerability intelligence tools including CVE lookup, EPSS scoring, CVSS calculation, exploit detection, and Python package vulnerability checking.
      8
      9
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      A security-focused MCP server that enables AI assistants to search PyPI packages, scan for vulnerabilities, audit dependencies, and ensure security across Python projects.
      186 PyPI
      3
      MIT