Skip to main content
Glama
norandom

RAGFlow Claude MCP Server

by norandom

RAGFlow Claude MCP-Server

Ein kleiner Model Context Protocol (MCP)-Server, der Claude Desktop (und andere MCP-Clients) mit einer RAGFlow-Instanz verbindet. Er stellt die RAGFlow REST-API als eine Reihe von Tools zur Verfügung, sodass das LLM Wissensdatenbanken abfragen und Dokumenten-Chunks in seinen Kontext ziehen kann.

Dies ist eine Software für den persönlichen Gebrauch, die ich für meine eigene Forschung und Entwicklung geschrieben habe. Sie ist nicht fehlerfrei und der Code ist nicht schön. Er funktioniert für meine Zwecke.

Was er tut

  • Direkter Abruf: Zieht rohe Dokumenten-Chunks mit Ähnlichkeitswerten vom /retrieval-Endpunkt von RAGFlow.

  • Multi-KB-Suche: Eine einzelne Abfrage kann mehrere Wissensdatenbanken gleichzeitig durchsuchen.

  • DSPy-Abfragevertiefung: Optionale iterative Abfrageverfeinerung (nutzt ein LLM, um Zwischenergebnisse zu analysieren und die Abfrage umzuschreiben).

  • ~~Reranking~~ — derzeit auf der RAGFlow-Seite defekt, siehe Bekannte Probleme.

  • Einstellbare Ergebniskontrolle: page_size, similarity_threshold, top_k, Paginierung.

  • Dokumentenfilter: Ergebnisse auf ein Dokument innerhalb eines Datensatzes beschränken (Fuzzy-Namensabgleich).

  • Datensatzsuche nach Name (Groß-/Kleinschreibung ignoriert, Fuzzy) anstelle von ID.

  • Cloudflare Zero Trust-Authentifizierung, wenn Ihr RAGFlow dahinter liegt.

Related MCP server: RAGBrain MCP

Installation

  1. Klonen:

    git clone https://github.com/norandom/ragflow-claude-desktop-local-mcp
    cd ragflow-claude-desktop-local-mcp
  2. Installieren:

    # On macOS, install DSPy first to dodge build issues:
    pip install git+https://github.com/stanfordnlp/dspy.git
    
    uv install
  3. Konfigurieren: Kopieren Sie das Beispiel und tragen Sie Ihre RAGFlow-Details ein.

    cp config.json.sample config.json

    Schlüssel:

    • RAGFLOW_BASE_URL: z. B. http://your-ragflow-server:9380

    • RAGFLOW_API_KEY: Ihr RAGFlow API-Schlüssel

    • RAGFLOW_DEFAULT_RERANK: Rerank-Modell (Standard rerank-multilingual-v3.0)

    • CF_ACCESS_CLIENT_ID (optional): Cloudflare Zero Trust Service-Token ID

    • CF_ACCESS_CLIENT_SECRET (optional): Cloudflare Zero Trust Service-Token Secret

    • DSPY_MODEL: DSPy LM (Standard openai/gpt-4o-mini)

    • OPENAI_API_KEY: erforderlich für DSPy-Vertiefung

Cloudflare Zero Trust

Wenn Ihr RAGFlow hinter Cloudflare Zero Trust liegt, holen Sie sich ein Service-Token aus dem Dashboard und fügen Sie es der config.json hinzu:

{
  "CF_ACCESS_CLIENT_ID": "your-client-id.access",
  "CF_ACCESS_CLIENT_SECRET": "your-client-secret"
}

Wenn beide gesetzt sind, wird jede API-Anfrage mit den Headern CF-Access-Client-Id und CF-Access-Client-Secret gesendet. Es sind keine Codeänderungen erforderlich.

Claude Desktop Konfiguration

{
  "mcpServers": {
    "ragflow": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/path/to/ragflow-claude-desktop-local-mcp",
        "ragflow-claude-mcp"
      ]
    }
  }
}

Tools

ragflow_retrieval_by_name (das Tool, das ich am häufigsten verwende)

Ruft Chunks über einen oder mehrere Datensätze hinweg nach Namen ab. Gibt rohe Chunks mit Ähnlichkeitswerten zurück.

Parameter:

  • dataset_names (erforderlich) — Liste, z. B. ["BASF", "Quant Literature"]

  • query (erforderlich)

  • document_name (optional) — auf ein Dokument beschränken; Fuzzy-Match

  • top_k (optional, Standard 1024) — Vektorkandidaten

  • similarity_threshold (optional, Standard 0.2) — 0.0–1.0

  • page (optional, Standard 1)

  • page_size (optional, Standard 10)

  • use_rerank (optional, Standard false) — derzeit upstream defekt, siehe Bekannte Probleme

  • deepening_level (optional, Standard 0) — DSPy-Verfeinerung, 0–3

ragflow_retrieval

Gleiche Form, nimmt aber dataset_ids: List[str] anstelle von Namen.

Multi-KB-Suche

Sie können in einem Aufruf mehrere Wissensdatenbanken durchsuchen. Stellen Sie sicher, dass sie dasselbe Embedding-Modell verwenden — das Mischen inkompatibler Embeddings verschlechtert die Relevanzwerte.

Use ragflow_retrieval_by_name with dataset_names ["Finance Reports", "Legal Documents"] and query "Summarize the key financial risks and compliance requirements for new market entry."

ragflow_list_datasets

Listet jede Wissensdatenbank auf Ihrer RAGFlow-Instanz auf. Keine Parameter. Durchläuft intern alle Seiten.

ragflow_list_documents

Listet Dokumente in einem Datensatz auf. Durchläuft alle Seiten.

  • dataset_id (erforderlich)

ragflow_get_chunks

Gibt Chunks (mit Referenzen) für ein Dokument zurück.

  • dataset_id (erforderlich)

  • document_id (erforderlich)

ragflow_list_sessions

Zeigt aktive Chat-Sitzungen pro Datensatz an. Keine Parameter.

ragflow_list_documents_by_name

Listet Dokumente in einem Datensatz auf, gesucht nach Name.

  • dataset_name (erforderlich)

ragflow_reset_session

Beendet die Chat-Sitzung für einen Datensatz.

  • dataset_id (erforderlich)

Optimierung des Abrufs

Die Abruf-Tools bieten drei Stellschrauben:

  • page_size — Chunks pro Seite (Standard 10).

  • similarity_threshold — verwirft Chunks unter diesem Wert (Standard 0.2).

  • top_k — Poolgröße für die Vektorsuche vor dem Filtern (Standard 1024).

Einige Startpunkte, die für mich funktionieren:

  • Breiterer Abruf: page_size=15, similarity_threshold=0.15.

  • Enge Präzision: page_size=5, similarity_threshold=0.4.

  • Intensive Recherche: page_size=20, similarity_threshold=0.1, deepening_level=1.

  • Schwierige Abfragen: deepening_level=2.

  • Geschwindigkeit: deepening_level=0 beibehalten und Rerank überspringen.

Beispiele

Grundlegender Abruf nach Name:

Use ragflow_retrieval_by_name with dataset_names ["BASF"] and query "What is BASF's latest income statement? Revenue, operating income, net income, and other key figures."

Auf ein Dokument beschränken:

Use ragflow_retrieval_by_name with dataset_names ["BASF"], document_name "annual_report_2023", and query "What were the key financial highlights for 2023?"

Dokumentennamen werden per Fuzzy-Match abgeglichen — "annual" findet annual_report_2023.pdf und annual_report_2024.pdf. Wenn mehrere übereinstimmen, wählt der Server das aktuellste aus und listet die Alternativen in den Antwort-Metadaten auf.

DSPy-Vertiefung für eine knifflige Abfrage:

Use ragflow_retrieval_by_name with dataset_names ["Quant Literature"], query "what is a volatility clock", deepening_level 2.

Mehrseitig:

Use ragflow_retrieval_by_name with dataset_names ["BASF"], query "BASF business segments", page_size 10, page 2.

Verfügbare Ressourcen auflisten:

Use ragflow_list_datasets.
Use ragflow_list_documents_by_name with dataset_name "BASF".

Spezifische Chunks abrufen:

Use ragflow_get_chunks with dataset_id "43066ee0599411f089787a39c10de57b" and document_id "d74a1c105a3311f09fc94a0fcd8b7722".

Größere Prompts

Einige Beispiele, wie ich es von Claude Desktop aus steuere.

Finanzielle Tiefenanalyse:

Help me analyse BASF's recent financials.

1. Use ragflow_retrieval_by_name to search ["BASF"] for the latest income statement
   (revenue, operating income, net income). Use page_size 15,
   similarity_threshold 0.15, deepening_level 1.

2. Then run ragflow_retrieval_by_name again for the cash flow statement,
   page_size 10, similarity_threshold 0.2.

