RAG

Provides multi-agent retrieval-augmented generation for legal documents, deadlines, and analytics via MCP with a Claude Desktop integration and a REST API backend.
  • python

0

GitHub Stars

python

Language

2 months ago

First Indexed

3 weeks ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "tsarri-rag-mcp-server": {
      "command": "python",
      "args": [
        "src/server.py"
      ],
      "env": {
        "SUPABASE_KEY": "your_supabase_key",
        "SUPABASE_URL": "your_supabase_url"
      }
    }
  }
}

You set up a multi-agent MCP server that coordinates specialized AI microagents for legal document processing, deadline extraction, and strategic analytics. This server integrates with Claude Desktop to enable seamless agent collaboration, semantic search, and actionable insights, while providing a REST API for frontend applications.

How to use

You interact with the MCP server through Claude Desktop or via the REST API. The system exposes three agents core to its workflow: a Deadline Agent that extracts and tracks deadlines from Spanish legal texts, a Document Classification Agent that categorizes and tags documents, and a SmartContext Analytics Agent that provides strategic business insights and cross-document trends. Use Claude Desktop to access the agent tools directly, or use the REST API to integrate document processing, deadlines, and analyses into your frontend.

Key capabilities you can leverage include: extracting deadlines from legal documents, classifying document types, indexing documents into a vector store for semantic search, and running strategic analyses across documents to identify business insights and trends. You can mix automation with oversight by enabling zero-input automation for routine tasks while routing complex decisions to your analysts.

How to install

Follow these steps to install and run the MCP server locally. Ensure you have the required prerequisites installed first.

Prerequisites you need to have before starting:

  • Python 3.10+ installed on your system.

  • Supabase account for vector storage and database access.

  • Claude Desktop installed for MCP integration.

  • PostgreSQL with pgvector extension.

Concrete steps to install and run the server locally are below.

bash
# 1. Clone the project repository
git clone https://github.com/yourusername/rag-mcp-server.git
cd rag-mcp-server

# 2. Create a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# 3. Install dependencies
pip install -r requirements.txt

# 4. Configure environment
cp .env.example .env
# Edit .env with your credentials (SUPABASE_URL, SUPABASE_KEY, etc.)

# 5. Initialize the database
psql -h your-supabase-host -U postgres -d your-database -f database/schema.sql

# 6. Configure Claude Desktop (for MCP integration)
# Add a config entry that points to the local MCP server script
{
  "mcpServers": {
    "rag-server": {
      "command": "python",
      "args": ["/Users/yourusername/rag-mcp-server/src/server.py"],
      "env": {
        "SUPABASE_URL": "your_supabase_url",
        "SUPABASE_KEY": "your_supabase_key"
      }
    }
  }
}

# 7. Restart Claude Desktop

Additional configuration and operation notes

Two MCP endpoints are available for different integration styles. The primary MCP server runs locally via Python and is configured through Claude Desktop with the environment variables SUPABASE_URL and SUPABASE_KEY to connect to your Supabase instance.

A REST API server is also provided to support frontend integrations. Start it with the following command after the MCP server is running:

python src/api_server.py

Security and data practices

Protect sensitive data through a layered security approach: authenticate users, enforce authorization, and use encryption for sensitive data. Do not expose credentials or .env files publicly.

Troubleshooting and notes

If you encounter issues starting the MCP server, verify that the environment variables are correctly set in .env and that the database schema is initialized. Check that Claude Desktop is configured to point to the local server script and that the path in the configuration matches your setup.

Available tools

extract_deadlines

Extract deadlines from Spanish legal documents including categorization and automated tracking.

list_deadlines

List all currently tracked deadlines across clients.

search_deadlines

Search deadlines by criteria to filter and retrieve relevant items.

classify_document

Classify document type and extract metadata for indexing.

index_document

Add a document to the vector store for semantic search.

search_documents

Perform semantic search over stored documents.

analyze_context

Provide strategic context analysis for business intelligence.

extract_insights

Extract cross-document insights for decision making.

trend_analysis

Analyze trends across documents and timelines.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational