Skip to main content
Glama
qdrant-financial-docs

qdrant-financial-docs

Claude Financial Intelligence System

Equip Claude Desktop with custom tools to search both text and images in financial PDFs using multimodal embeddings, vector search, and the Model Context Protocol (MCP).

๐Ÿ’ฌ ยฟHablas espaรฑol? Join our Spanish-speaking Telegram community to discuss AI, ML, and data science projects!

The Problem: Traditional search systems only index text, missing 50%+ of information locked in charts, graphs, and visualizations.

The Solution: This system embeds both text chunks AND images into the same 3072-dimensional vector space using Google Gemini's multimodal embeddings, then exposes search tools to Claude Desktop via MCP.

Sample


๐ŸŽฏ Key Features

  • Multimodal Search: Query charts, graphs, and text using multimodal embeddings

  • Hybrid Search: Combine semantic similarity with metadata filtering

  • Custom Tools: 4 custom MCP tools for semantic search, filtering, comparisons, and discovery

  • Local Development: Runs entirely on your laptop via Dockerโ€”no cloud required

  • Production Ready: Seamless migration to Qdrant Cloud when you need scale


Related MCP server: Enterprise Knowledge MCP Server

๐Ÿ—๏ธ Architecture

Ingestion Pipeline

Extract text AND images from PDFs, embed both modalities using Gemini API, and store in Qdrant with rich metadata (ticker, quarter, year, document type). Ingestion Pipeline

Query Flow

Hybrid search combines metadata filtering with semantic similarity to return multimodal results (text + charts). Query Result


๐Ÿ› ๏ธ Tech Stack

Component

Technology

Purpose

LLM Interface

Claude Desktop

Natural language queries via MCP

Bridge

Model Context Protocol (MCP)

Exposes custom tools to Claude

Tools

LangChain Community

Semantic search, filtering, comparisons

Vector DB

Qdrant

Local/cloud vector storage

Embeddings

Google Gemini Embeddings 2

Multimodal embeddings (3072-dim, text + images)

PDF Parsing

LangChain + PyPDF

Extract text + images from PDFs

Package Manager

uv

Fast Python dependency management


๐Ÿš€ Quick Start

Prerequisites

  • Docker (for Qdrant)

  • Python 3.10+

  • Claude Desktop

  • Google Gemini API key (free tier available)

1. Clone & Install

git clone <your-repo-url>
cd agent-tools-claude

2. Set Up Environment

Copy the example environment file and fill in your API key:

cp .env.example .env
# Edit .env and add your GEMINI_API_KEY

3. Start Qdrant

docker compose up -d

Qdrant will be available at http://localhost:6333 (Web UI at /dashboard)

4. Ingest Documents

# Install dependencies (using uv)
uv sync

# Ingest PDFs using Justfile
just ingest data/nvidia/

# Or ingest a single PDF
just ingest data/nvidia/NVDA-Q3-2025.pdf

Alternatively, run the ingestion script directly:

uv python scripts/ingest_pdf.py data/nvidia/

5. Configure Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "qdrant-financial-docs": {
      "command": "/path/to/uv",
      "args": [
        "--directory",
        "/path/to/agent-tools-claude",
        "run",
        "servers/mcp_server.py"
      ]
    }
  }
}

6. Restart Claude Desktop

Quit Claude Desktop completely (โŒ˜+Q) and reopen. You should see the ๐Ÿ”Œ icon indicating MCP tools are connected.

7. Start Querying!

Try these queries in Claude Desktop:

  • "What was NVIDIA's Q3 2025 data center revenue?"

  • "Compare Q2 and Q3 gaming revenue"

  • "Show me all Q4 documents"

  • "What risks were mentioned in the earnings call?"


๐Ÿ“ Project Structure

