Pinrag MCP Server

PinRAG is for **when you want to learn about something and your materials are scattered**—PDFs and ebooks, GitHub repos, YouTube videos, Discord

Local serverstdioPython

What is the Pinrag MCP server?

PinRAG is for when you want to learn about something and your materials are scattered—PDFs and ebooks, GitHub repos, YouTube videos, Discord discussions, and plain notes. You index those materials into one shared RAG index, then. The pinrag mcp server wraps that behind the Model Context Protocol, so an assistant can use it through 14 defined tools rather than through you.

What it actually does

  • Multi-format indexing — — PDF (.pdf), local files or directories, plain text (.txt), Discord export (.txt), YouTube (video or playlist URL, or video ID), GitHub repo (URL), web documentation sites (URL)
  • RAG with citations — — Answers cite source context: PDF page, YouTube timestamp, document name for plain text and Discord, chunk index for GitHub repos, source URL for web documentation
  • Document tags — — Tag documents at index time (e.g. AMIGA, PI_PICO) for filtered search
  • Metadata filtering — — query_tool supports document_id, tag, document_type, PDF page_min/page_max, and response_style (thorough or concise)
  • MCP tools — — add_document_tool, query_tool, list_documents_tool, remove_document_tool, set_document_tag_tool, list_collections_tool; optional collection on tools overrides PINRAG_COLLECTION_NAME for that call
  • MCP resources — — pinrag://documents (indexed documents) and pinrag://server-config (env vars and config); click in Cursor’s MCP panel to view

Adding it to your client

The server ships on PyPI as pinrag, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.

Its toolset

Everything the assistant can do here goes through one of these:

  • Multi — format indexing** — PDF (.pdf), local files or directories, plain text (.txt), Discord export (.txt), YouTube (video or playlist URL, or video ID)
  • Observability — MCP tool notifications (ctx.log) plus optional LangSmith tracing
  • FlashRank — ** Install pinrag[rerank] in the same tool env (pipx install 'pinrag[rerank]' / uv tool install 'pinrag[rerank]'); tunables are in
  • Action — Tool
  • Variable — Default
  • LLM — The LLM tool exposed by this server
  • PINRAG_LLM_PROVIDER — openrouter
  • PINRAG_LLM_MODEL(provider default)
  • OpenRouter — The OpenRouter tool exposed by this server
  • PINRAG_OPENROUTER_MODEL_FALLBACKS(unset)
  • PINRAG_OPENROUTER_SORT(unset)
  • PINRAG_OPENROUTER_PROVIDER_ORDER(unset)

Configuration

You will need 8 environment variables: OPENROUTER_API_KEY, PINRAG_PERSIST_DIR, GITHUB_TOKEN, PINRAG_WEB_RATE_LIMIT_PER_HOST, PINRAG_YT_PROXY_HTTP_URL, PINRAG_YT_PROXY_HTTPS_URL, OPENAI_API_KEY, ANTHROPIC_API_KEY. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

Caveats

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 14 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Pinrag.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the pinrag mcp server does with a few real requests.

When to reach for it

Among the AI and media services options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Pinrag's toolset — Multi, Observability, FlashRank and 11 more — is a fair guide to whether it matches your workflow. It is maintained by ndjordjevic; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against Pinrag's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Available tools

ToolWhat it does
Multiformat indexing** — PDF (.pdf), local files or directories, plain text (.txt), Discord export (.txt), YouTube (video or playlist URL, or video ID), GitHub repo (URL), web documentation sites (URL)
ObservabilityMCP tool notifications (ctx.log) plus optional [LangSmith](https://smith.langchain.com) tracing
FlashRank** Install **pinrag[rerank]** in the same tool env (pipx install 'pinrag[rerank]' / uv tool install 'pinrag[rerank]'); tunables are in **Configuration**.
ActionTool
VariableDefault
LLMThe LLM tool exposed by this server.
PINRAG_LLM_PROVIDERopenrouter
PINRAG_LLM_MODEL*(provider default)*
OpenRouterThe OpenRouter tool exposed by this server.
PINRAG_OPENROUTER_MODEL_FALLBACKS*(unset)*
PINRAG_OPENROUTER_SORT*(unset)*
PINRAG_OPENROUTER_PROVIDER_ORDER*(unset)*
OPENROUTER_APP_URLhttps://github.com/ndjordjevic/pinrag
OPENROUTER_APP_TITLEPinRAG

How to install the Pinrag MCP server

{
  "mcpServers": {
    "pinrag": {
      "command": "uvx",
      "args": ["--refresh", "pinrag"],
      "env": {
        "OPENROUTER_API_KEY": "your-openrouter-api-key-here",
        "PINRAG_PERSIST_DIR": "/absolute/path/to/your/pinrag-data"
      }
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
OPENROUTER_API_KEYCredential the server authenticates with.Yes
PINRAG_PERSIST_DIRFilesystem location the server is allowed to use.Optional
GITHUB_TOKENCredential the server authenticates with.Yes
PINRAG_WEB_RATE_LIMIT_PER_HOSTEndpoint or connection string the server talks to.Optional
PINRAG_YT_PROXY_HTTP_URLEndpoint or connection string the server talks to.Yes
PINRAG_YT_PROXY_HTTPS_URLEndpoint or connection string the server talks to.Yes
OPENAI_API_KEYCredential the server authenticates with.Yes
ANTHROPIC_API_KEYCredential the server authenticates with.Yes

Example prompts to try

  • Use Pinrag to Multi.
  • Use Pinrag to Observability.
  • Use Pinrag to FlashRank.

Frequently asked questions

It connects Pinrag to MCP-compatible AI assistants such as Claude and Cursor, exposing 14 tools (Multi, Observability, FlashRank, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Pinrag directly.