Guide

Claude MCP

Use TREF directly from Claude Code with the MCP server.

Installation

Add to Claude Code

claude mcp add tref -- tref-mcp

This registers the TREF MCP server with Claude Code.

Available Tools

tref_publish

Create a new TREF block from content.

// Claude Code will use this automatically // Example: "Create a TREF block for this code snippet"

tref_derive

Create a child block from an existing parent.

// Preserves lineage and references

tref_validate

Check block integrity - verify ID matches content hash.

// Returns true if block is authentic, false if tampered

tref_list

List all published TREF blocks.

// Shows block IDs and summaries

tref_info

Get metadata for a specific block.

// Returns author, timestamp, refs, parent, etc.

tref_cat

Output the content of a block.

// Outputs raw content or JSON format

Usage Examples

Asking Claude to create a block

"Create a TREF block for the following code snippet with a reference to the original Stack Overflow answer."

Validating received blocks

"Validate this TREF block and tell me if it's authentic."

Building knowledge chains

"Derive a new block from sha256:abc123... with my corrections to the algorithm."