ranger-rag-mcp
Provides integration with Apache Ranger to enforce authorization policies on RAG knowledge base queries, checking user permissions before forwarding requests to the RAG system.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ranger-rag-mcpAs user 'alice', query the 'Finance KB' knowledge base: What was Q3 revenue?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Ranger RAG MCP Server
MCP server that integrates Apache Ranger authorization with RAG (Retrieval Augmented Generation). When a user queries a knowledge base, the server first checks Ranger policies to verify the user has permission — if denied, the query is rejected before reaching the RAG system.
Architecture
User (AI Agent) ──→ MCP Server ──→ Ranger Policy Check ──→ RAG Studio
│
DENY → "Access Denied"
ALLOW → Forward query, return resultsRelated MCP server: ToolBridge
Features
Per-knowledge-base authorization — Ranger policies control which users can access which knowledge bases
Transparent enforcement — denied queries never reach the RAG system
Policy-based access control — uses existing Ranger infrastructure (policies, users, groups)
Automatic retries — exponential backoff on transient errors
Fallback evaluation — if Ranger's evaluateOnce API isn't available, evaluates policies locally
MCP Tools
Tool | Description |
| Query a KB with Ranger auth check |
| List KBs the user can access |
| Pre-flight permission check |
| Show all RAG Ranger policies (admin) |
Setup
1. Create a Ranger Service for RAG
In Ranger Admin, create a new service (or use an existing custom service type) with:
Service Name:
ragResource:
knowledge_base(string, supports wildcards)Access Types:
read,write
2. Create Ranger Policies
Example policies:
Policy Name | Resource | Users | Access |
Finance KB - Analysts |
| alice, bob | read |
HR KB - HR Team |
| charlie | read |
All KBs - Admin |
| admin | read, write |
3. Install and Configure
git clone <repo-url>
cd ranger-rag-mcp
python3 -m venv .venv
source .venv/bin/activate
pip install -e .Copy .env.example to .env and fill in your values:
cp .env.example .env
# Edit .env with your Ranger and RAG Studio credentials4. Configure MCP Client
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"ranger-rag-mcp-server": {
"command": "/FULL/PATH/TO/ranger-rag-mcp/.venv/bin/python",
"args": ["-m", "ranger_rag_mcp_server.server"],
"env": {
"RANGER_GATEWAY_URL": "https://<gateway>/<topology>/cdp-proxy-api/ranger/",
"RANGER_USER": "<workload_username>",
"RANGER_PASS": "<workload_password>",
"RANGER_SERVICE_NAME": "rag",
"RAG_STUDIO_URL": "https://<rag-studio-url>",
"RAG_STUDIO_API_KEY": "<api_key>"
}
}
}
}Agent Studio / Kiro:
{
"mcpServers": {
"ranger-rag-mcp-server": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/<your-org>/ranger-rag-mcp@main",
"run-server"
],
"env": {
"RANGER_GATEWAY_URL": "https://<gateway>/<topology>/cdp-proxy-api/ranger/",
"RANGER_USER": "<workload_username>",
"RANGER_PASS": "<workload_password>",
"RANGER_SERVICE_NAME": "rag",
"RAG_STUDIO_URL": "https://<rag-studio-url>",
"RAG_STUDIO_API_KEY": "<api_key>"
}
}
}
}Configuration
Ranger
Variable | Required | Description |
| Yes | Ranger Admin REST API URL via Knox |
| Yes | Workload username for Ranger API auth |
| Yes | Workload password for Ranger API auth |
| No | Ranger service name (default: |
RAG Studio
Variable | Required | Description |
| Yes | RAG Studio base URL |
| Yes | RAG Studio API key |
| No | Project ID (default: 1) |
| No | Number of chunks to retrieve (default: 5) |
| No | LLM model for response generation |
TLS/HTTP
Variable | Default | Description |
|
| Set |
| — | Path to CA certificate bundle |
|
| Request timeout in seconds |
Example Usage
Once configured, ask the AI:
# User with access → gets results
"As user 'alice', query the 'Finance KB' knowledge base: What was Q3 revenue?"
# User without access → gets denied
"As user 'bob', query the 'HR Policies' knowledge base: What is the PTO policy?"
# Check what a user can access
"List all knowledge bases that user 'alice' can access"
# Admin: see all policies
"Show me all the RAG access policies"How It Works
User calls
query_knowledge_base(user="alice", knowledge_base="Finance KB", query="...")MCP server calls Ranger:
POST /service/plugins/policies/evaluateOnce— "Can alice read Finance KB?"Ranger evaluates policies:
Checks all enabled policies for the
ragserviceLooks for policies where resource
knowledge_basematches "Finance KB"Checks if user "alice" or any of her groups appear in
policyItemswithreadaccess
If ALLOWED: Forward query to RAG Studio, return answer
If DENIED: Return
ACCESS_DENIEDwith reason — RAG Studio is never contacted
Ranger Policy Structure
The server expects Ranger policies with this structure:
{
"service": "rag",
"name": "Finance KB Access",
"isEnabled": true,
"resources": {
"knowledge_base": {
"values": ["Finance KB"],
"isRecursive": false
}
},
"policyItems": [
{
"users": ["alice", "bob"],
"groups": ["finance-team"],
"accesses": [
{"type": "read", "isAllowed": true}
]
}
]
}License
Apache License 2.0
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityAmaintenanceA production-grade MCP server for integrating RAG into AI agents, supporting multiple vector databases with enterprise security and dynamic tool selection.215MIT
- FlicenseNot gradedqualityCmaintenanceA governed MCP server for integrating AI agents with customer data, featuring role-based access control, field redaction, and human-in-the-loop approval for secure support operations.1
- AlicenseNot gradedqualityCmaintenanceAn MCP server that enforces runtime governance on AI agent actions — file access, command execution, delegation chains, and permission escalation.MIT
- FlicenseNot gradedqualityBmaintenanceMCP server for a modular RAG system that enables natural language question answering over enterprise documents with intent-aware routing, adaptive retrieval, and citation-backed responses.
Related MCP Connectors
MCP server connecting AI agents to non-custodial staking data across 130+ networks.
MCP server for AI dialogue using various LLM models via AceDataCloud
MCP Hub: AI service discovery, per-user OAuth, and multi-service workflow orchestration
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/WarinChi/ranger-rag-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server