TC

terhechte/cursor-rust-tools

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

83 stars 13 forks 品質 43 トレンド 14

terhechte/cursor-rust-tools は [https://github.com/terhechte/cursor-rust-tools.] からインポートされた MCP サーバーの候補です

概要

terhechte/cursor-rust-tools は [https://github.com/terhechte/cursor-rust-tools.] からインポートされた MCP サーバーの候補です

概要(AI 翻訳)

Cursor で LLM を許容する MCP サーバー Rust Analyzer、Crate Docs、Cargo Commandにアクセスします。

設定用のUIが含まれています。

それが何をするか

現在、さまざまなAIエージェントは、LSPからRust型情報にアクセスできるAIを提供していません。 型を見るのではなく、LLMは潜在的なタイプについて理由を持たなければならないので、これはハードルです。

また、依存関係(say tokio)に関する唯一の情報は、それらが訓練されたものです。 異なるバージョンの日付と潜在的に。 あらゆる課題にお応えします。

[Cursor Rust Tools] は、モデルコンテキストプロトコル ([MCP]) 上で利用できるようにします。

  • [crate または crate の特定のシンボルのドキュメントを取得する (例: tokio) または [tokio::spawn]))
  • ファイル内の特定のシンボルのホバー情報(タイプ、説明)を取得する
  • ファイル内の特定のシンボルのすべての参照のリストを取得する
  • ファイル内のシンボルの実装を取得します(実装を含む全ファイルを取得します)
  • プロジェクトをファイルで名前を付け、ホバー情報を返すだけでタイプを見つける
  • [cargo testの出力を取得する
  • [[T8]の出力を取得する]

使い方

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

Cursor Rust Tools

A MCP server to allow the LLM in Cursor to access Rust Analyzer, Crate Docs and Cargo Commands.

Includes an UI for configuration.

What it does

Currently, various AI agents don’t offer the AI the ability to access Rust type information from the LSP. This is a hurdle because instead of seeing the type, the LLM has to reason about the potential type.

In addition, the only information about the dependencies (say tokio) are what they were trained on which is out of date and potentially for a different version. This can lead to all kinds of issues.

Cursor Rust Tools makes these available over the Model Context Protocol (MCP).

  • Get the documentation for a crate or for a specific symbol in the crate (e.g. tokio or tokio::spawn)
  • Get the hover information (type, description) for a specific symbol in a file
  • Get a list of all the references for a specific symbol in a file
  • Get the implementation of a symbol in a file (retrieves the whole file that contains the implementation)
  • Find a type just by name in a file the project and return the hover information
  • Get the output of cargo test
  • Get the output of cargo check

How it works

For the LSP functionality src/lsp it spins up a new Rust Analyzer that indexes your codebase just like the on running in your editor. We can’t query the one running in the editor because Rust Analyzer is bound to be used by a single consumer (e.g. the open document action requires a close document in the right order, etc)

For documentation, it will run cargo docs and then parse the html documentation into markdown locally. This information is stored in the project root in the .docs-cache folder.

Installation

cargo install --git https://github.com/terhechte/cursor-rust-tools

Run With UI

cursor-rust-tools

This will bring up a UI in which you can add projects, install the mcp.json and see the activity.

Run Without UI

Alternatively, once you have a ~/.cursor-rust-tools set up with projects, you can also just run it via

cursor-rust-tools --no-ui

Configuration

In stead of using the UI to create a configuration, you can also set up ~/.cursor-rust-tools yourself:

[[projects]]
root = "/Users/terhechte/Developer/Rust/example1"
ignore_crates = []

[[projects]]
root = "/Users/terhechte/Developer/Rust/example2"
ignore_crates = []

ignore_crates is a list of crate dependency names that you don’t want to be indexed for documentation. For example because they’re too big.

Configuring Cursor

One the app is running, you can configure Cursor to use it. This requires multiple steps.

GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →