ref-tools-mcp  by ref-tools

Stop AI hallucinations with token-efficient documentation search

Created 4 months ago
488 stars

Top 63.0% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

Ref MCP is a ModelContextProtocol server designed to provide AI coding tools and agents with efficient access to public and private documentation, aiming to reduce hallucinations and minimize token usage. It targets AI developers and agents that require up-to-date information on APIs, services, and libraries, offering a token-efficient search and retrieval mechanism.

How It Works

Ref MCP implements a session-based approach to track search trajectories and optimize context. It features intelligent filtering to avoid returning duplicate results across similar searches and a mechanism to extract only the most relevant 5k tokens from documentation pages, discarding irrelevant sections. This targeted retrieval is designed to combat the "context rot" and cognitive degradation observed in LLMs when presented with excessive or irrelevant information, thereby improving agent performance and reducing API costs.

Quick Start & Requirements

  • Installation: npx ref-tools-mcp@latest (for stdio server) or configure via HTTP.
  • Prerequisites: An API key is required, obtained by signing up at ref.tools.
  • Development: npm install, npm run dev.
  • Resources: The README provides links to Inspector documentation for local testing.

Highlighted Details

  • Provides ref_search_documentation and ref_read_url tools for agents.
  • Supports OpenAI tool definitions with slightly different naming conventions.
  • Offers filtering of search results to prevent duplicates within a session.
  • Extracts the most relevant 5k tokens from web pages to minimize context noise.

Maintenance & Community

The project is developed by ref-tools. Further community or roadmap information is not detailed in the README.

Licensing & Compatibility

The project is licensed under the MIT license, permitting commercial use and integration with closed-source applications.

Limitations & Caveats

The README mentions a "legacy stdio server" and recommends the "streamable-http server," suggesting potential differences in features or support between the two. The effectiveness of token minimization relies on the accuracy of the relevance filtering.

Health Check
Last Commit

2 weeks ago

Responsiveness

Inactive

Pull Requests (30d)
18
Issues (30d)
1
Star History
263 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems") and Simon Willison Simon Willison(Author of Django).

semantra by freedmand

0.2%
3k
CLI tool for semantic document search
Created 2 years ago
Updated 1 year ago
Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Gregor Zunic Gregor Zunic(Cofounder of Browser Use), and
2 more.

airweave by airweave-ai

0.2%
3k
Semantic MCP server for AI agents
Created 8 months ago
Updated 22 hours ago
Feedback? Help us improve.