npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

bringcontext

v0.5.1

Published

Knowledge retrieval tool operating according to the Model Context Protocol (MCP)

Readme

BringContext MCP Server

License: MIT

A powerful knowledge retrieval tool operating according to the Model Context Protocol (MCP). BringContext enhances Large Language Models by providing access to external knowledge sources on demand.

🚀 Overview

BringContext simulates a simplified version of Retrieval Augmented Generation (RAG), enabling LLMs to dynamically fetch information from external knowledge bases, resulting in more accurate, context-aware responses. It is designed for a zero-installation experience using npx.

Core Features

  • 📚 Provides LLMs with access to external knowledge sources through the Model Context Protocol
  • 🔍 Dynamically registers .txt files in a global knowledge base directory in your home folder (~/.bringcontext/) as MCP resources.
  • 🏠 Uses a persistent global knowledge base that survives package updates and reinstalls
  • 🛠️ Simple integration with MCP clients like Cursor, Cline, and Claude Desktop
  • 💡 .txt files in your knowledge base become available as resources.
  • ✨ Zero-setup: npx bringcontext automatically creates the knowledge base directory if it doesn't exist and outputs the recommended client configuration.

📋 Requirements

  • Node.js (version 16.x or higher)
  • npm (comes with Node.js)
  • An MCP-compatible client (Cursor, Cline, Claude Desktop, or any client supporting STDIO transport)

🛠️ Quick Start

BringContext is designed to be run exclusively using npx bringcontext. The first time you run this command, it will automatically create the global knowledge base directory at ~/.bringcontext/ if it doesn't already exist. It will also output the recommended client configuration to your terminal.

# Run BringContext MCP Server via npx
npx bringcontext

🔧 Knowledge Base

BringContext uses a simple one-file-one-tool approach. Each .txt file in your global knowledge base directory (~/.bringcontext/) becomes an available tool for LLMs to use.

Knowledge Base Location

BringContext stores its knowledge base in a global directory in your home folder:

  • Windows: C:\Users\<username>\.bringcontext
  • macOS/Linux: /home/<username>/.bringcontext

This global location ensures your knowledge base:

  • Persists across package updates and reinstalls
  • Is consistent across all your projects
  • Is easily accessible from any directory

The npx bringcontext command automatically creates this directory if it doesn't exist.

Adding Your Own Tools

Adding a new tool is as simple as creating a .txt file in your knowledge base directory (~/.bringcontext/):

  1. Run npx bringcontext once to ensure the ~/.bringcontext directory is created.

  2. Create a new text file with a descriptive name (e.g., company-history.txt) in the ~/.bringcontext/ directory.

    echo "My company was founded in 2020" > ~/.bringcontext/company-history.txt

    (Note: On Windows, you might need to use a different command like echo "My company was founded in 2020" > %USERPROFILE%\.bringcontext\company-history.txt in Command Prompt or echo "My company was founded in 2020" | Out-File -Path ~/.bringcontext/company-history.txt in PowerShell)

  3. That's it! The next time your MCP client launches BringContext via npx bringcontext, a company-history tool will be automatically available to LLMs.

The tool name will be exactly the same as the filename (without the .txt extension).

🚀 Usage

Running the Server

Run the server using the npx bringcontext command. This command handles the initial setup of the knowledge base directory, outputs the client configuration, and starts the MCP server.

# Run BringContext MCP Server via npx
npx bringcontext

MCP Client Configuration

Configure your MCP client to launch the BringContext server using the npx bringcontext command. For Windows clients, a workaround using cmd /c is necessary due to known issues with npx execution in some environments. Running npx bringcontext will output the recommended configuration snippet to your terminal for easy copying.

Example MCP Configuration

Here's an example configuration for your MCP client (includes Windows workaround):

{
  "mcpServers": {
    "bringcontext": {
      "command": "cmd",
      "args": [
        "/c",
        "npx",
        "-y",
        "bringcontext"
      ]
    }
  }
}

Add this configuration to your client's settings (e.g., .cursor/settings.json for Cursor, or the MCP settings in Cline/Claude Desktop).

🗂️ Directory Structure

When you use BringContext, the relevant directory structure is your global knowledge base directory:

~/.bringcontext/     # Global knowledge base directory (automatically created by npx)
    ├── helloworld.txt  # Example knowledge base file (you can add your own .txt files here)
    └── another-tool.txt # Another example user-defined tool

Each .txt file in this directory becomes an available tool for LLMs to use.

🔍 How It Works

BringContext operates on a simple but powerful principle:

  1. When launched via npx bringcontext, the command:
    • Checks if the ~/.bringcontext directory exists and creates it if necessary.
    • Outputs the recommended client configuration to standard output.
    • Starts the BringContext MCP server.
  2. The BringContext MCP server:
    • Scans the ~/.bringcontext directory for .txt files.
    • Registers each .txt file as an MCP resource, using the file URI (file://<path>) as the resource identifier. Logging is added to indicate which resources are being registered.
    • Exposes these resources to LLMs through the MCP.
  3. When an LLM requests information using a resource URI (e.g., file:///path/to/company-history.txt):
    • BringContext locates the corresponding file (e.g., company-history.txt) based on the resource URI. Logging is added to indicate when a resource is requested and which file it is attempting to read.
    • Reads the content of the file.
    • Returns the content to the LLM in the MCP resource response format.

This approach allows you to easily extend the knowledge available to LLMs by simply adding more .txt files to your knowledge base directory (~/.bringcontext/).

🛠️ Troubleshooting

Common Issues and Solutions

Knowledge Base Issues

If tools aren't appearing or the server fails to start:

  • Ensure you have run npx bringcontext at least once to create the ~/.bringcontext directory.
  • If the server fails to start, verify that the ~/.bringcontext directory exists and that the process running the server has the necessary permissions to access and read files from it.
  • Check that your .txt files are in the correct location (~/.bringcontext/).
  • Ensure the files have the .txt extension.
  • Verify you have read permissions on the knowledge base directory and the files within it.

MCP Client Configuration

If your MCP client can't connect to BringContext:

  • Ensure you've added the configuration to your client's settings, using the cmd /c npx -y bringcontext command for Windows.
  • Verify that Node.js and npm are in your system's PATH.

🔮 Future Roadmap

BringContext will continue to evolve with planned enhancements, including support for different file types, advanced knowledge retrieval techniques, and knowledge base management tools.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.