FinRAG-MCP
Provides a FastAPI gateway server that exposes REST endpoints for the RAG system, enabling web-based access to document querying and role-based retrieval functionality.
Uses OpenAI's API for embeddings and language model operations to power the RAG system's document retrieval and response generation capabilities.
Offers a Streamlit web UI for interactive document querying with role-based access control, allowing users to search company documents through a user-friendly interface.
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., "@FinRAG-MCPWhat were our Q4 revenue drivers?"
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.
FinRAG-MCP
FinRAG-MCP is a Role-Based Access Control (RBAC) Retrieval-Augmented Generation (RAG) system, integrated with the Model Context Protocol (MCP).
It lets you query company documents (Engineering, Finance, HR, Marketing, General) securely — each role only sees what it’s allowed to.
✅ Works with Claude Desktop (MCP tools)
✅ Optional Streamlit UI + FastAPI gateway
✅ Uses Qdrant (local) for vector search
✅ Documents enriched with metadata + citations
🚀 Why this project
Secure answers → Employees, Managers, and C-Level see different data (RBAC).
Trusted output → Every response includes sources and file chunks.
Flexible → Claude MCP integration + standalone UI.
Practical → Handles Markdown, CSV, reports, handbooks, financial summaries.
Related MCP server: nacre
📂 Project Structure
FinRAG-MCP
FinRAG-MCP is a Role-Based Access Control (RBAC) Retrieval-Augmented Generation (RAG) system, integrated with the Model Context Protocol (MCP).
It lets you query company documents (Engineering, Finance, HR, Marketing, General) securely — each role only sees what it’s allowed to.
✅ Works with Claude Desktop (MCP tools)
✅ Optional Streamlit UI + FastAPI gateway
✅ Uses Qdrant (local) for vector search
✅ Documents enriched with metadata + citations
🚀 Why this project
Secure answers → Employees, Managers, and C-Level see different data (RBAC).
Trusted output → Every response includes sources and file chunks.
Flexible → Claude MCP integration + standalone UI.
Practical → Handles Markdown, CSV, reports, handbooks, financial summaries.
📂 Project Structure
⚙️ Setup
``bash
Clone repo
git clone https://github.com/YOUR_GITHUB/finrag-mcp.git cd finrag-mcp
Create venv with uv
uv venv .venv source .venv/bin/activate uv sync
Add secrets
cat > env/.env << 'EOF' OPENAI_API_KEY=sk-REPLACE_ME OPENAI_MODEL=gpt-4o-mini EMBED_MODEL=text-embedding-3-large QDRANT_LOCAL_PATH=.qdrant_local QDRANT_COLLECTION_PREFIX=finrag FINRAG_ROLE=EMPLOYEE EOF
Ingest docs
uv run python -m ingest.run_ingest --data-root ./data
Run Options
Claude MCP (Recommended) Open Claude Desktop → Settings → Developer → Local MCP servers Add: Command: .../finrag-mcp/.venv/bin/python Args: -m mcp_server.server Env: from .env Claude can now call tools: set_role("FINANCE") search("Q4 2024 revenue drivers", top_k=5)
Start gateway
uv run uvicorn gateway.app:app --port 8000
Start UI
uv run streamlit run ui/app.py --server.port 8501
Example Queries Employee: “What does the handbook say about leave approval?” Engineering: “List services in the architecture doc.” Finance: “Summarize Q4 revenue drivers.” HR: “What’s the rule for sick leave >2 days?” Marketing: “Which 2024 campaigns had the best ROI?”
Available Tools
4 toolslist_filesA
List files under data/<domain>, RBAC-enforced.
Returns relative paths from repo root.
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description discloses RBAC enforcement (access control) and the return format (relative paths from repo root). No annotations are provided, so the description carries the full burden, and it adds meaningful behavioral context beyond the schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, zero wasted words. The first sentence captures the core action and access model, the second explains the output. Information is front-loaded and easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the low complexity (1 required parameter with enum, output schema exists) and sibling tools, the description covers the essential behavior: what it lists, where, and what returns. Minor gaps like recursion depth or sorting are not critical for this tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description must compensate. It explains that the 'domain' parameter corresponds to a subdirectory under 'data/', which adds meaning beyond the enum list in the schema. This helps the agent understand the parameter's role.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'List files under data/<domain>' which is a specific verb and resource. It distinguishes from sibling tools like read_file (reads a single file) and search (queries content) by focusing on listing files within a domain directory.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use this tool versus alternatives. It does not state prerequisites, when not to use, or mention any filtering capabilities. The description implies usage for listing files in a domain but lacks context for decision-making.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_fileC
Read a text-like file relative to repo root, RBAC-enforced by folder domain.
| Name | Required | Description | Default |
|---|---|---|---|
| rel_path | Yes | ||
| max_chars | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so the description must carry behavioral disclosure. It mentions RBAC enforcement but lacks details on error handling (e.g., file not found), encoding, behavior for binary files, or truncation with max_chars. The term 'text-like' is vague.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single short sentence, but it omits essential details. Conciseness should not come at the cost of completeness; under-specification reduces utility.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations, incomplete parameter documentation, and no output schema info, the description does not adequately cover the tool's usage, behavior, or return values. Siblings exist but no guidance.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description should compensate. It does not explain the meaning of rel_path (that it's relative to repo root) or max_chars (truncation limit). The path scope is hinted but not explicitly tied to the parameter.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Read'), the resource ('text-like file'), and the scope ('relative to repo root'). It distinguishes from siblings: list_files lists files, search searches, set_role sets role, so the purpose is unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the tool is for reading file contents but does not explicitly state when to use it vs. siblings like list_files or search. No guidance on when not to use or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
searchA
RBAC-aware vector search across allowed domains/collections.
Args:
query: natural language query
top_k: number of results to return
include_general: include 'general' alongside role-specific domains
Returns a list of hits with:
score, collection, domain, source, title, doc_type, tags, chunk_id, snippet
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| top_k | No | ||
| include_general | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It mentions RBAC awareness and lists return fields, but lacks disclosure of side effects, rate limits, or authentication requirements.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is structured with a clear first sentence and a parameter list, but it is somewhat verbose and repeats information that could be inferred from the schema, though it remains efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (3 parameters, output schema exists), the description adequately covers purpose, parameters, and return format. It misses prerequisites or limitations but is largely complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has 0% description coverage, but the docstring adds meaningful parameter explanations: 'natural language query', 'number of results to return', and 'include general alongside role-specific domains', which go beyond plain property names.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it is a vector search tool with RBAC awareness, specifying it searches across allowed domains/collections. It distinguishes itself from sibling tools like list_files and read_file by focusing on search.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for search with role-based access but does not provide explicit when-to-use or when-not-to-use guidance, nor does it compare to alternatives like list_files or read_file.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
set_roleB
Set the active role for this MCP session. Returns the domains the role can access.
| Name | Required | Description | Default |
|---|---|---|---|
| role | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must fully disclose behavior. It mentions that domains are returned, but does not explain side effects like overriding previous role, reversibility, or impact on other operations. This is insufficient for a state-modifying tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with no filler. The description is front-loaded and every word adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is simple with one parameter and an output schema (implied by context). The description covers the return value, but lacks details about parameter values and any usage context. It is minimally adequate for a straightforward tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, meaning the description must compensate. However, the description does not mention the 'role' parameter at all, nor its enum values or purpose. It only says 'Set the active role' without linking to the parameter.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states that the tool sets the active role for the MCP session and returns accessible domains. It uses a specific verb and resource, and distinguishes from sibling tools like list_files, read_file, and search.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use this tool versus alternatives. The description implies it is for changing the session role, but does not mention prerequisites, exclusions, or when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool has a clear, distinct purpose: list_files for listing, read_file for reading content, search for vector search, and set_role for role management. No overlap.
All tool names follow a consistent verb_noun snake_case pattern (list_files, read_file, search, set_role), making predictable and easy to understand.
With 4 tools covering file listing, reading, search, and role setting, the count is appropriate for a focused RAG server. Slightly more tools (e.g., for data management) could be justified, but current scope is reasonable.
Covers core retrieval operations (list, read, search) and role management, but lacks data ingestion, deletion, or role listing/management beyond setting. Notable gap for a full RAG workflow.
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 Connectors
Shared, permission-aware company context for AI agents, with provenance, approvals and audit.
Your company's brain for AI agents. Cited, permission-aware knowledge across every system.
Governed, auditable knowledge your team curates for its AI assistants, self-hostable
Draft cited RFP and security questionnaire answers from your knowledge base, with human review
Related MCP Servers
- FlicenseAqualityCmaintenanceEnables AI agents to query structured knowledge across enterprise domains (legal, HR, compliance) with metadata-driven filtering and TF-IDF ranking.4
- AlicenseNot gradedqualityAmaintenanceProvides a self-hosted knowledge index with document-level permissions, enabling AI agents to retrieve exactly the documents they are authorized to see via MCP. Supports OAuth 2.1, custom embedding models, and runs inside your network.41Apache 2.0
- FlicenseNot gradedqualityCmaintenanceProvides read-only, citation-backed semantic search and retrieval-augmented generation over enterprise documents via standardized MCP tools, with local embeddings for privacy.
- AlicenseNot gradedqualityBmaintenanceAn enterprise-grade MCP gateway and security router that gives AI agents secure, observable access to internal corporate knowledge through hybrid vector+BM25 retrieval, RBAC, and prompt injection protection.MIT
Appeared in Searches
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/Nithishkaranam2002/Finrag--mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server