# How Reasonix Capability Diagnostics Work: MCP Monitoring in DeepSeek-Reasonix

> Understand how Reasonix capability diagnostics monitor MCPs in DeepSeek-Reasonix. Explore its three-layer architecture for effective capability inspection.

- Repository: [YHH/DeepSeek-Reasonix](https://github.com/esengine/DeepSeek-Reasonix)
- Tags: deep-dive
- Published: 2026-08-05

---

**Reasonix capability diagnostics provide a read-only, side-effect-free observation system that inspects MCP (Model-Controlled Plugin) capabilities through a three-layer architecture spanning discovery inspection, runtime binding, and event propagation.**

The DeepSeek-Reasonix repository implements a sophisticated capability diagnostics subsystem that enables developers to monitor Model-Controlled Plugin (MCP) states without disrupting live sessions. This system operates through a carefully designed pipeline that captures shadowed and disabled candidates, tracks runtime metadata bindings, and propagates diagnostic information through internal event wires. Understanding how Reasonix capability diagnostics work is essential for debugging skill resolution and ensuring model reasoning aligns with the host's actual toolset.

## The Three-Layer Architecture of Reasonix Capability Diagnostics

The diagnostics system operates through three distinct layers that work together to provide comprehensive visibility into the capability landscape while maintaining strict isolation from production traffic.

### Layer 1: Discovery and Inspection via Store.Inspect()

The foundation of Reasonix capability diagnostics rests on a read-only inspection mechanism implemented in [`internal/skill/inspect.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/internal/skill/inspect.go). When the skill store initializes, the `Store.Inspect()` method walks the same discovery roots as `Store.List()`, but with one critical difference: it retains **shadowed** and **disabled** candidates that the normal listing would filter out.

Each discovered `Candidate` receives a `CandidateStatus` tag indicating its disposition: `winner`, `shadowed`, or `disabled`. During this inspection phase, the system temporarily silences the `stderr` writer—typically by setting it to `io.Discard`—ensuring that parsing warnings do not pollute the diagnostic output. This creates a pure snapshot of the capability landscape as it exists on disk, regardless of which skills are currently active.

### Layer 2: Capability Binding and Runtime Metadata

Once skills are loaded, the system resolves declared requirements into concrete runtime bindings. Every skill may declare required capabilities through the `Requires []string` field defined in [`internal/skill/skill.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/internal/skill/skill.go). When the engine prepares a skill for the model, it expands these capability IDs into **MCP bindings** (`tool.MCPBinding`) defined in [`internal/tool/tool.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/internal/tool/tool.go).

Each `MCPBinding` contains four critical pieces of diagnostic metadata:
- **Server name**: The originating MCP server
- **Raw tool name**: The original tool identifier
- **Stable callable name**: The normalized invocation name
- **CapabilityID**: A unique identifier (e.g., `mcp-tool:db/write`)

These bindings attach to the skill's tool registry and persist alongside the skill definition, creating a traceable link between the model's view and the underlying host capabilities.

### Layer 3: Diagnostic Propagation and Presentation

Diagnostic metadata flows through the system on the internal event wire (`eventwire.Wire`). Structures in [`internal/event/event.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/internal/event/event.go) and [`internal/eventwire/wire.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/internal/eventwire/wire.go) embed `ResolvedName` and `CapabilityID` fields within `event.Event` and `eventwire.WireTool` types, ensuring every tool invocation carries its diagnostic context.

The **doctor** command (`reasonix doctor`) surfaces this information for human inspection. According to the documentation in [`REASONIX.md`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/REASONIX.md), this command reads the store's inspection snapshot, formats the capability bindings, and prints a redacted, human-readable report. For automated health checks, the command supports a `--json` flag that emits the same diagnostic data in a machine-readable format without executing any actual tool calls.

## Implementing Capability Diagnostics in Practice

The following examples demonstrate how to interact with the Reasonix capability diagnostics system programmatically and via CLI.

### Obtaining a Diagnostic Snapshot

To inspect the complete capability landscape including shadowed candidates:

```go
package main

import (
	"fmt"
	"io"
	"skill"
)

func main() {
	store := skill.New(skill.Options{
		ProjectRoot: "./my-project",
		Stderr:      io.Discard, // Silence warnings for clean diagnostics
	})
	
	diag := store.Inspect() // Read-only snapshot from internal/skill/inspect.go
	
	for _, c := range diag.Candidates {
		fmt.Printf("%s – %s (%s)\n", c.Name, c.Status, c.Path)
	}
}

```

### Running the Diagnostics Command

The built-in doctor command provides immediate visibility into capability health:

```bash

# Human-readable report showing capability status

$ reasonix doctor

# Machine-readable JSON for automated monitoring

$ reasonix doctor --json

```

### Accessing Runtime Diagnostic Metadata

When processing events, each tool carries its diagnostic identifiers:

```go
package main

import (
	"encoding/json"
	"event"
)

func main() {
	ev := event.Event{
		Kind: event.Tool,
		Tool: &event.Tool{
			ResolvedName: "mcp__db__write",
			CapabilityID: "mcp-tool:db/write",
		},
	}
	
	payload, _ := json.Marshal(ev)
	// payload contains the diagnostic metadata for logging/auditing
	fmt.Println(string(payload))
}

```

## Key Source Files for Reasonix Capability Diagnostics

| File | Role |
|------|------|
| [`internal/skill/inspect.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/internal/skill/inspect.go) | Implements `Store.Inspect()` and `CandidateStatus` logic for read-only capability snapshots. |
| [`internal/skill/skill.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/internal/skill/skill.go) | Defines the `Skill` type, stores `Requires []string`, and formats capability bindings. |
| [`internal/tool/tool.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/internal/tool/tool.go) | Holds the `MCPBinding` struct containing `CapabilityID` and server metadata. |
| [`internal/event/event.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/internal/event/event.go) | Embeds `ResolvedName` and `CapabilityID` in runtime event structures. |
| [`internal/eventwire/wire.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/internal/eventwire/wire.go) | Serializes diagnostic metadata onto the internal event wire. |
| [`REASONIX.md`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/REASONIX.md) | Documents the `reasonix doctor` CLI, output formats, and diagnostic workflows. |

## Summary

Reasonix capability diagnostics operate through a carefully architected pipeline that maintains strict separation between observation and execution:

- **Read-only inspection** via `Store.Inspect()` captures shadowed and disabled candidates without affecting live sessions.
- **Runtime binding** converts capability requirements into traceable `MCPBinding` objects containing unique `CapabilityID` values.
- **Event propagation** carries diagnostic metadata through `eventwire.Wire`, enabling comprehensive auditing of tool resolution.
- **CLI accessibility** through the `reasonix doctor` command provides both human-readable and JSON outputs for manual debugging and automated health checks.

## Frequently Asked Questions

### What distinguishes Store.Inspect() from Store.List()?

`Store.List()` returns only active, winning candidates suitable for model consumption, while `Store.Inspect()`—as implemented in [`internal/skill/inspect.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/internal/skill/inspect.go)—returns a complete diagnostic snapshot including **shadowed** and **disabled** candidates. The inspection method also suppresses `stderr` output to prevent parsing warnings from corrupting diagnostic data, whereas normal listing operations may emit warnings to standard error.

### How does the system prevent diagnostics from affecting live MCP sessions?

The diagnostics system maintains **side-effect-free** operation through three mechanisms: inspection uses a temporary `io.Discard` writer to silence output, `Store.Inspect()` performs no mutations on the skill registry, and the `reasonix doctor` command reads static snapshots rather than executing tool bindings. This ensures that monitoring the capability landscape never changes which tools are available to the model.

### What specific data does the MCPBinding structure contain?

According to [`internal/tool/tool.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/internal/tool/tool.go), each `MCPBinding` contains the MCP **server name**, the **raw tool name** as declared by the server, a **stable callable name** normalized for invocation, and the unique **CapabilityID** that serves as the canonical reference (e.g., `mcp-tool:db/write`). This structure bridges the gap between capability requirements declared in skills and the actual runtime tooling available on the host.

### Can capability diagnostics be exported for external monitoring systems?

Yes. The `reasonix doctor --json` flag emits a machine-readable JSON payload containing the complete inspection snapshot, including all candidate statuses and their associated `CapabilityID` values. This output format integrates with automated health checks and monitoring dashboards, allowing external systems to track capability availability and detect shadowed or disabled tools that might affect model reasoning.