Логотип Slither MCP

Slither MCP

Организация
trailofbits

MCP server for Slither static analysis of Solidity smart contracts

Издательtrailofbits
Репозиторийslither-mcp
ЯзыкPython
Форки
11
Звёзды
96
Доступные инструменты
0
Тип транспортаstdio
ЛицензияAGPL-3.0
Ссылки
  • Подключайте инструменты к рабочим процессам с ИИ

    Slither MCP предоставляет возможности MCP, доступные совместимым ИИ-клиентам и агентам.

  • Доступные инструменты: 0

    Ниже представлены доступные для вызова действия с названиями и описаниями, если сервер их предоставляет.

  • Готовая конфигурация для копирования

    Используйте примеры конфигурации, чтобы настроить этот сервер в предпочитаемом MCP-клиенте.

  • Показатели интереса к открытому проекту

    Звёзды: 96, форки: 11 — в связанном репозитории.

Slither MCP Server

Tests Python 3.11+ License: AGPL v3

A Model Context Protocol (MCP) server that provides static analysis capabilities for Solidity smart contracts using Slither.

Overview

This MCP server wraps Slither static analysis functionality, making it accessible through the Model Context Protocol. It can analyze Solidity projects (Foundry, Hardhat, etc.) and generate comprehensive metadata about contracts, functions, inheritance hierarchies, and more.

You can also use Slither MCP as an easy-to-use Slither API for other use cases.

Features

  • Caching: Slither runs are cached to {$PROJECT_PATH}/artifacts/project_facts.json for faster subsequent loads
  • MCP Tools: Query contract and function information through MCP tools
  • Security Analysis: Run Slither detectors and access results with filtering
  • Comprehensive Analysis: Extracts detailed information about:
    • Contract metadata (abstract, interface, library flags)
    • Function signatures and modifiers
    • Inheritance hierarchies
    • Function call relationships (internal, external, library calls)
    • Security vulnerabilities and code quality issues
    • Source code locations

While this is a v1.0 release, we anticipate API changes as we receive more feedback.

Installation

This project uses UV for package management:

bash
# Install dependencies
uv sync

# Or install in development mode
uv pip install -e .

Usage

Basic Usage

Start the Slither MCP server:

bash
uv run slither-mcp

All tools accept a path parameter that specifies which Solidity project to analyze. Projects are automatically cached in <path>/artifacts/project_facts.json for faster subsequent queries.

Use in Claude Code

bash
claude mcp add --transport stdio --scope user slither -- uvx --from git+https://github.com/trailofbits/slither-mcp slither-mcp

Use in Cursor

Make sure uvx is on your Cursor path using sudo ln -s ~/.local/bin/uvx /usr/local/bin/uvx

In your ~/.cursor/mcp.json:

json
{
  "mcpServers": {
    "slither-mcp": {
      "command": "uvx --from git+https://github.com/trailofbits/slither-mcp slither-mcp",
    }
  }
}

Metrics and Privacy

Slither MCP includes opt-out metrics to help improve reliability by letting us know how often LLMs use each tool and their successful call rate. Metrics are enabled by default but can be permanently disabled.

What We Collect

  • Tool call events (which tools are used)
  • Success/failure status

We do not collect: tool call parameters, contract details, function names, or any project-specific information.

Disabling Metrics

To permanently opt out:

bash
uv run slither-mcp --disable-metrics

For complete details, see METRICS.md.

MCP Tools

The server exposes tools for querying contract and function information. All tools accept a path parameter that specifies the Solidity project directory to analyze.

Query Tools

1. list_contracts - List contracts with filters

Requires: path (project directory) Filter contracts by type (concrete, abstract, interface, library) or path pattern.

2. get_contract - Get detailed contract information

Retrieve full contract metadata including functions, inheritance, and flags.

3. get_contract_source - Get contract source code

Returns the complete source code of the Solidity file containing the specified contract.

4. get_function_source - Get function source code

Returns the source code for a specific function with line numbers. Useful for focused analysis.

5. list_functions - List functions with filters

Filter functions by contract, visibility, or modifiers.

6. function_callees - Get function call relationships

Returns internal, external, and library callees for a function, including low-level call detection.

7. function_callers - Get functions that call a target function

Returns all functions that call the specified target function, grouped by call type (internal, external, library). This is the inverse of function_callees.

8. get_inherited_contracts - Get contract inheritance

Returns a recursive tree of all contracts that a contract inherits from (parents and ancestors).

9. get_derived_contracts - Get contracts that inherit from this one

Returns a recursive tree of all contracts that inherit from a contract (children and descendants).

10. list_function_implementations - Find function implementations

Find all implementations of a function signature across contracts.

11. list_detectors - List available Slither detectors

Returns metadata about Slither detectors including names, descriptions, impact levels, and confidence ratings. Supports filtering by name or description.

12. run_detectors - Get detector results with filtering

Returns cached detector results. Filter by detector names, impact level (High, Medium, Low, Informational), or confidence level (High, Medium, Low).

All tools return responses with a success boolean and either data fields or an error_message. See individual tool implementations in slither_mcp/tools/ for detailed schemas and usage.

Client Usage

The slither-mcp package includes a typed Python client (SlitherMCPClient) for programmatically interacting with the Slither MCP server. This is useful for building tools, scripts, or agents that need to query Solidity projects.

The client provides:

  • Type-safe methods for all MCP tools
  • Automatic serialization/deserialization of Pydantic models
  • Helper methods for common patterns
  • Tool wrappers for pydantic-ai agent integration

For detailed usage examples and documentation, see CLIENT_USAGE.md.