3. Finally look for year-over-year changes with page_size 12,
   similarity_threshold 0.18.

Mehrsprachige Recherche:

Use ragflow_retrieval_by_name with dataset_names ["BASF"],
query "Was sind die wichtigsten Geschäftsbereiche von BASF?",
deepening_level 2.

DSPy erkennt die Abfragesprache und verfeinert sie entsprechend. Ich habe dies für deutsche, englische und gemischtsprachige Abfragen verwendet. Es funktioniert, solange die zugrunde liegenden Dokumente Inhalte in diesen Sprachen haben.

Dokumentgefilterte Recherche:

1. Use ragflow_list_documents_by_name with dataset_name "BASF" to see what's in there.
2. Use ragflow_retrieval_by_name with dataset_names ["BASF"],
   document_name "sustainability_report", query "carbon neutrality goals",
   page_size 15, deepening_level 1.
3. Follow up with document_name "annual_report_2023" and
   query "environmental investments".

Cross-KB-Abfrage:

Use ragflow_retrieval_by_name with dataset_names ["BASF", "Industry Reports"],
query "chemical industry sustainability benchmarks",
page_size 12, deepening_level 1.

Wie DSPy-Vertiefung funktioniert

deepening_level führt eine LLM-gesteuerte Verfeinerungsschleife über dem Abruf aus:

  • 0: keine Vertiefung (Standard).

  • 1: ein Verfeinerungsdurchgang.

  • 2: zwei Durchgänge mit Lückenanalyse.

  • 3: drei+ Durchgänge plus Ergebniszusammenführung.

Jeder Durchgang: Suche durchführen, die besten Ergebnisse zusammenfassen, das LLM fragen, was fehlt, eine neue Abfrage generieren, diese ausführen. Die Antwort-Metadaten enthalten die ursprüngliche Abfrage, jede verfeinerte Abfrage und die Begründung bei jedem Schritt.

DSPy benötigt:

  • DSPY_MODELopenai/gpt-4o-mini funktioniert gut

  • OPENAI_API_KEY

Reranking (derzeit defekt)

Wenn es funktioniert, ersetzt Reranking den Vektor-Cosinus-Score durch den Score des Rerank-Modells (in meiner Erfahrung typischerweise 10–30 % bessere Relevanz). RAGFlow hat derzeit einen bekannten Fehler, bei dem use_rerank=true folgendes erzeugt:

UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol

Lassen Sie also use_rerank=false, bis das Upstream-Problem behoben ist. Der Standard-Vektorabruf funktioniert normal.

Wie die Datensatzsuche funktioniert

  • Namensabgleich ohne Berücksichtigung der Groß-/Kleinschreibung.

  • Fuzzy-Match für Teilnamen.

  • Datensätze werden für die Namenssuche zwischengespeichert; Cache-Misses lösen eine Aktualisierung aus.

  • Wenn die Suche fehlschlägt, enthält der Fehler die verfügbaren Datensatznamen, damit Sie wissen, was tatsächlich vorhanden war.

Dokumentenabgleich

Wenn Sie document_name übergeben:

  • Exakte Übereinstimmung gewinnt, dann "beginnt mit", dann "enthält", dann partiell.

  • Bei Gleichstand gewinnt das zuletzt aktualisierte Dokument.

  • Namen, die 2024, 2023, latest, current oder new enthalten, erhalten einen kleinen Score-Bonus.

  • Alle Übereinstimmungen werden in den Antwort-Metadaten zurückgegeben, sodass Sie mit einem spezifischeren Namen erneut abfragen können.

Fehlerbehandlung

Angemessene Fehlermeldungen für: API-Fehler, fehlende Datensätze, nicht erreichbares RAGFlow, unterbrochene Sitzungen, ungültige Eingaben und Konfigurationsprobleme. Sensible Werte werden in den Protokollen geschwärzt.

Umgebungsvariablen

  • RAGFLOW_BASE_URL — überschreibt die Konfigurationsdatei. Standard im Code: http://192.168.122.93:9380 (meine lokale Instanz).

  • RAGFLOW_API_KEY — erforderlich.

Entwicklung

Server direkt ausführen:

uv run ragflow-claude-mcp

Er lauscht auf stdio, wie MCP-Server das tun.

Entwicklungs-Abhängigkeiten:

uv install --extra dev

Das installiert pytest + die asyncio/mock/cov-Plugins.

Tests:

