convez.ai
MCP ServerDevOps & InfraestruturaAvançado
sharpninja

MCP Server .NET — Infraestrutura de Agentes com Orquestração

sharpninja/McpServer

Plataforma de agentes .NET com busca semântica, orquestração e GitHub automation

Ver no GitHub
InicialPluginScore · de 0 a 100

Servidor MCP multi-transporte (HTTP/STDIO) para .NET que oferece orquestração de agentes, busca semântica com GraphRAG, gestão de TODOs, automação GitHub e rastreamento de requisitos. Suporta múltiplos bancos de dados (SQLite, SQL Server, PostgreSQL) com isolamento de workspaces e CLI interativa.

Instalação

$npx convez-ai sharpninja/McpServer

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
9
Forks
1
Acompanhando
3
Saúde
28%
Último commit
há 1 dia
Versão
mcp-server-v1.0.258.0
Issues abertas
3
Contribuidores
3

Casos de uso

  • Construir sistemas multi-agentes com orquestração centralizada em .NET
  • Implementar busca semântica vetorial com ONNX e GraphRAG em aplicações
  • Automação de repositórios e GitHub com rastreamento de requisitos FR/TR/TEST
  • Gestão de contexto e TODOs com auditoria para fluxos de IA

Veredito

Infraestrutura robusta para times que precisam orquestrar agentes .NET em produção com semântica vetorial e isolamento de workspaces. Requer familiaridade com .NET, SQL e arquitetura de sistemas distribuídos — não é solução plug-and-play, mas altamente composável para casos corporativos complexos.

README

A tradução para o português deste README ainda está na fila.

MCP Server

Workspace-scoped AI agent infrastructure for .NET — context retrieval, TODO orchestration, session logging, repository operations, GitHub automation, GraphRAG, and agent orchestration over HTTP and MCP STDIO transports.

Key Features

  • Dual transport — HTTP REST with Swagger UI and MCP-over-STDIO for direct agent integration
  • Multi-tenant workspaces — single port, workspace isolation via header, API key, or default resolution
  • Agent orchestration — process-isolated agent pool with branch strategies, PowerShell sessions, and desktop automation
  • Semantic search — ONNX-based vector embeddings with HNSW indexing, optional GraphRAG enhancement
  • Requirements traceability — FR/TR/TEST document management with validation and Markdown/ZIP export
  • Multi-provider storage — SQLite, SQL Server, and PostgreSQL with automatic migrations
  • REPL CLI tool — mcpserver-repl for interactive use and agent STDIO access via single-line JSON request envelopes
  • Typed .NET client — SharpNinja.McpServer.Client NuGet package covering all API endpoints

Quick Start

# Build
./build.ps1 Compile

# Run
./build.ps1 StartServer --instance default

# Test
./build.ps1 Test

Open Swagger at http://localhost:7147/swagger.

Architecture

src/
  McpServer.Support.Mcp     ASP.NET Core server (controllers, STDIO host, auth)
  McpServer.Client           Typed REST client library (NuGet)
  McpServer.McpAgent         Microsoft Agent Framework integration
  McpServer.Repl.Core        REPL protocol, request envelopes, trust bootstrap
  McpServer.Repl.Host        mcpserver-repl CLI tool
  McpServer.Services         Business logic (ingestion, indexing, TODO, GitHub, agents)
  McpServer.Storage          EF Core abstraction + vector indexing
  McpServer.GraphRag         Hybrid semantic search with GraphRAG
  McpServer.Cqrs             Lightweight async CQRS framework (NuGet)
  McpServer.Cqrs.Mvvm        MVVM extensions for CQRS
  McpServer.Launcher          Windows GUI launcher
  McpServer.ServiceDefaults  Aspire service defaults, OpenTelemetry, health checks

Transports

HTTP

./build.ps1 StartServer --instance default
# Listens on http://localhost:7147

MCP STDIO

dotnet run --project src/McpServer.Support.Mcp -- --transport stdio --instance default

REPL

./build.ps1 InstallReplTool
mcpserver-repl --interactive              # interactive mode
mcpserver-repl --agent-stdio              # STDIO mode for agent integration

Direct --agent-stdio callers send one single-line JSON request envelope per stdin line. Do not send formatted YAML or a type: batch envelope.

API Surface

RouteCapability
/mcpserver/todoTODO CRUD, audit history, priority/section filtering, prompt generation
/mcpserver/sessionlogSession log upsert, query, full-text search, pagination
/mcpserver/contextHybrid semantic search with GraphRAG, deterministic context packs
/mcpserver/agentsAgent definitions, workspace config, deployment status
/mcpserver/agent-poolPool lifecycle, health monitoring, process isolation
/mcpserver/repoRepository read/list/write with allowlist enforcement
/mcpserver/requirementsFR/TR/TEST documents, validation, Markdown/ZIP export
/mcpserver/workspaceMulti-tenant workspace resolution and management
/mcpserver/ghGitHub issues, PRs, workflows, repository metadata
/mcpserver/toolsTool capability registration, discovery, schema validation
/mcpserver/graphragGraphRAG query with mode selection
/mcpserver/eventsServer-sent events for real-time change notifications
/mcpserver/templatesPrompt template storage and rendering
/mcpserver/voiceVoice conversation management
/mcpserver/desktopDesktop application launch (Windows)
/mcpserver/diagnosticHealth, version, database connectivity, index status
/mcpserver/configurationApplication configuration retrieval
/mcpserver/tunnelReverse proxy for agent communication
/authOIDC discovery, device authorization flow, token endpoint
/healthHealth check
/swaggerOpenAPI documentation