Requirements

  • Python 3.11+
  • Solidity compiler setup (Foundry, Hardhat, or similar)
  • Slither and its dependencies

Development

Pre-commit Hooks

Install pre-commit hooks to run linting before commits:

bash
pre-commit install

Running Tests

bash
uv run pytest

Используйте MCP Slither MCP с разными ИИ-моделями

TypingMind подключает инструменты MCP на уровне рабочего пространства, поэтому после подключения Slither MCP вы можете использовать их с разными моделями ИИ в TypingMind, не настраивая подключение отдельно для каждой модели. Эта интеграция MCP работает локально на вашем устройстве через коннектор MCP TypingMind.

Руководство по настройке локального коннектора

Выберите этот способ, если серверу MCP нужен доступ к локальным файлам, приложениям или закрытым ресурсам на вашем компьютере.

1

Откройте настройки MCP

В TypingMind откройте «Настройки», затем «Расширенные настройки», перейдите в раздел «Протокол контекста модели» и выберите «Настроить коннектор».

  1. Откройте TypingMind в браузере.
  2. Нажмите значок настроек.
  3. Перейдите в «Расширенные настройки».
  4. Откройте раздел «Протокол контекста модели».
  5. Нажмите «Настроить коннектор» и выберите «Это устройство».
Экран настройки коннектора MCP в TypingMind с выбранным вариантом «Это устройство»
2

Выполните команду коннектора

Выберите «Это устройство», скопируйте команду из TypingMind и выполните её в терминале. Не останавливайте процесс, пока используете MCP.

  1. Скопируйте команду настройки, показанную в TypingMind.
  2. Откройте «Терминал» в macOS или Windows Terminal в Windows.
  3. Вставьте и выполните команду.
  4. Подтвердите установку пакета, если терминал запросит разрешение продолжить.
  5. Не закрывайте окно терминала и не останавливайте процесс, пока используете инструменты MCP.
3

Добавьте Slither MCP как сервер

Когда статус коннектора сменится на «Готов», нажмите «Изменить серверы» и вставьте конфигурацию сервера MCP.

  1. Дождитесь, пока статус коннектора сменится на «Готов».
  2. Нажмите «Изменить серверы».
  3. Вставьте конфигурацию сервера MCP для Slither MCP.
  4. Сохраните список серверов.
  5. Обновите статус, если хотите убедиться, что коннектор по-прежнему готов к работе.
Настройки MCP в TypingMind с активным сервером и кнопкой «Изменить серверы»
{
  "mcpServers": {
    "slither-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Используйте подключение с разными моделями

Сохраните список серверов, откройте раздел «Плагины», включите инструменты MCP для Slither MCP, затем выберите любую поддерживаемую модель ИИ в TypingMind и используйте инструменты в чате или назначьте их ИИ-агенту.

  1. Откройте страницу «Плагины» в TypingMind.
  2. Включите инструменты MCP для Slither MCP.
  3. Начните чат и выберите модель ИИ, которую хотите использовать.
  4. Используйте инструменты MCP в чате или назначьте их ИИ-агенту.
  5. При необходимости переключайтесь на другую модель ИИ без повторного подключения MCP.
Чат TypingMind с включёнными инструментами MCP и выбранной ИИ-моделью
Можете помочь мне с этой задачей с помощью Slither MCP?
Slither MCP
Конечно. Я всё прочитал.
Вот что я нашёл с помощью Slither MCP.

Часто задаваемые вопросы

Для чего используется сервер MCP Slither MCP?

Slither MCP — это сервер MCP, который позволяет совместимым ИИ-клиентам подключаться к внешним инструментам и получать контекст. В TypingMind достаточно один раз добавить этот сервер MCP, чтобы его инструменты стали доступны в вашем рабочем пространстве с ИИ.

Можно ли использовать сервер MCP Slither MCP с несколькими ИИ-моделями в TypingMind?

Да. TypingMind подключает инструменты MCP на уровне рабочего пространства, поэтому вы можете использовать Slither MCP с разными ИИ-моделями, например Claude, ChatGPT, Gemini или другими моделями, настроенными в TypingMind, без отдельной настройки сервера MCP для каждой модели.

Зачем использовать MCP Slither MCP с TypingMind?

TypingMind — один из лучших интерфейсов для чата с LLM: он объединяет разные ИИ-модели, промпты, плагины, ИИ-агентов, ключи API и инструменты MCP в одном рабочем пространстве. Подключив Slither MCP, вы сможете использовать его инструменты MCP с предпочитаемыми моделями, сохраняя удобную организацию работы с чатами в TypingMind.

Как подключить сервер MCP Slither MCP к TypingMind?

Slither MCP работает через локальный коннектор MCP TypingMind. Этот вариант лучше всего подходит, когда серверу MCP нужен доступ к локальным файлам, настольным приложениям, инструментам командной строки или закрытым ресурсам на вашем компьютере.

Какие инструменты предоставляет сервер MCP Slither MCP в TypingMind?

Slither MCP предоставляет возможности MCP, которые можно включить на странице «Плагины» в TypingMind и использовать в чате или назначить ИИ-агентам.

Нужно ли передавать TypingMind свои ключи API для использования сервера MCP Slither MCP?

Нет. TypingMind ориентирован прежде всего на локальную работу и позволяет вам контролировать выбор провайдеров моделей, ключи API, промпты и конфигурацию MCP. Если Slither MCP требует аутентификации, при создании подключения добавьте необходимые заголовки, настройки OAuth или локальную конфигурацию для этого сервера MCP.

Похожие серверы MCP

Все

Создайте свою рабочую ИИ-среду сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