uv run pytest
uv run pytest --cov=src --cov-report=html --cov-report=term
uv run pytest tests/test_server.py
uv run pytest -v

Die Abdeckung liegt bei etwa 44 % mit 22/23 bestandenen Tests (einer wird aufgrund eines intermittierenden CI-Fehlers übersprungen). Die Tests decken Server-Initialisierung, RAGFlow API-Integration, DSPy-Vertiefung, OpenAI/OpenRouter-Konfigurationszweige und das Laden der Konfiguration ab.

Implementierungshinweise

Die Retrieval-API ist die einzige RAGFlow-Oberfläche, auf die sich der Server tatsächlich verlässt. Keine Abhängigkeiten von Assistent/Chat, keine serverseitige Prompt-Konfiguration — nur Chunks zurück. Einfacher zu durchschauen, einfacher zu debuggen.

Fehlerbehebung

  • "Dataset not found": Führen Sie ragflow_list_datasets aus, um zu sehen, was tatsächlich vorhanden ist.

  • Verbindungsfehler: Überprüfen Sie RAGFLOW_BASE_URL und RAGFLOW_API_KEY.

  • Server startet nicht: Ist uv install tatsächlich abgeschlossen?

  • Rohe Chunks benötigt: Das ist ragflow_retrieval_by_name / ragflow_retrieval.

  • Feststeckende Sitzung: ragflow_list_sessions dann ragflow_reset_session.

  • Cloudflare 403s: Bestätigen Sie, dass CF_ACCESS_CLIENT_ID / CF_ACCESS_CLIENT_SECRET mit einem aktiven Service-Token in der Zero Trust-App übereinstimmen.

Bekannte Probleme

Rerank ist upstream defekt

use_rerank=true führt zu Fehlern mit UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol. Dies ist ein Defekt auf RAGFlow-Seite. Workaround: Lassen Sie es ausgeschaltet. Ich beobachte das RAGFlow-Repo auf einen Fix.

Mitwirken

Nur PRs — main ist geschützt. Commits müssen SSH-signiert sein.

  1. Forken.

  2. git checkout -b feature/your-thing.

  3. Ändern Sie etwas, schreiben Sie eine klare Commit-Nachricht.

  4. Pushen Sie auf Ihren Fork.

  5. Öffnen Sie einen PR gegen main.

PRs führen automatisch TruffleHog aus — fügen Sie keine Schlüssel, Token oder Geheimnisse hinzu. Siehe CONTRIBUTING.md für die längere Version.

Available Tools

8 tools
ragflow_get_chunksC

Get chunks with references from a specific document

ParametersJSON Schema
NameRequiredDescriptionDefault
dataset_idYesID of the dataset
document_idYesID of the document to get chunks from

TDQS

C2.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure, but it only states a simple data retrieval. It omits important traits like pagination, rate limits, authentication, or potential side effects, leaving the agent under-informed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no wasted words, but it is overly brief and lacks important details. Conciseness is not valuable at the expense of completeness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the absence of an output schema, the description should explain what 'chunks with references' means and the format of the return value. It does not, leaving the agent with insufficient context for a simple tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters. The description does not add meaning beyond what the schema provides, earning a baseline score of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and the resource ('chunks with references from a specific document'), effectively distinguishing it from sibling tools like listing datasets or retrieval. However, 'references' could be more explicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives such as retrieval tools. There is no mention of prerequisites, context, or situations where this tool is inappropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

ragflow_list_datasetsA

List all available datasets/knowledge bases in RAGFlow

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It states 'list all available' but omits details like pagination, ordering, or side effects. Adequate but minimal.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, front-loaded with action. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

While sufficient for a zero-parameter listing tool, the lack of output schema leaves the agent uninformed about the response structure, which could be improved.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist, and schema coverage is 100%. Baseline 4 applies as the description adds no parameter info, which is acceptable.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List'), the resource ('all available datasets/knowledge bases'), and distinguishes it from siblings which deal with chunks, documents, and sessions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

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 siblings. The description only states what it does, leaving the agent to infer usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

ragflow_list_documentsC

List documents in a specific dataset

ParametersJSON Schema
NameRequiredDescriptionDefault
dataset_idYesID of the dataset to list documents from

TDQS