Configuration

Primary config section: Mcp. Instance overrides under Mcp:Instances:{name}.

{
  "Mcp": {
    "Port": 7147,
    "RepoRoot": ".",
    "DataSource": "mcp.db",
    "ApiKey": "your-api-key",
    "TodoStorage": { "Provider": "yaml" },
    "Instances": {
      "default": { "Port": 7147, "RepoRoot": "." },
      "alt-local": { "Port": 7157, "TodoStorage": { "Provider": "sqlite" } }
    }
  }
}

Environment overrides: PORT (runtime port), MCP_INSTANCE (instance selection).

Authentication

MethodUse Case
API keyServer-to-server, per-workspace isolation via X-Workspace-Path header
OIDC / KeycloakExternal identity provider with JWT Bearer validation and device authorization flow
Embedded IdentityServerLocal OIDC authority when Mcp:IdentityServer:Enabled = true
Marker file trustCryptographic signature validation for REPL protocol bootstrap

Storage

Database providers (EF Core with automatic migrations):

ProviderProject
SQLite (default)McpServer.Storage.SqliteMigrations
SQL ServerMcpServer.Storage.SqlServerMigrations
PostgreSQLMcpServer.Storage.PostgreSqlMigrations

TODO items can be stored as YAML files on disk (yaml) or in a SQLite table (sqlite), configured per instance.

Vector indexing uses ONNX Runtime with Sentence Transformer embeddings and HNSW index for semantic search.

Deployment

MethodDetails
Standalone./build.ps1 StartServer or dotnet run
Windows Service./build.ps1 UpdateService through the Nuke build; do not manually redeploy service files
DockerMulti-stage build, volumes for /data and /workspace
MSIX./build.ps1 PackageMsix for Windows app package
Windows LauncherGUI application for starting/managing the server

Build System

Nuke build orchestrator via ./build.ps1 (or ./build.sh on Linux/macOS).

TargetDescription
CompileRestore + build the solution (default)
TestRun all unit tests
PublishPublish server for deployment
UpdateServiceBuild/publish, backup config/data, update the Windows service, restore config/data, and health-check
PackNuGetPack McpServer.Client NuGet package
PackReplToolPack mcpserver-repl to local-packages/
PackageMsixCreate MSIX package for Windows
InstallReplToolInstall mcpserver-repl as a global dotnet tool
StartServerBuild and run MCP server
BumpVersionIncrement patch version in GitVersion.yml
ValidateConfigValidate appsettings instance configuration
ValidateTraceabilityCheck FR/TR/TEST requirements coverage
TestMultiInstanceTwo-instance smoke test
TestGraphRagSmokeGraphRAG endpoint smoke test
CleanClean artifacts and solution output

CI/CD

PlatformFileJobs
Azure Pipelinesazure-pipelines.ymlBuild, test, publish, MSIX, docs lint, docs build, NuGet publish
GitHub Actions.github/workflows/build.ymlBuild & test, validate, package, MSIX, publish

Client Library

dotnet add package SharpNinja.McpServer.Client
builder.Services.AddMcpServerClient(options =>
{
    options.BaseUrl = new Uri("http://localhost:7147");
    options.ApiKey = "your-api-key";
});

Covers: Todo, Context, SessionLog, GitHub, Repo, Workspace, ToolRegistry, Sync, and more.

Source: src/McpServer.Client/ | Package README

Agent Framework

McpServer.McpAgent integrates with the Microsoft Agent Framework:

builder.Services.AddMcpServerMcpAgent();

Built-in MCP tools: mcp_repo_read, mcp_repo_list, mcp_repo_write, mcp_desktop_launch, mcp_powershell_session_*. Workflows: session log lifecycle, TODO management, requirements ingestion.

Sample host: src/McpServer.McpAgent.SampleHost/

Tests

16 test projects covering unit, integration, and SpecFlow validation:

  • Build.Tests — build system and configuration (43 tests)
  • McpServer.Support.Mcp.Tests / .IntegrationTests — server API and database
  • McpServer.Client.Tests — REST client serialization
  • McpServer.McpAgent.Tests — agent workflows and tool adapters
  • McpServer.Repl.Core.Tests / .IntegrationTests — REPL protocol
  • McpServer.Cqrs.Tests — CQRS dispatcher and pipeline
  • 7 SpecFlow validation projects (Context, GitHub, Repo, SessionLog, Todo, ToolRegistry, Workspace)

Prerequisites

  • .NET SDK (version in global.json)
  • PowerShell 7+ (pwsh.exe)
  • Optional: Windows SDK (makeappx.exe) for MSIX, GitHub CLI (gh) for GitHub endpoints

Documentation

DocumentPurpose
User GuideEnd-user setup and usage
Server GuideOperations and configuration
Client IntegrationNuGet client library usage
REPL Migration GuideMigrating to mcpserver-repl
FAQCommon questions
Release ChecklistPre-release verification
Azure PipelinesCI/CD variables and retention

License

See LICENSE for details.

Shared Plugin Surfaces

This repository is the canonical home for the shared client surfaces used by all McpServer agent plugins:

  • PowerShell: tools/powershell/McpRepl (published to PS Gallery as McpRepl)
  • TypeScript: tools/typescript/mcp-repl-ts (published to npm as @sharpninja/mcp-repl)

See the respective READMEs in those directories and GROK-USAGE.md in the grok-plugin for usage details.

Ver o original no GitHub

Bom para

Relacionados