Ref
Documentation search MCP server. This skill covers meta work (setup, config, decisions)—not mainline doc searching.
To search docs: Just call
ref_search_documentationandref_read_urldirectly. Don't invoke this skill.
How Ref Works
Search Philosophy
Ref uses agentic search: search() returns result overviews, then you selectively read() relevant pages. This matches how humans search—iterate and refine rather than batch retrieve.
What Gets Indexed
| Source | What's Indexed |
|---|---|
| Public GitHub repos | Small repos (<2k files): everything. Large repos: docs only |
| Your private repos | Same rules, synced every 5 minutes |
| Uploaded files | PDF and Markdown, chunked automatically |
NOT indexed: Man pages, system docs, CLI --help output.
Freshness & Sync
- GitHub repos: Synced on 5-minute cron, incremental (compares commits)
- Uploaded files: Indexed immediately on upload
- Public index: Maintained by Ref team; request additions via form
Library Versions
Ref indexes the default branch (usually main). For specific versions:
- Check if the repo tags releases with docs
- Upload version-specific docs manually if needed
- Use
ref_read_urlon a specific commit/tag URL if available
Operations
Doctor
Health check and repair for Ref setup. Handles fresh installs AND fixes drift (missing auth, outdated config, missing best practices).
Run all checks in order. Fix issues as found.
Check 1: MCP Installation
claude mcp list
| State | Action |
|---|---|
Ref: https://api.ref.tools/mcp (HTTP) present | → Check 2 |
| Missing entirely | → Run Install Flow below |
| Shows as disabled | → claude mcp enable Ref, then Check 2 |
Install Flow:
-
Ask user with AskUserQuestion:
- "I have a Ref account" → step 2
- "I need to create one" → direct to https://ref.tools/signup, wait, then step 2
-
Tell user: "Go to https://ref.tools/install - paste the pre-populated command shown there."
-
Run the command user provides. Format:
claude mcp add --transport http Ref https://api.ref.tools/mcp --header "x-ref-api-key: ref_..." -
Restart required. Tell user:
"Restart Claude Code (Cmd+R or relaunch), then say 'continue' to resume doctor."
-
After restart, re-run Check 1.
Check 2: Auth Validity
Test the API key works:
ref_search_documentation: "what is ref mcp server"
| Result | Action |
|---|---|
| Results returned | → Check 3 |
| "not correctly configured" | → API key invalid. Tell user to get fresh key at https://ref.tools/keys, re-run Install Flow step 2 |
| Tool not found | → MCP not loaded. Restart Claude Code, re-run Check 1 |
Check 3: Best Practices
Reference: https://docs.ref.tools/getting-started/best-practices
3a. Rules file exists
Check for project rules file that mentions Ref:
# Check common locations
cat CLAUDE.md 2>/dev/null | grep -i ref || echo "NOT_FOUND"
cat AGENTS.md 2>/dev/null | grep -i ref || echo "NOT_FOUND"
cat .claude/rules/*.md 2>/dev/null | grep -i ref || echo "NOT_FOUND"
| State | Action |
|---|---|
| Ref mentioned in rules | → Check 3b |
| No Ref rule found | → Ask user with AskUserQuestion |
If no rule found, ask:
- "Add Ref rule to CLAUDE.md" (Recommended)
- "Add Ref rule to AGENTS.md" (cross-tool compatible)
- "Skip for now"
If adding, append this line to chosen file:
When working with libraries, check the docs with Ref.
3b. Rule quality
The rule should be simple. Per best practices, avoid:
- Over-prompting (checking docs for every interaction)
- Excessive complexity
Good: When working with libraries, check the docs with Ref.
Bad: Always check Ref before any code change and verify all imports...
If rule is overly complex, suggest simplifying.
Check 4: Verification
Final test - search Ref's own docs:
ref_search_documentation: "Claude Code MCP server installation"
Then read a result:
ref_read_url: <first relevant URL from results>
| Result | Status |
|---|---|
| Both tools work | ✅ Doctor complete |
| Any failure | Review earlier checks |
Report summary to user:
- MCP status
- Auth status
- Best practices status
- Test result
Dashboard Operations
No API yet—these are manual steps via web UI.
Adding a GitHub Repo
- Go to ref.tools/resources?tab=github
- Click Add GitHub Repos
- Authenticate with GitHub if prompted (uses personal access token)
- Select repos to index
- Wait for initial sync (large repos may take a few minutes)
What gets indexed:
- Repos <2k files: everything (code + docs)
- Repos >2k files: docs only
Sync: Every 5 minutes, incremental. If you rewrite git history, remove and re-add the repo.
Uploading PDF/Markdown
- Go to ref.tools/resources?tab=pdf
- Click Add Files
- Upload
.pdfor.mdfiles (max 100MB each) - Files are chunked and indexed automatically
Use case: Man pages, internal docs, version-specific library docs not in public index.
Viewing Usage
- Go to ref.tools/activity
- See daily credit spend by endpoint (search, read, chat, web)
- Filter by date range
- Export to CSV for audits
Managing API Keys
- Go to ref.tools/keys
- Create new keys, revoke old ones
- Each key shows last used timestamp
Team Management
- Go to ref.tools/team
- Select team in workspace picker (top-left)
- Invite members, assign roles
Roles:
| Role | Can Search | Can Add Content | Can Invite | Can Manage Billing |
|---|---|---|---|---|
| Admin | ✅ | ✅ | ✅ | ✅ |
| Writer | ✅ | ✅ | ❌ | ❌ |
| Reader | ✅ | ❌ | ❌ | ❌ |
Tip: For public-docs-only teams, have one Admin and invite everyone else as Readers.
Requesting Docs Be Added to Public Index
When Ref doesn't have docs for a library/tool you need:
Form details:
- Form ID:
nrvBY2 - URL: https://tally.so/r/nrvBY2
Fields:
| Field | Content |
|---|---|
| What docs would you like indexed? | 1-5 sentences with context (see template below) |
| User's email |
Request template:
<Tool/library name> - <what it is, 1 sentence>
<Why it's useful to index / what's currently missing, 1-2 sentences>
URL: <documentation URL>
Note: <any special notes about docs structure, size, format>
Common doc URLs:
- tmux:
https://man.openbsd.org/tmux - git:
https://git-scm.com/docs
Submission: Use the Tally skill with:
formId: nrvBY2
fields:
- name: "What docs would you like indexed?"
value: <drafted request>
- name: "Email"
value: <user email>
After submitting: Ref team reviews and adds to public index. Check back in a few days.
Usage Reference
| Tool | Credits | Purpose |
|---|---|---|
ref_search_documentation | 1 | Search docs (full sentence query) |
ref_read_url | 1 | Read content from search result URL |
Search patterns:
- Include library name:
"Effect Schema decode unknown data validation" - Private docs: include
ref_src=privatein query
Decision Guide: Local Docs vs Ref Upload
When you have docs that aren't in Ref's public index (e.g., man pages):
| Factor | Local man-pages/ dir | Upload to Ref |
|---|---|---|
| Setup | Script + grep | One-time upload |
| Search | Grep (exact match) | Semantic search |
| Offline | ✅ Works | ❌ Needs internet |
| Human browsing | ✅ Files in repo | ❌ Web UI only |
| CC access | Grep local files | ref_src=private query |
| Maintenance | Re-run script on updates | Re-upload on updates |