agent-tools-claude/
โ”œโ”€โ”€ servers/
โ”‚   โ”œโ”€โ”€ mcp_server.py              # MCP server implementation
โ”‚   โ””โ”€โ”€ tool_definitions.yaml       # Declarative tool descriptions
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ config.py                   # Configuration (loads .env)
โ”‚   โ”œโ”€โ”€ models/
โ”‚   โ”‚   โ””โ”€โ”€ embedder.py            # Gemini embedder wrapper
โ”‚   โ”œโ”€โ”€ helpers/
โ”‚   โ”‚   โ”œโ”€โ”€ logs.py                # Logging utilities
โ”‚   โ”‚   โ””โ”€โ”€ qdrant_utils.py        # Qdrant operations
โ”‚   โ”œโ”€โ”€ tools/
โ”‚   โ”‚   โ””โ”€โ”€ qdrant_tools.py        # LangChain tool definitions
โ”‚   โ””โ”€โ”€ scripts/
โ”‚       โ””โ”€โ”€ pdf_ingestion.py       # Multimodal ingestion pipeline
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ ingest_pdf.py              # CLI for PDF ingestion
โ”‚   โ””โ”€โ”€ delete_collection.py       # Utility to reset database
โ”œโ”€โ”€ examples/
โ”‚   โ”œโ”€โ”€ list_qdrant_tools.py       # List all MCP tools
โ”‚   โ””โ”€โ”€ test_qdrant_tools.py       # Test tools directly
โ”œโ”€โ”€ data/                          # Your PDF documents (gitignored)
โ”œโ”€โ”€ docker-compose.yml             # Qdrant local setup
โ”œโ”€โ”€ pyproject.toml                 # Python dependencies
โ”œโ”€โ”€ .env.example                   # Environment variable template
โ””โ”€โ”€ README.md                      # This file

๐Ÿ”ง Configuration

Environment Variables

Variable

Description

Default

GEMINI_API_KEY

Google Gemini API key

Required

QDRANT_URL

Qdrant instance URL

http://localhost:6333

QDRANT_API_KEY

Qdrant Cloud API key (optional)

None

QDRANT_COLLECTION_NAME

Collection name in Qdrant

stock-market

EMBEDDING_MODEL

Gemini embedding model

gemini-embedding-2-preview

EMBEDDING_DIMENSIONS

Vector dimensions

3072

PDF Metadata Extraction

The ingestion pipeline automatically extracts metadata from filenames:

Pattern: {TICKER}-{Quarter}-{Year}-{Type}.pdf

Examples:

  • NVDA-Q3-2025-Transcript.pdf โ†’ ticker: NVDA, quarter: Q3, year: 2025

  • AMD-Q4-2024-Presentation.pdf โ†’ ticker: AMD, quarter: Q4, year: 2024

Metadata enables fast filtering: "Get all Q3 2025 documents" (20ms vs 500ms semantic search)


๐Ÿ’ก Usage Examples

CLI: Ingest Documents

# Single file
just ingest data/nvidia/NVDA-Q3-2025.pdf

# Entire folder (recursive)
just ingest data/nvidia/

๐ŸŽจ MCP Tools

The system exposes 4 custom tools to Claude Desktop:

Custom tools

1. search_documents

  • Purpose: Semantic search by meaning (not exact keywords)

  • Use Case: "What did Jensen say about AI chips?"

2. filter_by_metadata

  • Purpose: Fast retrieval of all documents matching filters

  • Use Case: "Get all Q3 2025 documents"

3. compare_quarters

  • Purpose: Cross-period trend analysis

  • Use Case: "Compare Q2 vs Q3 revenue"

4. get_available_data

  • Purpose: Discover available tickers, quarters, years

  • Use Case: "What data do you have?"


๐Ÿงช Development

Run MCP Server Directly

# Test the MCP server
uv run servers/mcp_server.py

Test Tools Without Claude

# List available tools
python examples/list_qdrant_tools.py

# Test semantic search
python examples/test_qdrant_tools.py

Reset Database

# Delete collection and start fresh
just delete-collection

View Qdrant UI

Open http://localhost:6333/dashboard to:

  • Explore collections

  • View vector points

  • Test queries manually