C2.9/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It discloses no behavioral traits such as read-only nature, pagination, error handling, or side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise and front-loaded, stating the core purpose in a single phrase with no extraneous content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and no annotations, the description fails to cover return format, pagination, or error conditions, even for a simple list tool it feels incomplete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with a description for the single parameter. The tool description adds no additional meaning beyond what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'List', resource 'documents', and context 'in a specific dataset'. It distinguishes from siblings such as ragflow_list_datasets (lists datasets) and ragflow_get_chunks (gets chunks).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use or not use this tool versus alternatives. The description only states the basic action without any contextual hints or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

ragflow_list_documents_by_nameC

List documents in a dataset by dataset name

ParametersJSON Schema
NameRequiredDescriptionDefault
dataset_nameYesName of the dataset/knowledge base to list documents from

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description is the sole source for behavioral clues. It implies a read operation but does not disclose details such as pagination, authentication requirements, rate limits, or what the response looks like. Minimal transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, front-loaded with key action and resource. Efficient but could benefit from additional context without being verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description should hint at what the returned list contains (e.g., document names, IDs, metadata). It only states what it does, not what the agent gets back. Missing return value details.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description only restates the parameter's purpose ('by dataset name') which is already described in the schema. Adds no extra meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the action (List), resource (documents), and filter (by dataset name). It is specific and suggests the tool's scope, but does not explicitly differentiate from the sibling tool 'ragflow_list_documents' which likely lists documents without a dataset name filter.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus the sibling 'ragflow_list_documents', which might list all documents or use different criteria. The description does not mention alternatives or conditions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

ragflow_list_sessionsB

List active chat sessions for all datasets

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden. It only says 'List active chat sessions' but does not explain what 'active' means, any side effects, or limitations. Minimal behavioral disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, direct sentence with no wasted words. It is front-loaded with the key action and resource.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite no parameters, the description lacks details on output format, pagination, or what constitutes an active session. Without output schema or annotations, the description is insufficient for complete understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema is empty (0 parameters), so schema coverage is 100%. The description adds meaning by specifying the resource and scope, which is beyond the empty schema. Baseline 3, but the context provided justifies a higher score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'List' and the resource 'active chat sessions' with scope 'for all datasets', distinguishing it from sibling tools like ragflow_list_datasets.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool over alternatives like ragflow_list_datasets or ragflow_reset_session. The description only states what it does without usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

ragflow_reset_sessionB

Reset/clear the chat session for a specific dataset

ParametersJSON Schema
NameRequiredDescriptionDefault
dataset_idYesID of the dataset to reset session for

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided. Description merely states the action without disclosing side effects (e.g., whether session history is deleted permanently, if it affects other datasets, or if confirmation is required).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, 10 words, no redundancy. Front-loaded with verb and resource. Efficiently communicates the core function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Adequate for a simple reset action with one parameter and no output schema, but lacks behavioral details that would help the agent understand consequences. Could mention that the session is cleared without confirmation or return value.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% for one parameter. Description mirrors the schema's description ('ID of the dataset to reset session for') without adding new meaning or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the action (reset/clear) and the resource (chat session for a specific dataset). It is distinct from sibling tools which are for listing or retrieval, not mutation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives. Does not mention prerequisites, conditions, 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.

ragflow_retrievalB

Retrieve document chunks directly from RAGFlow datasets using the retrieval API. Returns raw chunks with similarity scores.

ParametersJSON Schema
NameRequiredDescriptionDefault
pageNoPage number for pagination. Defaults to 1.
queryYesSearch query or question
top_kNoNumber of chunks for vector cosine computation. Defaults to 1024.
page_sizeNoNumber of chunks per page. Defaults to 10.
use_rerankNoWhether to enable reranking for better result quality. Default: false (uses vector similarity only).
dataset_idsYesList of IDs of the datasets/knowledge bases to search
document_nameNoOptional document name to filter results to specific document
deepening_levelNoLevel of DSPy query refinement (0-3). 0=none, 1=basic refinement, 2=gap analysis, 3=full optimization. Default: 0
similarity_thresholdNoMinimum similarity score for chunks (0.0 to 1.0). Defaults to 0.2.

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description must disclose behavioral traits like whether the tool is read-only, permission requirements, or pagination behavior. It only says 'Returns raw chunks' and does not address these aspects, leaving the agent with incomplete understanding of its side effects or constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is succinct: two sentences that convey the core function and output without extraneous words. It is front-loaded and efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 9 parameters and no output schema, the description should provide more context on how to use parameters like deepening_level or use_rerank, and what the returned chunks contain. It states 'raw chunks with similarity scores' but lacks detail on the structure of the response, which is necessary for an agent to process the output correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description does not add meaning beyond what the parameter descriptions already provide (e.g., page, top_k). It mentions 'similarity scores' but does not clarify how parameters like similarity_threshold relate to the output.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Retrieve' and the resource 'document chunks' from RAGFlow datasets, and specifies the output as 'raw chunks with similarity scores'. However, it does not explicitly differentiate from sibling tools like ragflow_retrieval_by_name, which likely performs a similar function.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives such as ragflow_get_chunks or ragflow_retrieval_by_name. It merely states what the tool does, without context on prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

