🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@feniix/pi-ref-tools

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@feniix/pi-ref-tools

Ref.tools MCP extension for pi — documentation search and URL reading via Ref's Model Context Protocol

latest
Source
npmnpm
Version
3.0.1
Version published
Weekly downloads
23
-11.54%
Maintainers
1
Weekly downloads
 
Created
Source

@feniix/pi-ref-tools

Ref.tools MCP extension for pi — token-efficient documentation search and URL reading via Ref's Model Context Protocol.

Features

  • Documentation Search (ref_search_documentation): Search indexed technical documentation for APIs, libraries, and frameworks
  • URL Reading (ref_read_url): Fetch and read documentation URLs as optimized markdown
  • Configurable Output Limits: Client-side byte and line truncation with adjustable maximums
  • Flexible Configuration: JSON config files, environment variables, and CLI flags
  • MCP Protocol Support: JSON-RPC 2.0 with server-sent events for response streaming

Install

pi install npm:@feniix/pi-ref-tools

Ephemeral (one-off) use:

pi -e npm:@feniix/pi-ref-tools

Configuration

You need a Ref API key from ref.tools/keys.

Option 1: Environment Variable

export REF_API_KEY="your_key"

Option 2: Settings File

Use pi's standard settings locations for non-secret configuration:

  • project: .pi/settings.json
  • global: ~/.pi/agent/settings.json

Under the pi-ref-tools key:

{
  "pi-ref-tools": {
    "url": "https://api.ref.tools/mcp",
    "timeoutMs": 30000,
    "protocolVersion": "2025-06-18",
    "maxBytes": 51200,
    "maxLines": 2000
  }
}

Best practice: use settings.json for non-secret defaults only. Keep REF_API_KEY in an environment variable, or use --ref-mcp-config-file / REF_MCP_CONFIG_FILE to point to a custom private JSON config file when you need to persist secrets outside your project. Legacy aliases --ref-mcp-config and REF_MCP_CONFIG are still accepted but deprecated.

Option 3: CLI Flags

pi --ref-mcp-api-key=your_key

Config Resolution Order

  • --ref-mcp-config-file flag path
  • REF_MCP_CONFIG_FILE environment variable
  • legacy --ref-mcp-config flag path (deprecated)
  • legacy REF_MCP_CONFIG environment variable (deprecated)
  • .pi/settings.json under pi-ref-tools (project-level)
  • ~/.pi/agent/settings.json under pi-ref-tools (global)

Tools

ref_search_documentation

Search indexed technical documentation. Best for API docs, library references, and framework guides.

ParameterTypeRequiredDescription
querystringyesSearch query. Include language/framework names for best results.
piMaxBytesintegernoClient-side max bytes override (clamped by config).
piMaxLinesintegernoClient-side max lines override (clamped by config).

ref_read_url

Read a documentation URL and return optimized markdown. Pass the exact URL from a search result or any documentation page.

ParameterTypeRequiredDescription
urlstringyesThe exact URL of the documentation page to read.
piMaxBytesintegernoClient-side max bytes override (clamped by config).
piMaxLinesintegernoClient-side max lines override (clamped by config).

CLI Flags

FlagEnv VariableDefaultDescription
--ref-mcp-urlREF_MCP_URLhttps://api.ref.tools/mcpMCP endpoint URL
--ref-mcp-api-keyREF_API_KEYAPI key (sent as x-ref-api-key header)
--ref-mcp-timeout-msREF_MCP_TIMEOUT_MS30000HTTP timeout in ms
--ref-mcp-protocolREF_MCP_PROTOCOL_VERSION2025-06-18MCP protocol version
--ref-mcp-config-fileREF_MCP_CONFIG_FILECustom config file path
--ref-mcp-configREF_MCP_CONFIGDeprecated alias for the config file path
--ref-mcp-max-bytesREF_MCP_MAX_BYTES51200Max output bytes
--ref-mcp-max-linesREF_MCP_MAX_LINES2000Max output lines

Output Truncation

Default limits: 51,200 bytes, 2,000 lines. Per-call overrides via piMaxBytes/piMaxLines parameters are clamped to the configured maximums. Truncated content is saved to temporary files with paths included in responses.

Requirements

Uninstall

pi remove npm:@feniix/pi-ref-tools

License

MIT

Keywords

pi

FAQs

Package last updated on 15 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts