Logo de MCP Shark

MCP Shark

Organização
mcp-shark

Wireshark-like forensic analysis for Model Context Protocol communications Capture, inspect, and investigate all HTTP requests and responses between your IDE and MCP servers

Publicado pormcp-shark
Repositóriomcp-shark
IdiomaJavaScript
Forks
14
Estrelas
179
Ferramentas disponíveis
0
Tipo de transportestdio
Links
  • Conecte ferramentas a fluxos de trabalho de IA

    MCP Shark disponibiliza recursos MCP que podem ser usados por clientes e agentes de IA compatíveis.

  • 0 ferramentas disponíveis

    Confira abaixo as ações que podem ser chamadas, incluindo nomes e descrições quando fornecidos pelo servidor.

  • Configuração pronta para copiar

    Use os exemplos de instalação para configurar este servidor no seu cliente MCP preferido.

  • Indicadores da comunidade de código aberto

    179 estrelas e 14 forks no repositório vinculado.

npm version License: Non-Commercial

Dashboard at a glance

These captures are from the live dashboard with real captured traffic (dummy MCP or your own upstreams). Start with npx @mcp-shark/mcp-shark serve --open. Smart Scan is not shown below — it depends on an optional remote API token. MCP Playground appears once you have at least one MCP upstream configured (the Playground capture uses a demo server with tools loaded).

Live traffic capture

Every JSON-RPC frame between your IDE and each MCP upstream is captured with full headers, body, timing, and an AAuth posture chip. Filter by method, status, server, session, AAuth agent / mission / posture.

Traffic Capture

MCP Playground

Pick an upstream, load tools, prompts, and resources from that server, then call tools or read resources through the proxy — useful for validating behavior before it hits your IDE. The view below shows the tools list for a configured demo MCP.

MCP Playground

AAuth Explorer

Force-directed knowledge graph of every Agent / Mission / Resource / Signing algorithm / Access mode observed across captured traffic. Use Generate sample data for a quick demo graph, or capture real AAuth-shaped traffic through the proxy.

AAuth Explorer

Local Analysis

Offline rule-based scanner over captured traffic. The AAuth Posture card summarizes signed / aauth-aware / bearer / no-auth distribution; the Toxic flows (proxy traffic) panel infers cross-server pairings from observed tools/list responses. With packets already in the database, use Replay from DB (when no live MCP is attached) and then Analyse to populate findings — the view below is after that run.

Local Analysis

YARA Detection

Same Local Analysis tab: switch to YARA Detection for the traffic rule engine — engine status, eight predefined rules (toggle, edit, delete), and New Rule for your own patterns. When the native yara module is not installed, scans still run using the built-in regex fallback (see docs/local-analysis.md).

YARA Detection

New Rule opens the editor with a starter template (meta, strings, and condition). Edit the rule text, then Save Rule to add it as a custom pattern alongside the built-ins.

Adding a custom YARA rule

Server setup

Auto-detects Cursor / Codex / Windsurf configs, converts them to mcp-shark format, and patches the IDE to route through the proxy on start.

Server Setup

Why mcp-shark?

MCP setups commonly mix secrets, broad tool access, and multiple servers in one agent context; issues are easy to miss without checking configs. See the OWASP MCP Top 10 for a structured view of what can go wrong.

mcp-shark runs on your machine — no API keys or hosted scan backend. Install with npx and review findings locally.

Toxic flow analysis

The scanner models how MCP servers compose in the agent context and flags risky capability pairings (for example, secret access combined with external egress):

  ▲ HIGH  notify-server → repo-server
    Untrusted content in one tool’s channel could lead the agent to
    take a destructive action in another (e.g. push code).

  ▲ MEDIUM  browser-server → filesystem-server
    Web-sourced context could be chained into local file operations.

Use mcp-shark findings as input to your own threat model, not as a complete audit.

Features

FeatureDescription
41 security rulesOWASP MCP Top 10 + Agentic Security Initiative + AAuth visibility + general checks
Toxic flow analysisCross-server attack path detection from tool capability heuristics
Attack walkthroughsStep-by-step exploit narratives from findings
Shark ScoreTransparent security posture score (0-100, A-F)
Auto-fix--fix replaces hardcoded secrets, fixes permissions, with backup/undo
Tool pinningGit-committable .mcp-shark.lock with SHA-256 hashes
15 IDE detectionCursor, Claude Desktop, VS Code, Windsurf, Codex, Amp, Kiro, and more
4 output formatsTerminal, JSON, SARIF v2.1.0, HTML
Health checksdoctor command for environment validation
Server inventorylist command shows all servers in a table
Watch modeLive re-scan on config changes
HTML reportsSelf-contained offline security reports
Downloadable rule packsRule pack registry (manifest + JSON); update-rules syncs declarative packs and toxic-flow heuristics — zero code changes
YAML rulesPer-project custom rules via .mcp-shark/rules/
GitHub ActionCI/CD integration with SARIF upload
Interactive TUIlazygit-style terminal UI for scan, fix, and server browsing
Browser dashboardLive traffic, Local Analysis, YARA rules, AAuth Explorer, Playground, setup, and logs
Proxy toxic flowsLocal Analysis panel + GET/POST /api/security/traffic-toxic-flows* infer cross-server pairs from captured tools/list traffic (see docs/local-analysis.md)
YARA-style traffic rulesIn Local Analysis → YARA Detection, enable or edit built-in pattern rules, add custom rules, and inspect engine status (native YARA when available, regex fallback otherwise)
Local static scansNo hosted scan backend; update-rules is opt-in HTTPS to the registry

Quick Start

bash
# Scan your MCP setup (default command)
npx @mcp-shark/mcp-shark

# Auto-fix issues (with interactive confirmation)
npx @mcp-shark/mcp-shark scan --fix

# See full attack chain narratives
npx @mcp-shark/mcp-shark scan --walkthrough

# Pin tool definitions (lockfile) to spot unexpected changes
npx @mcp-shark/mcp-shark lock

# Check environment health
npx @mcp-shark/mcp-shark doctor

# Show all detected servers
npx @mcp-shark/mcp-shark list

# Download latest rule packs (OWASP, Agentic Security)
npx @mcp-shark/mcp-shark update-rules

# Watch for config changes
npx @mcp-shark/mcp-shark watch

# Interactive terminal UI
npx @mcp-shark/mcp-shark tui

# Generate HTML report
npx @mcp-shark/mcp-shark scan --format html --output report.html

# CI mode (exits 1 on critical/high)
npx @mcp-shark/mcp-shark scan --ci --format sarif

Commands

CommandDescription
scan (default)Run security scan with 41 rules
lockCreate .mcp-shark.lock file
lock --verifyVerify current state matches lockfile
diffShow tool definition changes since last lock
doctorRun environment health checks
listShow inventory of all detected servers (--format json supported)
update-rulesDownload latest rule packs from remote registry
watchWatch config files and re-scan on changes
tuiInteractive terminal UI (lazygit-style)
serveStart the local proxy and monitoring dashboard

CLI flags

scan (default command)

FlagDescription
--fixAuto-fix issues (interactive confirmation)
--fix --yesAuto-fix without prompting
--fix --undoRestore backups from previous fix
--walkthroughShow full attack chain narratives
--ciCI mode: exit code 1 on critical/high
--format <fmt>Output: terminal, json, sarif, html
--output <path>Write report to file (for html format)
--strictCount advisory findings in score
--ide <name>Scan specific IDE only
--rules <path>Load custom YAML rules from directory
--refresh-rulesFetch rule packs from registry before scan (HTTPS; see rule registry config)

Other commands

CommandFlags / notes
list--format terminal or --format json
update-rules--source <url> for a custom pack manifest
serve--open / -o to open the browser
lock--verify to check lockfile match

How scan works

The CLI scan command is static: it reads MCP entries from your IDE config files (see Supported IDEs and optional project ./mcp.json) and analyzes what is written there. It does not connect to running MCP servers or call tools/list.

  • Always scanned: each server block’s command, args, env, url, and related fields (secrets in env, unsafe spawn patterns, HTTP URLs, etc.).
  • Tool-level rules (declarative packs, command-injection heuristics, toxic-flow classification from tool names, etc.) run only when that server entry includes an embedded tools array (name, description, schemas). If tools is omitted—typical for command/stdio-only configs—the scan may report 0 tools checked even though Cursor is running the server fine.

