MCP Visual
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Visual show me the projects in this .NET solution and their dependencies"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Visual
Servidor Model Context Protocol que expone soluciones de
.NET / Visual Studio (.sln, .slnx, .csproj) a cualquier agente de trabajo (agent harness):
Claude Code, Claude Desktop, Cursor, Cline, VS Code, o cualquier cliente MCP propio.
El agente no necesita entender el formato de disco de Visual Studio: pide la solución, los proyectos, los ficheros o el grafo de dependencias y recibe JSON estructurado.
Características
14 tools (una clase por tool, un schema Zod por tool) y 4 resources + 1 template para lectura cacheable, y 3 prompts versionados en el servidor.
Completions,
resources/subscribecon notificaciones por cambios en disco ystructuredContenten las respuestas de las tools.Herencia de MSBuild:
Directory.Build.props,Directory.Packages.propseImport; búsqueda de símbolos C#, ciclos en el grafo y assets declarados enItemGroup.Transportes STDIO (por defecto) y HTTP Streamable con sesiones (
Mcp-Session-Id, GET/SSE,DELETE, TTL de sesión, respuestas JSON para clientes sin SSE).Soporte de
.slnclásico y.slnx(formato XML de .NET 9).Arquitectura en capas con SOLID y dependencias hacia dentro; un único composition root.
Rutas siempre confinadas al
PROJECT_ROOT(protección contra path traversal).Paginación
limit/offsetconnextOffseten todas las listas y proyecciónview=summary.Errores JSON-RPC tipados (
-32602,-32601,-32603,-32000) condata, nunca stack traces.Observabilidad: logs estructurados a
stderr, métricas por tool yGET /stats.Rate limiting por tool/sesión y API key opcional en HTTP.
Sin dependencias de .NET instalado: se leen los ficheros, no se ejecuta MSBuild.
Related MCP server: dotnet-sherlock-mcp
Requisitos
Node.js
>= 18.17.0npm
>= 9
Instalación
npm ci
npm run buildConfiguración
Copia .env.example a .env y ajusta PROJECT_ROOT:
cp .env.example .envVariable | Por defecto | Descripción |
| — (obligatoria) | Ruta absoluta de la carpeta que contiene la |
|
|
|
|
|
|
|
| Puerto en modo HTTP. |
|
| TTL de |
|
|
|
|
| Tope por defecto de |
|
| Expone |
|
| Límite por tool y sesión. |
|
| Vida de una sesión HTTP inactiva. |
|
| Tamaño máximo de una petición HTTP. |
| — | Si se define, HTTP exige cabecera |
|
| Enmascara contraseñas, claves y tokens en |
| — | Fichero JSON donde persiste el rate limit entre reinicios. |
| — | Activa OAuth: emisor esperado del bearer token. |
| — | Audiencia esperada del token. |
|
| JWKS para validar la firma. |
| — | Exporta trazas por OTLP/HTTP (spans por tool). |
Ejecución
npm run build
npm start # respeta MCP_TRANSPORT del .envModo HTTP:
MCP_TRANSPORT=http PORT=3001 node dist/server/index.js
# GET /health -> {"status":"ok"} (sin auth, para probes)
# GET /ready -> configuración + sesiones activas
# GET /stats -> métricas por tool y tokens (JSON)
# GET /metrics -> las mismas métricas en formato Prometheus
# GET /.well-known/oauth-protected-resource -> metadata OAuth (si OAUTH_ISSUER está definido)
# POST /mcp -> initialize / tools / resources / prompts
# GET /mcp -> stream SSE de la sesión
# DELETE /mcp -> cierra la sesiónLa primera petición initialize devuelve Mcp-Session-Id; las siguientes lo reutilizan. Una sesión
desconocida responde 404 y una inactiva se cierra sola al expirar SESSION_TTL_SECONDS.
Modo STDIO (por defecto): el proceso habla MCP por stdin/stdout y escribe todos los logs por
stderr, así que el stream JSON-RPC nunca se corrompe.
Conectar un agente
Claude Code / Claude Desktop
{
"mcpServers": {
"mcp-visual": {
"command": "node",
"args": ["C:/ruta/a/mcp-visual/dist/server/index.js"],
"env": { "PROJECT_ROOT": "C:/ruta/a/MiSolucion" }
}
}
}VS Code (.vscode/mcp.json)
{
"servers": {
"mcp-visual": {
"type": "stdio",
"command": "node",
"args": ["C:/ruta/a/mcp-visual/dist/server/index.js"],
"env": { "PROJECT_ROOT": "C:/ruta/a/MiSolucion" }
}
}
}Cliente HTTP / web
{ "url": "http://127.0.0.1:3001/mcp", "headers": { "x-api-key": "tu-clave" } }Herramientas
Todas las listas aceptan limit (máximo de elementos) y offset, y devuelven total, returned,
truncated y nextOffset.
Herramienta | Entrada | Devuelve |
|
| Solución + proyectos enriquecidos. |
|
| Proyectos con el mismo formato. |
|
| Metadatos del |
|
| Ficheros del proyecto (sin |
|
| Referencias |
|
| Target frameworks y output type. |
|
| Grafo proyecto → referencias. |
|
| Resumen, issues y recomendaciones. |
|
| Assets estáticos. |
|
| Todas las |
|
| Ventana de líneas y total del fichero. |
|
| Coincidencias con fichero y línea. |
|
| Clases, interfaces, métodos y propiedades con fichero y línea. |
|
| Abre la solución en Visual Studio y devuelve el PID. |
view: "summary" recorta la respuesta a lo esencial (menos tokens por llamada).
open_solution es la única herramienta con efectos: localiza Visual Studio con vswhere,
confina la solución a PROJECT_ROOT y lanza devenv.exe en modo detached. Sin Visual Studio
devuelve IDE_NOT_FOUND.
Resources
Lectura estática y cacheable, separada de las acciones. Cada resource lleva _meta.etag para
detectar cambios sin volver a transferir el contenido.
URI | Contenido |
| Solución raíz y sus proyectos (resumen). |
| Proyectos con metadatos de build. |
| Todas las soluciones del workspace. |
| Assets estáticos. |
| Contenido de un fichero (hasta 2000 líneas). |
resources/list pagina con cursor/nextCursor. Los ficheros se exponen como template para no
inundar el contexto con miles de entradas en un monorepo.
resources/subscribe está soportado: el servidor observa PROJECT_ROOT (recursivo, con debounce) y
emite notifications/resources/updated para las URIs suscritas cuando algo cambia.
Prompts
Plantillas del servidor, tipadas y versionadas (_meta.version), en lugar de prompts hardcodeados en
el cliente.
Prompt | Argumentos |
|
|
|
|
|
|
Un prompt no gasta contexto por sí mismo: instruye al agente sobre qué tools llamar y con qué forma.
completion/complete autocompleta projectPath, projectPaths, solutionPath, directory y el
marker de find_todos con datos reales del workspace.
Errores
Dos niveles, ambos sin stack traces hacia el modelo:
Protocolo (JSON-RPC):
-32602argumentos inválidos (condata.detailspor campo),-32601tool/prompt desconocido,-32000rate limit (data.retryAfterMs),-32603fallo interno.Ejecución de tool:
isError: truecon{ "error": { "code", "message", "data?" } }.
Códigos de dominio: MISSING_PROJECT_ROOT, INVALID_PROJECT_ROOT, SOLUTION_NOT_FOUND,
PATH_TRAVERSAL, CSPROJ_PARSER_ERROR, TEXT_READER_ERROR, FILE_SCANNER_ERROR,
INVALID_TOOL_ARGUMENT, UNKNOWN_TOOL, RESOURCE_NOT_FOUND, RATE_LIMITED, IDE_NOT_FOUND.
Arquitectura
src/
├── domain/ # Modelos y puertos. Sin I/O, sin frameworks.
│ ├── models/ # project-types, project, csprojfile, solution, dependencygraph, fileentry, analysisreport
│ ├── services/ # solution-reader, csproj-parser, dependency-analyzer, file-scanner,
│ │ # path-resolver, text-reader, ide-launcher
│ └── errors/ # DomainError (message, code, data)
├── application/ # Casos de uso + DTOs + paginación. Solo depende de domain.
│ ├── use-cases/ # 13 casos de uso, uno por capacidad
│ ├── dtos/ # project-summary, solution-summary
│ └── pagination.ts # limit/offset/nextOffset compartido
├── infrastructure/ # Adaptadores concretos de los puertos.
│ ├── fs/ # LogicalFs, NodeFsAdapter, PhysicalPathResolver
│ ├── io/ # NodeTextReader, FastXmlParser, CacheAdapter
│ ├── caching/ # CachedCsprojParser (decorator TTL)
│ ├── logging/ # ConsoleLogger (stderr, niveles, meta JSON)
│ ├── metrics/ # InMemoryMetrics (latencia, tokens) + Prometheus
│ ├── msbuild/ # MSBuildPropsResolver (props, imports, versiones centrales)
│ ├── auth/ # OAuthTokenVerifier (JWKS)
│ ├── otel/ # OtlpHttpTracer (trazas sin SDK)
│ ├── ratelimit/ # JsonRateLimitStore
│ ├── watch/ # NodeChangeWatcher (resources/subscribe)
│ ├── ide/ # VisualStudioLauncher (vswhere + devenv)
│ └── services/ # NodeSolutionReader, NodeCsprojParser, NodeFileScanner, NodeDependencyAnalyzer
├── presentation/
│ ├── mcp/
│ │ ├── itool.ts # ITool + ToolContext + JSON Schema desde Zod
│ │ ├── tool-registry.ts # registro explícito + validación
│ │ ├── tools/ # 14 clases, una por tool
│ │ ├── resources/ # IResource, registry con cursor/caché/ETag, 5 resources
│ │ ├── prompts/ # IPrompt, registry, 3 prompts versionados
│ │ ├── completions.ts # autocompletado con datos del workspace
│ │ ├── subscriptions.ts # bookkeeping de resources/subscribe
│ │ ├── errors/ # DomainError → McpError / payload de tool
│ │ └── server.ts # handlers MCP + middleware de errores y métricas
│ ├── http/ # Streamable HTTP con sesiones, auth, /stats, /metrics, OAuth
│ └── stdio/ # StdioServerTransport
├── shared/ # asset-config, logger, metrics, tokens, rate-limiter, redact, tracer
├── composition-root.ts# Único lugar donde se eligen los adaptadores
└── server/index.ts # Bootstrap: env, config, transporte, graceful shutdownPrincipios aplicados:
S — una clase por tool, un registry por tipo de primitiva, un caso de uso por capacidad.
O — añadir una tool es añadir una clase y registrarla; ni el servidor ni los transportes cambian.
L —
CachedCsprojParsery los adaptadores deLogicalFssustituyen a los originales.I — puertos pequeños (
TextReader,FileScanner,IdeLauncher,Metrics…).D —
domain/applicationdependen de interfaces; el composition root inyecta lo concreto, sin service locator ni reflexión.
Scripts
npm run typecheck # tsc --noEmit
npm test # Jest (unitarias + integración de tools/resources/prompts)
npm run build # dist/
npm run verify # typecheck + test + build
npm start # servidor compiladoLas pruebas de integración usan un fixture .NET versionado en test/fixtures/workspace.
Limitaciones conocidas
No ejecuta MSBuild: no resuelve imports de
Directory.Build.propsni paquetes transitivos reales.El grafo de dependencias es directo (proyecto → referencias declaradas), sin detección de ciclos.
Los assets se detectan por carpeta y extensión; no se interpretan
ItemGroup/Content.search_symbolses declarativo (regex), no un parser Roslyn: no resuelve genéricos complejos,partialrepartidos ni sobrecargas por firma.Los paquetes transitivos son los alcanzables por referencias de proyecto; no se expande el grafo de dependencias de cada paquete NuGet (requiere restore).
OAuth valida firmas con JWKS, pero no implementa el servidor de autorización ni
tasksde larga duración.OpenTelemetry exporta trazas; las métricas se exponen en
/metrics, no por OTLP.No se usa sampling: el servidor no necesita un LLM para analizar código.
Si
tools/callllega conargumentsque no es un objeto, el SDK rechaza la petición antes del servidor con-32603y un mensaje de Zod verboso; es limitación de@modelcontextprotocol/sdk.
Licencia
MIT — ver LICENSE.
Available Tools
14 toolsanalyze_projectAnalyze projectC
Returns a structured report with line counts and TODO/FIXME markers.
Inputs: limit, projectPath. Returns: object
get_projectGet projectB
Returns one project's kind, target framework, output type and references.
Inputs: projectPath (required), view. Returns: object
get_project_dependenciesGet project dependenciesC
Builds the dependency graph that starts at the given projects.
Inputs: projectPaths (required). Returns: object
get_project_referencesGet project referencesB
Returns the project, package and assembly references of a project.
Inputs: projectPath (required), kind, limit, offset. Returns: object
get_project_targetsGet project targetsB
Returns the target frameworks and output type of a project.
Inputs: projectPath (required). Returns: object
get_solutionGet solutionC
Returns the solution and the projects it declares.
Inputs: view, limit, offset, solutionPath. Returns: object
list_project_filesList project filesC
Lists the source and configuration files of a project.
Inputs: projectPath (required), limit, offset. Returns: object
list_projectsList projectsB
Lists the projects declared by the solution, with metadata.
Inputs: limit, offset, solutionPath. Returns: object
list_solutionsList solutionsA
Lists every .sln/.slnx in the workspace (monorepos).
Inputs: limit, offset, directory. Returns: object
open_solutionOpen in Visual StudioB
Launches Visual Studio with a workspace solution (starts a GUI process).
Inputs: solutionPath. Returns: object
read_fileRead fileA
Reads a workspace file, optionally a window of lines, with the total count.
Inputs: path (required), maxLines, startLine. Returns: object
resolve_asset_pathsResolve asset pathsC
Lists the static assets (images, styles, fonts, media) of the workspace.
Inputs: limit, offset, directory. Returns: object
search_symbolsSearch symbolsB
Finds C# type, method and property declarations with file and line.
Inputs: kind, limit, query, offset, +1 more. Returns: object
search_textSearch textA
Searches literal text across the source files of the workspace.
Inputs: query (required), limit, offset, directory, +1 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Several tools have overlapping boundaries: get_project already returns target framework, output type, and references, which overlaps heavily with get_project_targets and get_project_references. Similarly, get_solution returns the projects declared by the solution while list_projects also lists those projects, making selection less obvious.
All tool names use a consistent snake_case verb_noun pattern, such as get_project, list_projects, search_symbols, and read_file. The convention is predictable throughout the set.
The set has 14 tools, which is reasonable for solution/project inspection and search. However, a few specialized getters duplicate information already available from broader tools, making the count slightly heavier than necessary.
The surface covers solution/project discovery, metadata, references, dependencies, targets, files, searches, assets, and analysis, which is strong for a read-only inspection server. Minor gaps exist around build/compile operations or solution lifecycle management beyond opening a solution.
Maintenance
Related MCP Connectors
Start and manage Reason cloud coding agents, projects and sessions from any MCP client.
Search and inspect source-pinned agent skills, plugins and tools through a free public MCP.
Remote MCP utilities for agents: structured data, commerce checks, and x402 paid API discovery.
Agent-driven search: build, import, tune, search, and score result quality — all over MCP.
Related MCP Servers
- AlicenseAqualityBmaintenanceA Model Context Protocol (MCP) server providing 62 AI-optimized tools for .NET/C# semantic code analysis, navigation, refactoring, and code generation using Microsoft Roslyn. Built for AI coding agents - provides compiler-accurate code understanding that AI cannot infer from reading source files alone.6241MIT
- AlicenseNot gradedqualityBmaintenanceILSpy for LLM coding agents. Reflection-based MCP server with 31+ tools to explore .NET assemblies, NuGet packages, types, members, attributes, and XML docs.10MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI clients to perform local code search, indexing, and analysis across Java, JavaScript/TypeScript, .NET/C#, and Python projects through the MCP protocol.1Apache 2.0
- AlicenseAqualityCmaintenanceMCP server for .NET assembly analysis. Vendor-neutral wrapper around AsmResolver and ILSpy for parsing and decompiling .NET assemblies.111MIT