๐Ÿ”ฎ Future Enhancements

  • Multi-Company Support: Ingest AMD, Intel, etc. for competitive analysis

  • REST API: Webhook endpoint for automatic ingestion

  • Audio Transcription: Add earnings call audio via Whisper

  • Multi-Language: Leverage Gemini's 100+ language support

  • Cloud Migration: Scale to Qdrant Cloud for millions of vectors


๐Ÿค Contributing

Contributions welcome! This is a learning project showcasing:

  • Building custom Claude Desktop tools via MCP

  • Multimodal search implementation

  • Vector database optimization

  • Hybrid search strategies


๐Ÿ“ License

MIT License - see LICENSE file for details


๐Ÿ”— Resources


๐Ÿ’ฌ Join the Community

Interested in AI, machine learning, and data science? Join our community to learn and share:

  • ๐Ÿ’ฌ Telegram Community (Spanish) - Discuss AI, ML, data science, and build cool projects together (Spanish-speaking community)

  • ๐Ÿ’ผ LinkedIn - Let's connect and stay in touch

Found this project helpful? Give it a โญ on GitHub!

Available Tools

5 tools
compare_quartersA

Compare financial information across multiple quarters for trend analysis. Returns documents grouped by quarter so you can show side-by-side comparisons.

WHEN TO USE:

  • "Compare Q3 vs Q4 revenue"

  • "How did data center revenue change quarter over quarter?"

  • "Show me YoY comparison"

  • Any question with "compare", "vs", "versus", "difference between"

EXAMPLES:

  • "Compare NVIDIA Q3 and Q4 2025 AI chip revenue" โ†’ Use this tool

  • "What's the trend in gaming revenue?" โ†’ Use this tool

Inputs: year (required), ticker (required), quarters (required), query, +1 more.

filter_by_metadataA

Retrieve ALL documents for a complete quarter/year using metadata filters only. No semantic search - returns the entire dataset you need for comprehensive analysis.

โš ๏ธ CRITICAL: After calling this tool, you have everything needed. DO NOT call search_documents next. Just analyze what you received.

USE THIS FOR:

  • General summaries: "Summarize Q3 earnings" "Analyze Q2 performance"

  • Getting complete data: "Show me Q3 data" "Give me all Q4 documents"

  • Full quarter analysis where you need ALL information

NEVER USE THIS FOR:

  • Specific questions about one topic (use search_documents instead)

  • Finding particular information (use search_documents instead)

WORKFLOW:

  1. Optional: Call get_available_data first to check document counts

  2. Set appropriate limit (20-50 for complete data)

  3. Call this tool to get all documents

  4. Analyze/summarize the results yourself - STOP here, no more tool calls

EXAMPLES: โœ… "Summarize NVIDIA Q3 2025 earnings" โ†’ ticker="NVDA", quarter="Q3", year="2025", limit=30 โœ… "Analyze Q2 performance" โ†’ ticker="NVDA", quarter="Q2", year="2025", limit=30 โœ… "Show me all Q4 docs" โ†’ ticker="NVDA", quarter="Q4", year="2025", limit=50 โŒ "What was Q3 revenue number?" โ†’ Use search_documents (specific question) โŒ "What did Jensen say about AI?" โ†’ Use search_documents (specific topic)

Inputs: year, limit, ticker, quarter.

get_available_dataA

USE THIS FIRST when user asks about data availability or when you're unsure if you have information. Discovers what tickers, quarters, and years are in the database.

โšก RETURNS: Document counts by ticker/quarter/year - USE THESE COUNTS to choose intelligent limits!

SMART USAGE PATTERN:

  1. Call this FIRST to see: "NVDA Q4 2026 has 67 documents"

  2. Then call filter_by_metadata with appropriate limit (e.g., 15-20 for that query)

  3. Avoids multiple calls with different limits!

