Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
GITHUB_TOKENNoPersonal access token for GitHub API. Required for private repos; increases rate limits for public repos.
COHERE_API_KEYNoCohere API key (required for Cohere embeddings or re-ranking).
OPENAI_API_KEYNoOpenAI API key (required for default LLM or default embeddings).
PINRAG_LLM_MODELNoLLM model name (e.g., 'claude-3-5-sonnet-20241022', 'gpt-4o-mini').
PINRAG_LOG_LEVELNoLog level: DEBUG, INFO, WARNING, or ERROR.INFO
ANTHROPIC_API_KEYNoAnthropic API key (required when PINRAG_LLM_PROVIDER=anthropic or PINRAG_EVALUATOR_PROVIDER=anthropic).
PINRAG_CHUNK_SIZENoText chunk size in characters.1000
PINRAG_RETRIEVE_KNoNumber of chunks to retrieve when re-ranking is off.20
PINRAG_USE_RERANKNoSet to 'true' to enable Cohere Re-Rank.false
PINRAG_PERSIST_DIRNoChroma vector store directory. Use an absolute path for a stable index location.chroma_db
PINRAG_LLM_PROVIDERNoLLM provider: 'openai' or 'anthropic'.openai
PINRAG_RERANK_TOP_NNoChunks passed to the LLM after re-ranking.10
ANONYMIZED_TELEMETRYNoEnable or disable Chroma's anonymous usage telemetry.False
PINRAG_CHUNK_OVERLAPNoChunk overlap in characters.200
PINRAG_LOG_TO_STDERRNoSet to 'true' to send logs to stderr (visible in MCP output).false
PINRAG_RESPONSE_STYLENoRAG answer style: 'thorough' or 'concise'.thorough
PINRAG_COLLECTION_NAMENoChroma collection name.pinrag
PINRAG_EMBEDDING_MODELNoEmbedding model name (e.g., 'text-embedding-3-small', 'embed-english-v3.0').
PINRAG_EVALUATOR_MODELNoModel for correctness grading during evaluation.
PINRAG_USE_MULTI_QUERYNoSet to 'true' to generate alternative phrasings of the user query via LLM.false
PINRAG_CHILD_CHUNK_SIZENoChild chunk size when PINRAG_USE_PARENT_CHILD is true.800
PINRAG_USE_PARENT_CHILDNoSet to 'true' to embed small chunks and return larger parent chunks.false
PINRAG_MULTI_QUERY_COUNTNoNumber of alternative queries to generate (max 10).4
PINRAG_PARENT_CHUNK_SIZENoParent chunk size when PINRAG_USE_PARENT_CHILD is true.2000
PINRAG_RERANK_RETRIEVE_KNoChunks to fetch before reranking.20
PINRAG_YT_PROXY_HTTP_URLNoHTTP proxy URL for YouTube transcript fetches.
PINRAG_EMBEDDING_PROVIDERNoEmbedding provider: 'openai' or 'cohere'.openai
PINRAG_EVALUATOR_PROVIDERNoLLM provider for evaluation runs (LLM-as-judge).openai
PINRAG_YT_PROXY_HTTPS_URLNoHTTPS proxy URL for YouTube transcript fetches.
PINRAG_GITHUB_DEFAULT_BRANCHNoDefault branch for GitHub indexing when not specified.main
PINRAG_GITHUB_MAX_FILE_BYTESNoSkip files larger than this when indexing GitHub repos.524288
PINRAG_EVALUATOR_MODEL_CONTEXTNoModel for groundedness grading during evaluation.
PINRAG_PLAINTEXT_MAX_FILE_BYTESNoSkip plain .txt files larger than this when indexing.524288
PINRAG_STRUCTURE_AWARE_CHUNKINGNoApply structure-aware chunking heuristics for code/table boundaries.true

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
query_tool

Query indexed documents and return an answer with citations.

Searches through all indexed documents (PDF, Discord, etc.) and uses RAG
to provide an answer based on retrieved context, with source citations.

Args:
    query: Natural language question to ask.
    document_id: Optional document ID to filter retrieval (from list_documents).
    page_min: Optional start of page range (inclusive). PDF only.
    page_max: Optional end of page range (inclusive). PDF only.
    tag: Optional tag to filter retrieval (from list_documents).
    document_type: Optional type to filter: "pdf", "youtube", "discord", "github", or "plaintext".
    file_path: Optional file path within a document (GitHub: e.g. src/ria/api/atr.c). Use list_documents to see files.
    response_style: Answer style: "thorough" (detailed) or "concise" (default: "thorough").
    ctx: MCP request context (injected by the server; unused).

Returns:
    Dictionary containing answer and sources (document_id, page).
add_document_tool

Add files, directories, YouTube videos, or GitHub repos to the index.

Automatically detects format per path and indexes:
- GitHub (URL, e.g. https://github.com/owner/repo or github.com/owner/repo/tree/branch)
- YouTube (URL or video ID, e.g. https://youtu.be/xyz)
- PDF (.pdf)
- Discord export (.txt with DiscordChatExporter Guild:/Channel: header)

Pass one or more paths. Single path: paths=[\"/path/to/file.pdf\"]. Uses
server config for vector store location and collection. Returns both
successful and failed entries so one bad path does not fail the batch.

Args:
    paths: List of file paths, directory paths, YouTube URLs, or GitHub URLs to index.
    tags: Optional list of tags, one per path (same order as paths).
    branch: For GitHub URLs: override branch (default: main). Ignored for other formats.
    include_patterns: For GitHub URLs: glob patterns for files to include (e.g. ["*.md", "src/**/*.py"]).
    exclude_patterns: For GitHub URLs: glob patterns to exclude. Ignored for other formats.
    ctx: MCP request context (injected by the server; unused).

Returns:
    Dictionary containing indexed entries, failed entries, and totals.
add_url_tool

Add YouTube videos/playlists or GitHub repos to the index via URL.

For local files or directories, use add_document_tool instead.
list_documents_tool

List all indexed documents in the PinRAG index.

Returns unique document IDs (PDF file names, video IDs, discord-alicia-1200-pcb, owner/repo/path for GitHub, etc.)
currently in the vector store, plus total chunk count. Uses server config
for vector store location and collection.

Args:
    tag: Optional tag to filter: only list documents that have this tag.
    ctx: MCP request context (injected by the server; unused).

Returns:
    Dictionary containing documents, total_chunks, persist_directory,
    collection_name, document_details.
remove_document_tool

Remove a document and all its chunks from the PinRAG index.

Deletes all chunks and embeddings for the given document. Use
list_documents_tool to see document_ids (e.g. "mybook.pdf", "bwgLXEQdq20", "discord-alicia-1200-pcb", "owner/repo/path" for GitHub).
Uses server config for vector store location and collection.

Args:
    document_id: Document identifier to remove (from list_documents_tool).
    ctx: MCP request context (injected by the server; unused).

Returns:
    Dictionary containing deleted_chunks, document_id, persist_directory, collection_name.

Prompts

Interactive templates invoked by user choice

NameDescription
use_pinragUse PinRAG to query, index, list, or remove documents. Routes to the correct tool based on the request: - Query / question → query_tool - Index / add → add_url_tool (URLs) or add_document_tool (files/dirs) - List / show → list_documents_tool - Remove / delete → remove_document_tool

Resources

Contextual data attached and managed by the client

NameDescription
documents_resourceRead-only list of documents currently indexed in PinRAG (default collection).
server_config_resourceEnvironment variables and config params used by the PinRAG MCP server.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ndjordjevic/pinrag'

If you have feedback or need assistance with the MCP directory API, please join our Discord server