To exercise full rule coverage in CI or test repos, either embed tool metadata in the same JSON your scanner reads, or use a project-local mcp.json harness (see --ide Project).

What it covers

mcp-shark is aimed at config and metadata you already have on disk (plus optional local monitoring). It helps catch common misconfigurations and risky combinations; treat output as input to your own review, not a guarantee nothing is wrong.

AreaNotes
Install / runNode.js 20+; npx @mcp-shark/mcp-shark
Security rules41 checks — 30 declarative JSON packs, 11 JS where heuristics need code
Toxic flow analysisHeuristic cross-server paths; quality depends on embedded tools / classifications
Attack walkthroughsNarratives derived from findings
Auto-fixSupported for a subset of issues; confirm changes in your repo
Tool pinning.mcp-shark.lock with SHA-256 hashes
Live trafficDashboard (serve) for monitoring; separate from static scan
Custom rulesYAML under .mcp-shark/rules/ and JSON rule packs
Findings & scoreconfirmed / advisory tiers plus Shark Score (0–100, A–F)
IDE configs15 built-in paths + project-local mcp.json variants — see Supported IDEs
OutputTerminal, JSON, SARIF v2.1.0, HTML
Healthdoctor for environment checks
CIscan --ci and optional GitHub Action
WatchRe-scan when config files change
Rule updatesupdate-rules (optional HTTPS fetch; static scan works without it)

Rule Extensibility

Downloadable Rule Packs (JSON)

The canonical registry (manifest, pack files, validation CI, and schema notes) lives in mcp-shark/rule-packs. The npm package embeds copies; update-rules pulls the same artifacts into .mcp-shark/rule-packs/.

mcp-shark ships with 30 declarative rules as JSON packs (OWASP MCP, Agentic Security Initiative, General Security, AAuth Visibility), plus a toxic-flow-heuristics pack (toxic_flow_rules for cross-server composition). New vulnerability catalogs can be added as .json files — no JavaScript, no code changes.

bash
# Fetch latest rule packs from the registry
npx @mcp-shark/mcp-shark update-rules

# Use a custom/enterprise registry
npx @mcp-shark/mcp-shark update-rules --source https://internal.corp/rules/manifest.json

Downloaded packs are cached in .mcp-shark/rule-packs/ and merged with built-in rules on every scan.

json
{
  "id": "owasp-mcp-2027",
  "name": "OWASP MCP Top 10 (2027)",
  "version": "1.0.0",
  "rules": [
    {
      "id": "MCP01-token-mismanagement",
      "name": "Token Mismanagement",
      "severity": "critical",
      "framework": "OWASP-MCP",
      "description": "Detects hardcoded tokens in MCP configs",
      "patterns": [
        { "regex": "(api[_-]?key|token)\\s*[:=]", "flags": "i", "label": "API key pattern" }
      ],
      "scope": ["tool", "prompt", "resource", "packet"],
      "exclude_patterns": [{ "regex": "\\$\\{|process\\.env" }],
      "match_mode": "any"
    }
  ]
}

Custom YAML Rules (per-project)

Create .mcp-shark/rules/ in your project to add lightweight custom rules:

yaml
# .mcp-shark/rules/no-production-keys.yaml
id: custom-no-prod-keys
name: No Production Keys
severity: critical
description: Detects production API keys in MCP configs
match:
  env_pattern: "^(PROD_|PRODUCTION_)"
  value_pattern: "^sk-live|^pk-live"
message: "Production key detected in {key} — use staging keys for development"

Both YAML rules and JSON packs are loaded automatically on scan. Share them with your team by committing the folder.

User-Overridable Data (.mcp-shark/)

Every built-in data source can be extended or overridden through YAML files in your project root:

FileOverridesFormat
.mcp-shark/secrets.yamlSecret detection patternsList of { name, regex }
.mcp-shark/classifications.yamlServer/tool capability tagsNested map server: { capability: true }
.mcp-shark/flows.yamlToxic flow rulesList of { source_cap, target_cap, risk, ... }
.mcp-shark/rules/*.yamlCustom per-project rulesSee YAML Rules above
.mcp-shark/rule-packs/*.jsonOverride or add declarative packsSee JSON Packs above

User data is merged with built-in data at scan time. No rebuild required.

GitHub Action

yaml
# .github/workflows/mcp-security.yml
name: MCP Security Scan
on: [push, pull_request]
jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: mcp-shark/scan-action@v1
        with:
          format: sarif
          fail-on: high
      - uses: github/codeql-action/upload-sarif@v3
        if: always()
        with:
          sarif_file: mcp-shark-results.sarif

Supported IDEs

IDEConfig PathStatus
Cursor~/.cursor/mcp.json✅
Claude Desktop~/Library/.../claude_desktop_config.json✅
Claude Code~/.claude.json✅
VS Code~/.vscode/mcp.json✅
Windsurf~/.codeium/windsurf/mcp_config.json✅
Codex~/.codex/config.toml✅
Gemini CLI~/.gemini/settings.json✅
Continue~/.continue/config.json✅
Cline~/.../saoudrizwan.claude-dev/.../cline_mcp_settings.json✅
Amp~/.amp/mcp.json✅
Kiro~/.kiro/mcp.json✅
Zed~/.config/zed/settings.json✅
Augment~/.augment/mcp.json✅
Roo Code~/.roo-code/mcp.json✅
Project (local)./mcp.json, ./.mcp.json, ./.mcp/config.json✅

Security Rules (41)

OWASP MCP Top 10

IDRuleSeveritySource
MCP01Token MismanagementCriticaldeclarative
MCP02Scope CreepHighdeclarative
MCP03Tool PoisoningCriticaldeclarative
MCP04Supply ChainHighdeclarative
MCP05Command InjectionCriticalJS plugin
MCP06Prompt InjectionHighdeclarative
MCP07Insufficient AuthHighdeclarative
MCP08Lack of AuditMediumdeclarative
MCP09Shadow ServersHighdeclarative
MCP10Context InjectionHighdeclarative

Agentic Security Initiative (ASI)

IDRuleSeveritySource
ASI01Goal HijackCriticaldeclarative
ASI02Tool MisuseHighdeclarative
ASI03Identity AbuseHighdeclarative
ASI04Supply ChainHighdeclarative
ASI05Remote Code ExecutionCriticalJS plugin
ASI06Memory PoisoningHighdeclarative
ASI07Insecure CommunicationMediumdeclarative
ASI08Cascading FailuresMediumdeclarative
ASI09Trust ExploitationHighdeclarative
ASI10Rogue AgentCriticaldeclarative

AAuth Visibility (informational)

IDDescriptionSeverity
aauth-agent-identity-observedaauth:<local>@<domain> agent identity in tool/prompt/resource/packetLow
aauth-jwks-discovery-urlURLs containing /.well-known/aauth or /jwksLow
aauth-http-message-signature-observedRFC 9421 Signature-Input / Signature headers in captured trafficLow
aauth-mission-context-observedAAuth-Mission headers in captured trafficLow
aauth-requirement-challenge-observedAAuth-Requirement response headers (resource asking for AAuth)Low
aauth-bearer-token-coexists-with-aauthSame packet has both Bearer token and AAuth signatureMedium

General Security

RuleSeverity
Hardcoded SecretsCritical
Command InjectionCritical
Cross-Server ShadowingHigh
Tool Name AmbiguityMedium
DNS RebindingHigh
ANSI Escape SequencesMedium
Config File PermissionsMedium
Missing ContainmentHigh
Duplicate Tool NamesMedium
Shell/Env InjectionHigh
Excessive PermissionsHigh
Unsafe Default ConfigMedium
Path TraversalHigh
Sensitive Data ExposureHigh
Insecure TransportMedium

Browser dashboard

MCP Shark ships an in-browser dashboard on the local proxy for real-time MCP traffic, analysis, and exploration:

bash
npx @mcp-shark/mcp-shark serve --open

Same as the older shortcut (no serve subcommand):

bash
npx @mcp-shark/mcp-shark --open

The dashboard provides:

  • Multi-server aggregation and real-time traffic capture (filters, export, AAuth posture chips)
  • MCP Playground — call tools, prompts, and resources through the proxy against a selected upstream
  • Local Analysis — OWASP-style static scan over captured traffic; YARA Detection for traffic pattern rules (native engine when installed, regex fallback otherwise)
  • AAuth Explorer — graph of Agent / Mission / Resource / signing / access signals observed in traffic
  • Smart Scan — optional AI-backed scan (requires a configured API token)
  • In-app API docs, server setup, logs, and graceful shutdown

Zero-touch first boot

The dashboard bootstraps itself the first time you launch it on a new machine — no Setup wizard click required:

  1. If ~/.mcp-shark/mcps.json already declares upstreams (e.g. from a previous run, hand-edit, or testbed:up), the proxy starts directly with that config.
  2. Otherwise, on a brand-new install (no ~/.mcp-shark at all), MCP Shark scans for a real editor MCP config (~/.cursor/mcp.json, ~/.codeium/windsurf/mcp_config.json, ~/.codex/config.toml). If one is found with actual upstreams, it auto-imports them, writes ~/.mcp-shark/mcps.json, starts the proxy, and patches the editor config so the editor routes through the proxy.
  3. If neither path applies, the UI starts in monitoring-only mode and the Setup panel is still available for manual configuration.

To re-trigger first-boot behavior on a machine, remove ~/.mcp-shark/ and restart the UI.

Architecture

┌────────────────────────────────────────────────────┐
│  CLI (Commander.js)                                │
│  scan · lock · diff · doctor · list · watch · tui  │
│  update-rules · serve                              │
├──────────────┬──────────────┬──────────────────────┤
│  ConfigScanner│  ScanService  │  StaticRulesService  │
│  15 IDEs      │  orchestrator │  41 rules            │
├──────────────┴──────────────┴──────────────────────┤
│  Data layer (JSON + user YAML/JSON overrides)      │
│  ┌────────────┬──────────────┬───────────────────┐ │
│  │ rule-packs │ secret-      │ tool-             │ │
│  │ (30 rules) │ patterns.json│ classifications   │ │
│  ├────────────┼──────────────┼───────────────────┤ │
│  │ toxic-flow │ rule-        │ .mcp-shark/*.yaml │ │
│  │ rules.json │ sources.json │ (user overrides)  │ │
│  └────────────┴──────────────┴───────────────────┘ │
├────────────────────────────────────────────────────┤
│  JS plugins (11 rules needing algorithmic logic)   │
│  + DeclarativeRuleEngine (30 pattern-based rules)  │
└────────────────────────────────────────────────────┘

Design principles:

  • Data-first — Declarative rules, secret patterns, tool classifications, and toxic-flow defaults ship as JSON; 30 of 41 rules are pattern packs you can extend or override without forking those definitions.
  • User-overridable — Built-in data can be extended via .mcp-shark/*.yaml (and JSON pack drops) as documented above.
  • Hybrid rule engine — The other 11 rules are JS plugins where heuristics need code. Both sources are merged at scan time.
  • Zero-config scanning — npx and go. Auto-detects the IDE paths below plus project-local mcp.json variants.

Documentation

Requirements

  • Node.js: 20.0.0 or higher
  • OS: macOS, Windows, or Linux

License

Source-Available Non-Commercial License

  • ✅ View, fork, modify, run for personal, educational, or internal company use
  • ❌ Sell, resell, or integrate into paid products/services without written permission

See LICENSE for full terms.

CLI demo

Same one-liner as Quick Start (default scan). Terminal output depends on your config:

bash
npx @mcp-shark/mcp-shark

mcp-shark demo

Support


Use o MCP de MCP Shark com vários modelos de IA

O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho. Assim, após conectar MCP Shark, é possível usá-lo com diferentes modelos de IA no TypingMind, em vez de configurá-lo separadamente para cada modelo. Este MCP é executado localmente no seu dispositivo por meio do conector MCP do TypingMind.

Guia de configuração para usar o conector local

Use esta opção quando o servidor MCP precisar acessar arquivos locais, aplicativos ou recursos privados no seu computador.

1

Abra as configurações de MCP

No TypingMind, vá até Configurações, Configurações avançadas e depois Model Context Protocol e selecione Configurar conector.

  1. Abra o TypingMind no navegador.
  2. Clique no ícone de Ajustes.
  3. Acesse Configurações avançadas.
  4. Abra a seção Model Context Protocol.
  5. Clique em Configurar conector e selecione Este dispositivo.
Tela de configuração do conector MCP do TypingMind com a opção Este dispositivo selecionada
2

Execute o comando do conector

Selecione Este dispositivo, copie o comando do TypingMind e execute-o no Terminal. Mantenha o processo em execução enquanto usa o MCP.

  1. Copie o comando de configuração exibido pelo TypingMind.
  2. Abra o Terminal no macOS ou o Windows Terminal no Windows.
  3. Cole e execute o comando.
  4. Autorize a instalação do pacote se o Terminal pedir confirmação para continuar.
  5. Mantenha o processo em execução na janela do Terminal enquanto usa as ferramentas MCP.
3

Adicione MCP Shark como servidor

Quando o status do conector for Pronto, clique em Editar e cole a configuração do servidor MCP.

  1. Aguarde até que o status do conector mostre Pronto.
  2. Clique em Editar.
  3. Cole a configuração do servidor MCP de MCP Shark.
  4. Salve a lista de servidores.
  5. Atualize para confirmar se o conector ainda está pronto para uso.
Configurações de MCP do TypingMind mostrando um servidor ativo e o botão Editar
{
  "mcpServers": {
    "mcp-shark": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use a conexão com diferentes modelos

Salve a lista de servidores, abra Plugins, ative as ferramentas MCP de MCP Shark, selecione qualquer modelo de IA compatível no TypingMind e use as ferramentas no chat ou atribua-as a um agente de IA.

  1. Abra a página Plugins no TypingMind.
  2. Ative as ferramentas MCP de MCP Shark.
  3. Inicie um chat e escolha o modelo de IA que deseja usar.
  4. Use as ferramentas MCP no chat ou atribua-as a um agente de IA.
  5. Mude para outro modelo de IA sempre que necessário, sem reconectar o MCP.
Chat do TypingMind usando ferramentas MCP ativadas com um modelo de IA selecionado
Pode usar MCP Shark para me ajudar nesta tarefa?
MCP Shark
Claro. Já li.
Veja o que encontrei usando MCP Shark.

Perguntas frequentes

Para que serve o servidor MCP MCP Shark?

MCP Shark é um servidor MCP que permite que aplicativos de IA compatíveis se conectem a ferramentas externas e informações de contexto. No TypingMind, basta adicionar esse servidor MCP uma vez para disponibilizar suas ferramentas no seu espaço de trabalho com IA.

Posso usar o MCP MCP Shark com vários modelos de IA no TypingMind?

Sim. O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho, permitindo usar MCP Shark com diferentes modelos de IA, como Claude, ChatGPT, Gemini ou outros modelos configurados no TypingMind, sem configurar o servidor MCP separadamente para cada modelo.

Por que usar o MCP MCP Shark com o TypingMind?

O TypingMind é uma das melhores interfaces de chat com LLMs porque reúne vários modelos de IA, prompts, plugins, agentes de IA, chaves de API e ferramentas MCP em um só espaço de trabalho. Com MCP Shark conectado, é possível usar suas ferramentas MCP nos seus modelos preferidos e manter seu fluxo de trabalho de chat organizado no TypingMind.

Como conecto o MCP MCP Shark ao TypingMind?

MCP Shark funciona por meio do conector MCP local do TypingMind. Essa é a melhor opção quando o servidor MCP precisa acessar arquivos locais, apps de desktop, ferramentas de linha de comando ou recursos privados no seu computador.

Quais ferramentas o MCP MCP Shark oferece no TypingMind?

MCP Shark disponibiliza recursos MCP que podem ser ativados na página Plugins do TypingMind e usados no chat ou atribuídos a agentes de IA.

Preciso compartilhar minhas chaves de API com o TypingMind para usar o MCP MCP Shark?

Não. O TypingMind prioriza o uso local e permite manter seus provedores de modelos, chaves de API, prompts e configuração MCP sob seu controle. Se MCP Shark exigir autenticação, adicione os cabeçalhos, as configurações OAuth ou a configuração local exigidos por esse servidor MCP ao criar a conexão.

Servidores MCP relacionados

Ver todos

Crie seu próprio espaço de IA agora

Inscreva-se na nossa newsletter para receber novidades sobre recursos e futuros sorteios 👇