1. Conduid
  2. Maps
  3. Sharpitect
MCP server · Maps

Sharpitect

Analyze .NET codebases and generate C4 architecture diagrams. Includes CLI commands for graph navigation and an MCP server for IDE integration.

Unclaimed maps
34Low

Scored 6 months ago · breakdown

About Sharpitect

Sharpitect is an MCP server in the Maps category: analyze .NET codebases and generate C4 architecture diagrams. Includes CLI commands for graph navigation and an MCP server for IDE integration.

Install

From source
git clone https://github.com/nick-boey/sharpitect

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about Sharpitect

Powered by Claude · Grounded in docs

I know everything about Sharpitect. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ✓README presentThe repository ships documentation.

5 checks have not been run yet.

README

Sharpitect

Sharpitect generates C4 architecture diagrams from annotated C# codebases. It analyzes your code using Roslyn and builds a declaration graph that can be queried and visualized.

Features

  • Code Analysis - Extracts declarations (classes, interfaces, methods, properties, etc.) and their relationships using Roslyn
  • Declaration Graph - Builds a queryable graph of code elements with containment and reference relationships
  • Graph Search - Search for declarations by name with multiple match modes and kind filters
  • SQLite Persistence - Persist and query the declaration graph from a SQLite database
  • C4 Model Mapping - Maps code elements to C4 architecture model levels

C4 Conventions

Sharpitect maps C# constructs to C4 model elements following these conventions:

Systems

  • Systems are solutions (.sln files)

Containers

  • Containers are projects that generate an executable

Components

  • Components cannot be nested, but they can be grouped by namespaces or projects
  • Components may be projects, namespaces, or groups
  • Use the [Component] attribute to mark types as C4 components

Code

  • Code elements are automatically extracted class diagrams including classes, interfaces, methods, and properties

Usage

Analyzing a Solution

using Sharpitect.Analysis.Analyzers;
using Sharpitect.Analysis.Persistence;

// Create repository
var repository = new SqliteGraphRepository("architecture.db");
await repository.InitializeAsync();

// Analyze solution
var analyzer = new GraphSolutionAnalyzer(repository);
await analyzer.AnalyzeAsync("path/to/solution.sln");

Searching the Graph

using Sharpitect.Analysis.Graph;
using Sharpitect.Analysis.Search;

// Create search service with in-memory source
var graph = new DeclarationGraph();
var source = new InMemoryGraphSource(graph);
var searchService = new GraphSearchService(source);

// Search for classes containing "Service"
var query = new SearchQuery
{
    SearchText = "Service",
    MatchMode = SearchMatchMode.Contains,
    KindFilter = [DeclarationKind.Class]
};

var results = await searchService.SearchAsync(query);

Search Options

  • SearchText - The text to search for in Name and FullyQualifiedName
  • MatchMode - How to match: Contains, StartsWith, EndsWith, or Exact
  • KindFilter - Optional filter by declaration kind (Class, Interface, Method, etc.)
  • CaseSensitive - Whether the search is case-sensitive (default: false)

Project Structure

  • Sharpitect.Tool - Command-line tool entry point
  • Sharpitect.Analysis - Analysis engine with graph, persistence, search, and analyzers
  • Sharpitect.Attributes - Attributes for annotating code (targets .NET Framework 4.8 for broad compatibility)
  • Sharpitect.Analysis.Test - Unit tests

Installation

Installing as a Global Tool

dotnet tool install -g Sharpitect.Tool

If the sharpitect command is not found after installation, you need to add the .NET tools directory to your PATH. Add the following line to your shell configuration file (~/.bashrc, ~/.bash_profile, or ~/.zshrc):

export PATH="$PATH:$HOME/.dotnet/tools"

Then reload your shell configuration:

source ~/.bashrc  # or ~/.bash_profile or ~/.zshrc

Alternatively, you can run this one-liner to add it permanently:

echo 'export PATH="$PATH:$HOME/.dotnet/tools"' >> ~/.bashrc && source ~/.bashrc

Building

dotnet build Sharpitect.sln

Testing

dotnet test Sharpitect.sln

License

See LICENSE file for details.

README copy captured when this server was indexed; it may lag the repository. The original is authoritative.

Questions

About Sharpitect

How do I install Sharpitect?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is Sharpitect safe to use with an AI agent?

Its trust score is 34 out of 100 (low). It passes 1 of the 1 static security checks run so far. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Sharpitect still maintained?

Conduid hasn't recorded a commit date for this repository yet. Check the repository directly for recent activity.