Roslyn MCP Serverのロゴ

Roslyn MCP Server

コミュニティ
carquiza

A Model Context Protocol (MCP) server that provides C# code analysis capabilities using Microsoft Roslyn

公開者carquiza
リポジトリRoslynMCP
言語C#
フォーク
10
スター
61
利用可能なツール
0
通信方式stdio
カテゴリ
リンク
  • ツールをAIワークフローに接続

    Roslyn MCP Serverは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには61件のスターと10件のフォークがあります。

Roslyn MCP Server

A C# MCP (Model Context Protocol) server that integrates with Microsoft's Roslyn compiler platform to provide Claude Desktop with code analysis and navigation capabilities for C# codebases.

Features

  • Wildcard Symbol Search - Find classes, methods, and properties using pattern matching (*Service, Get*User, etc.)
  • Reference Tracking - Locate all usages of symbols across entire solutions
  • Symbol Information - Get detailed information about types, methods, properties, and more
  • Dependency Analysis - Analyze project dependencies and namespace usage patterns
  • Code Complexity Analysis - Identify high-complexity methods using cyclomatic complexity metrics
  • Performance Optimized - Multi-level caching and incremental analysis for large codebases
  • Security - Input validation and path sanitization

Prerequisites

  • .NET 8.0 SDK or later
  • Visual Studio 2022 or VS Code (recommended for development)
  • Claude Desktop application

Installation

  1. Clone or download the project

    bash
    git clone https://github.com/carquiza/RoslynMCP.git
    cd RoslynMCP/RoslynMcpServer
  2. Restore NuGet packages

    bash
    dotnet restore
  3. Build the project

    bash
    dotnet build
  4. Test the server (optional)

    bash
    dotnet run

Quick Setup

Windows

Run the PowerShell setup script:

powershell
.\setup.ps1

Linux/macOS

Run the installation test:

bash
./test-installation.sh

Claude Desktop Configuration

To connect this MCP server to Claude Desktop, you need to modify the Claude Desktop configuration file:

Configuration File Location

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Configuration Content

Add the following to your claude_desktop_config.json file:

json
{
  "mcpServers": {
    "roslyn-code-navigator": {
      "command": "dotnet",
      "args": [
        "run", 
        "--project", 
        "/path/to/RoslynMCP/RoslynMcpServer"
      ],
      "env": {
        "DOTNET_ENVIRONMENT": "Production",
        "LOG_LEVEL": "Information"
      }
    }
  }
}

Important: Replace /path/to/RoslynMCP/RoslynMcpServer with the actual absolute path to your project directory.

Usage

Once configured, restart Claude Desktop. You should see the Roslyn MCP Server appear in the available tools. Here are some example queries:

Search for Symbols

Search for all classes ending with 'Service' in my solution at C:\MyProject\MyProject.sln

Find References

Find all references to the UserRepository class in C:\MyProject\MyProject.sln

Get Symbol Information

Get information about the CalculateTotal method in C:\MyProject\MyProject.sln

Analyze Dependencies

Analyze dependencies for the solution at C:\MyProject\MyProject.sln

Code Complexity Analysis

Find methods with complexity higher than 7 in C:\MyProject\MyProject.sln

Available Tools

  1. SearchSymbols - Search for symbols using wildcard patterns
  2. FindReferences - Find all references to a specific symbol
  3. GetSymbolInfo - Get detailed information about a symbol
  4. AnalyzeDependencies - Analyze project dependencies and usage patterns
  5. AnalyzeCodeComplexity - Identify high-complexity methods

Development and Testing

Using MCP Inspector

For development and testing, you can use the MCP Inspector:

bash
# Install the inspector
npm install -g @modelcontextprotocol/inspector

# Test your server
npx @modelcontextprotocol/inspector dotnet run --project ./RoslynMcpServer

Architecture

The server features a modular architecture with:

  • MCP Server Layer: Handles communication with Claude Desktop
  • Roslyn Integration Layer: Manages workspaces and compilations
  • Search Engine Layer: Implements symbol search and analysis
  • Multi-level Caching: Performance optimization for large codebases
  • Security Layer: Input validation and sanitization

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Christopher Arquiza

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Roslyn MCP ServerのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Roslyn MCP Serverに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Roslyn MCP Serverをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. Roslyn MCP ServerのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "roslynmcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてRoslyn MCP ServerのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. Roslyn MCP ServerのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Roslyn MCP Serverを使ってこのタスクを手伝ってもらえますか?
Roslyn MCP Server
はい、読みました。
Roslyn MCP Serverで調べた結果をお伝えします。

よくある質問

Roslyn MCP Server MCPサーバーは何に使いますか?

Roslyn MCP Serverは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでRoslyn MCP Server MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでRoslyn MCP Serverを利用できます。

TypingMindでRoslyn MCP Server MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。Roslyn MCP Serverを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Roslyn MCP Server MCPをTypingMindに接続するにはどうすればよいですか?

Roslyn MCP ServerはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでRoslyn MCP Server MCPのどのようなツールを利用できますか?

Roslyn MCP ServerはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Roslyn MCP Server MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Roslyn MCP Serverで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