# Class BSV::MCP::Secret <a id="class-BSV-MCP-Secret"></a>

|  |  |
| --- | --- |
| **Inherits** | Object |
| **Defined in** | gem/bsv-sdk/lib/bsv/mcp/secret.rb |

Wraps a credential so that it cannot leak through `inspect`, `to_s` or JSON
serialisation of the objects that hold it (the server context, the
<code>::MCP::Server</code> instance, error output).

The value is unwrapped explicitly with {#reveal} only where the protocol that
needs it is built.

## Constants
### `REDACTED` <a id="constant-REDACTED"></a> <a id="REDACTED-constant"></a>
Not documented.

## Public Class Methods
### `reveal(value)` <a id="method-c-reveal"></a> <a id="reveal-class_method"></a>
Unwraps a {Secret}, passing any other value through unchanged.
- **@param** `value` [Secret, String, nil]
- **@return** [String, nil]

## Public Instance Methods
### `initialize(value)` <a id="method-i-initialize"></a> <a id="initialize-instance_method"></a>
- **@param** `value` [String]
- **@return** [Secret] a new instance of Secret

### `inspect()` <a id="method-i-inspect"></a> <a id="inspect-instance_method"></a>
Not documented.

### `reveal()` <a id="method-i-reveal"></a> <a id="reveal-instance_method"></a>
- **@return** [String] the wrapped credential

### `to_json()` <a id="method-i-to_json"></a> <a id="to_json-instance_method"></a>
Not documented.

### `to_s()` <a id="method-i-to_s"></a> <a id="to_s-instance_method"></a>
Not documented.