ragflow_retrieval_by_nameB

Retrieve document chunks by dataset names using the retrieval API. Returns raw chunks with similarity scores.

ParametersJSON Schema
NameRequiredDescriptionDefault
pageNoPage number for pagination. Defaults to 1.
queryYesSearch query or question
top_kNoNumber of chunks for vector cosine computation. Defaults to 1024.
page_sizeNoNumber of chunks per page. Defaults to 10.
use_rerankNoWhether to enable reranking for better result quality. Default: false (uses vector similarity only).
dataset_namesYesList of names of the datasets/knowledge bases to search (e.g., ['BASF', 'Legal'])
document_nameNoOptional document name to filter results to specific document
deepening_levelNoLevel of DSPy query refinement (0-3). 0=none, 1=basic refinement, 2=gap analysis, 3=full optimization. Default: 0
similarity_thresholdNoMinimum similarity score for chunks (0.0 to 1.0). Defaults to 0.2.

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It mentions return type (raw chunks with similarity scores) but lacks information on side effects, permissions, rate limits, or destructive potential. 'Retrieve' implies read-only but is not explicit.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, front-loading the purpose. It is efficient but could be slightly more structured without adding verbosity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 9 parameters and no output schema, the description is sparse. It omits details on pagination, reranking, deepening_level, and similarity_threshold behavior, leaving the agent to rely solely on the schema for context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds minimal meaning beyond the schema, only briefly noting retrieval by dataset names and return format. No parameter interaction hints are provided.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb (retrieve), resource (document chunks), and distinguishing parameter (by dataset names). It differentiates from siblings like ragflow_retrieval which likely uses different criteria.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

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 usage with dataset names but does not mention exclusions or compare to ragflow_retrieval or other search methods.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 8 tool updatesv0.1.0
    • First observedragflow_get_chunks
    • First observedragflow_list_datasets
    • First observedragflow_list_documents
    • First observedragflow_list_documents_by_name
    • First observedragflow_list_sessions
    • First observedragflow_reset_session
    • First observedragflow_retrieval
    • First observedragflow_retrieval_by_name

TDQS

B3.4/5.0

Scored across 8 tools

Disambiguation4/5

Most tools have distinct purposes, but ragflow_list_documents and ragflow_retrieval each have an alternative by-name variant, which could cause confusion if descriptions are not heeded. However, descriptions clarify the difference between ID-based and name-based operations, keeping overlap minimal.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern with snake_case and the 'ragflow_' prefix. Variations like '_by_name' are systematic and predictable, enhancing readability for agents.

Tool Count5/5

With 8 tools, the set is well-scoped for a knowledge base retrieval server. Each tool serves a clear function, and the count is neither too sparse nor overwhelming for the intended purpose.

Completeness4/5

The tool surface covers listing datasets, listing documents, retrieving chunks, and managing chat sessions. It lacks create/update/delete operations, but given the likely read-heavy focus of the server, these gaps are acceptable and do not impede the primary retrieval workflow.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    A
    quality
    D
    maintenance
    Integrates R2R (Retrieval-Augmented Generation) with Claude Desktop, enabling semantic search across knowledge bases and RAG-based question answering with support for vector, graph, web, and document search.
    2
    -
  • A
    license
    A
    quality
    F
    maintenance
    Connects Claude Desktop to a RAGBrain knowledge base to enable semantic search, document retrieval, and namespace management. It allows users to browse collections, discover documents by topic, and access full text content through natural language.
    5
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Provides semantic search capabilities by connecting Claude Desktop to a Cloudflare Workers backend powered by Vectorize. It enables natural language querying of knowledge bases using vector similarity and edge-based embedding generation.
    2
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables semantic retrieval and knowledge base management through the RAGFlow API, including dataset, document, chunk, chat, and graph operations.
    5
    MIT