WHEN TO USE:

  • "What data do you have?"

  • "Do you have Tesla earnings?" โ†’ Check first!

  • "What quarters are available for NVIDIA?"

  • At the START of a conversation to know what you can answer

  • BEFORE calling filter_by_metadata - check counts first to choose smart limits!

  • BEFORE saying "I don't have that data" - always check here first!

CRITICAL: If user asks about a company/quarter, use this to verify data exists before searching.

Inputs: ticker.

get_collection_statsA

Get database statistics (total documents, collection health). Use for technical debugging or when user asks "how much data do you have?"

WHEN TO USE:

  • "How many documents are stored?"

  • "Is the database working?"

  • Technical troubleshooting

Inputs: no named parameters.

search_documentsA

Find specific information about ONE TOPIC using semantic vector search. Returns only the most relevant chunks matching your search query.

โš ๏ธ CRITICAL: If you already called filter_by_metadata, DO NOT use this tool. You already have all the data - just analyze what you received.

USE THIS FOR:

  • Specific questions: "What was Q3 revenue?" "What risks were mentioned?"

  • Topic-focused queries: "What did Jensen say about AI chips?"

  • Finding particular information within documents

NEVER USE THIS FOR:

  • General summaries: "Summarize Q3 earnings" (use filter_by_metadata ONLY)

  • After calling filter_by_metadata (you already have the data)

  • Getting all documents (use filter_by_metadata instead)

EXAMPLES: โœ… "What was NVIDIA's Q3 revenue number?" โ†’ query="revenue", ticker="NVDA", quarter="Q3" โœ… "What did Jensen say about AI chips?" โ†’ query="Jensen Huang AI chips" โœ… "What risks were mentioned in Q2?" โ†’ query="risks", quarter="Q2" โŒ "Summarize Q3 earnings" โ†’ Use filter_by_metadata ONLY, not this tool โŒ "Show me Q3 data" โ†’ Use filter_by_metadata ONLY, not this tool

Inputs: query (required), year, limit, ticker, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelogโ€ฆ

    TDQS

    A4/5.0

    Scored across 5 tools

    Disambiguation3/5

    The descriptions work hard to separate search_documents (specific topic) from filter_by_metadata (whole-quarter summaries), but compare_quarters is essentially filter_by_metadata run across multiple quarters, so the boundary is thin. Similarly, get_collection_stats and get_available_data both answer 'how much data do you have?' using document counts, differentiated only by 'technical debugging' vs. 'discovery' framing. The explicit WHEN/NEVER guidance helps, but several tool pairs still tempt misselection.

    Naming Consistency5/5

    All five tools use snake_case verb-first names (get_collection_stats, search_documents, filter_by_metadata, compare_quarters, get_available_data). The verb choice reflects the action (get/search/filter/compare) and the noun reflects the target resource, making the set highly predictable.

    Tool Count4/5

    Five tools is a tight, well-scoped set for a read-only financial document QA server, and each one has an identifiable role. However, compare_quarters is arguably an aggregate variant of filter_by_metadata, so one tool is somewhat redundant, leaving the set a touch thin on genuinely distinct operations.

    Completeness4/5

    The read-only surface covers discovery (get_available_data, get_collection_stats), targeted retrieval (search_documents), full retrieval (filter_by_metadata), and trend analysis (compare_quarters) โ€” a coherent lifecycle for document QA. Minor gaps exist, such as fetching a single document by ID or listing distinct tickers without counts, but agents can work around these.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables Claude Desktop to search and query personal document collections (PDF, Word, Markdown, text) using semantic search and conversational AI with full context preservation across exchanges.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables querying enterprise documents (DOCX, PDF, PPTX) using natural language, with hybrid search and MCP integration for Claude Desktop and other agents.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables Claude Desktop to perform local-first semantic search, ingest documents, and manage a private knowledge base with hybrid search, PII redaction, and multi-format support.
      1
      MIT
    • -
      license
      Not graded
      quality
      Not graded
      maintenance
      Turn SEC EDGAR filings into a searchable vector database, enabling natural language queries over company filings through Claude Desktop.
      -