MCP RAG
MCP-RAG
✨100% AI 작성
AI 클라이언트를 위한 서비스 우선 RAG 서비스로, 현재 FastAPI HTTP 서비스와 Streamable HTTP MCP 엔드포인트를 중심으로 제공됩니다.
현재 코드는 통합 백엔드 셸을 제공합니다:
FastAPI HTTP 서비스
Streamable HTTP MCP
공유 런타임, 설정 핫 리로드, 인증, 속도 제한, 할당량, 관측 가능성
지식 베이스 레지스트리 기반 검색 및 문서 관리
현재 기능
문서 가져오기: 텍스트 직접 추가 및
txt,md,pdf,docx업로드 지원검색: 벡터 검색 + 키워드 검색 결합
질의응답:
/search,/chat, MCPrag_ask다중 지식 베이스: 단일 지식 베이스 및
kb_ids를 통한 다중 지식 베이스 통합 검색/대화 지원지식 베이스 범위:
public및agent_private테넌트 컨텍스트:
base_collection + user_id + agent_id런타임 관리: API 키, 메모리 속도 제한, 업로드/인덱싱 할당량, 요청 수준 검색 캐시
공급자 관리: 공급자 예산, 서킷 브레이커, 폴백
관측 가능성:
/health,/ready,/metrics프론트엔드: 내장 단일 페이지 관리 패널
/app
Related MCP server: FastGPT Knowledge Base MCP
아키텍처
주요 링크:
HTTP / MCP
-> app_factory.py
-> http_server.py / mcp_server.py
-> context.py
-> service_facade.py
-> services/
- runtime.py
- indexing_service.py
- retrieval_service.py
- chat_service.py
-> knowledge_bases.py
-> core/indexing/
-> retrieval/주요 파일:
src/mcp_rag/cli.py: CLI 진입점,serve및init제공src/mcp_rag/main.py: HTTP 서비스 시작 진입점src/mcp_rag/http_server.py: HTTP API, SPA 진입점, Streamable HTTP MCP 마운트src/mcp_rag/mcp_server.py: MCP 도구 정의 및rag_asksrc/mcp_rag/app_factory.py: 앱 컨텍스트, 런타임, 가드레일 통합 조립src/mcp_rag/knowledge_bases.py: 지식 베이스 레지스트리 및 기본 지식 베이스 해석src/mcp_rag/config.py: 설정 모델, JSON/SQLite 영속성, 핫 리로드
환경 요구 사항
Python
>= 3.13uv
설치
CLI 설치:
uv tool install mcp-rag설치 후 바로 실행:
mcp-rag serve저장소 내 개발:
uv sync로컬 임베딩이 필요한 경우:
uv sync --extra local-embeddings경계 사항:
uv tool install mcp-rag를 사용하는 사용자는 Node.js나pnpm이 필요하지 않습니다.pnpm은 프론트엔드 빌드 유지보수용이며, 서비스 런타임 의존성이 아닙니다.
시작 및 초기화
서비스 시작:
uv run mcp-rag serve데이터 디렉토리 초기화:
uv run mcp-rag init --data-dir ./data기본 포트는 8060이며, 서비스는 기본적으로 0.0.0.0:8060에서 수신 대기합니다.
주요 진입점:
관리 패널:
http://127.0.0.1:8060/appAPI 문서:
http://127.0.0.1:8060/docsMCP 엔드포인트:
http://127.0.0.1:8060/mcp
호환 진입점:
/는/app으로 리다이렉트됩니다./doc는/docs로 리다이렉트됩니다./documents-page는/app/documents로 리다이렉트됩니다./config-page는/app/config로 리다이렉트됩니다.
최초 시작 동작:
./data/config.json이 없으면 설정을 읽을 때 기본값을 먼저 사용합니다.서비스 시작 시
ensure_config_file()이 호출되어 기본 설정이 디스크에 기록됩니다.데이터 디렉토리 내의
./data/chroma및 관련 SQLite 파일은 필요에 따라 생성됩니다.
프론트엔드 및 정적 리소스
배포 패키지는 src/mcp_rag/static/을 wheel / sdist에 함께 포함합니다.
즉:
사용자가
uv tool install mcp-rag를 설치하면 바로/app에 접속할 수 있습니다.별도의 프론트엔드 빌드나 Node.js가 필요하지 않습니다.
프론트엔드 유지보수자는 릴리스 전에 최신 정적 리소스를 생성해야 합니다.
프론트엔드 소스 코드는 frontend/에 있으며, 빌드 결과물은 src/mcp_rag/static/app으로 출력됩니다.
일반적인 프로세스:
cd frontend
pnpm install
pnpm build지식 베이스 모델
현재 프로젝트는 더 이상 단순 collection으로 데이터를 구성하지 않고, 지식 베이스 레지스트리를 중심으로 합니다.
지식 베이스 특징:
영속적 레지스트리는
knowledge_base_db_path가 가리키는 SQLite 파일에 저장됩니다.기본적으로 공용 지식 베이스가 존재하도록 보장합니다.
user_id + agent_id가 전달되면 해당되는 기본agent_private지식 베이스가 존재하도록 보장합니다.새 지식 베이스 생성 시
kb_<id>와 같은 안정적인 내부 컬렉션 이름이 할당됩니다.
인터페이스 계층은 이전 호출 방식과의 호환성을 위해 collection 매개변수를 유지합니다. 현재 실제 동작은 다음과 같습니다:
kb_id를 명시적으로 전달할 수 있습니다.기존
collection을 계속 전달할 수도 있습니다.서비스는 요청을 구체적인 지식 베이스와 실제 컬렉션 이름으로 해석합니다.
HTTP 인터페이스
시스템 인터페이스:
GET /healthGET /readyGET /metrics
설정 인터페이스:
GET /configPOST /configPOST /config/bulkPOST /config/resetPOST /config/reload
공급자 인터페이스:
GET /providers/{provider}/models
지식 베이스 인터페이스:
GET /collectionsGET /knowledge-basesPOST /knowledge-bases
문서 인터페이스:
POST /add-documentPOST /upload-filesGET /list-documentsDELETE /delete-documentGET /list-filesDELETE /delete-file
검색 및 질의응답:
GET /searchPOST /chat
MCP 디버깅 인터페이스:
GET /debug/mcp/toolsPOST /debug/mcp/call
참고 사항:
/search와/chat은kb_id를 지원합니다./search와/chat은 다중 지식 베이스 통합을 위한kb_ids도 지원합니다./upload-files는multipart/form-data를 사용합니다./delete-document와/delete-file은 요청 본문을 통해 삭제 매개변수를 전달합니다.
보안 정책이 활성화된 경우, API 키는 다음 방식으로 전달할 수 있습니다:
HTTP Header:
x-api-keyHeader:
Authorization: Bearer <token>쿼리 매개변수, JSON 본문 또는 폼의
api_key
MCP
현재 주요 형태는 Streamable HTTP MCP입니다:
{
"mcpServers": {
"rag": {
"url": "http://127.0.0.1:8060/mcp"
}
}
}구현된 MCP 도구:
rag_ask
rag_ask 주요 매개변수:
querymode:raw또는summarycollectionkb_idscopelimitthresholdtenantuser_id/agent_id_user_id/_agent_idapi_keyrequest_idtrace_id
예시:
{
"name": "rag_ask",
"arguments": {
"query": "FastAPI 是什么",
"kb_id": 1,
"mode": "summary",
"limit": 5
}
}설정
기본 설정 파일:
./data/config.json기본 지식 베이스 데이터베이스:
./data/knowledge_bases.sqlite3현재 설정의 중요한 변경 사항:
일반 실행 설정은
config.json에 저장됩니다.공급자 관련 설정은
config.json에 완전히 다시 쓰지 않고 SQLite에 영속화됩니다.
즉, 다음 필드들은 SQLite의 service_provider_settings에 저장됩니다:
embedding_providerembedding_fallback_providerprovider_configsllm_providerllm_fallback_providerllm_modelllm_base_urlllm_api_key
나머지 설정은 config.json에 유지됩니다. 예:
{
"http_port": 8060,
"chroma_persist_directory": "./data/chroma",
"knowledge_base_db_path": "./data/knowledge_bases.sqlite3",
"enable_llm_summary": false,
"security": {
"enabled": false,
"allow_anonymous": true,
"api_keys": [],
"tenant_api_keys": {}
},
"rate_limit": {
"requests_per_window": 120,
"window_seconds": 60,
"burst": 30
},
"quotas": {
"max_upload_files": 20,
"max_upload_bytes": 52428800,
"max_upload_file_bytes": 10485760,
"max_index_documents": 500,
"max_index_chunks": 2000,
"max_index_chars": 500000
},
"cache": {
"enabled": false,
"max_entries": 256,
"ttl_seconds": 300
},
"provider_budget": {
"enabled": true
}
}현재 내장 공급자 관련 기능:
임베딩 공급자 기본값은
zhipu입니다.LLM 공급자 기본값은
doubao입니다.내장 공급자 설정에는
doubao,zhipu,aliyun이 포함됩니다.qwen/dashscope는aliyun으로 정규화됩니다./providers/{provider}/models는 OpenAI 호환 모델 서비스에서 모델 목록을 가져오는 것을 지원합니다.로컬 임베딩은
m3e-small및e5-small을 지원합니다.LLM은 추가로
ollama를 지원합니다.
핫 리로드 및 런타임 새로고침
핫 리로드 동작:
/config,/config/bulk,/config/reset,/config/reload를 통해 수정되면 런타임이 즉시 새로고침됩니다.요청이 들어올 때
reload_if_changed()를 통해 디스크 설정 변경 여부를 감지합니다.공급자 설정이나 검색 설정이 변경되면 관련 런타임 의존성을 재구축하고 검색 캐시를 정리합니다.
Readiness 및 Metrics
/health는 상태 요약, 런타임 스냅샷 및config_revision을 반환합니다./ready는 부트스트랩이 완료되지 않았거나 주요 의존성이 준비되지 않은 경우503을 반환합니다./metrics는 작업/공급자별로 집계된 관측 지표를 반환합니다.
현재 readiness 스냅샷 포함 항목:
document_processorembedding_modelvector_storehybrid_servicellm_modelretrieval_cacheprovider_budget
테스트
전체 테스트 실행:
uv run python -m unittest discover -s tests컴파일 검사:
uv run python -m compileall src현재 테스트 범위:
설정 기본값, 디스크 리로드 및 공급자 설정 마이그레이션
HTTP 셸 및 MCP 셸 동작
요청 컨텍스트 / 테넌트 해석
요청 수준 검색 캐시
공급자 예산 / 폴백
readiness / health / metrics
패키징 메타데이터 및 정적 리소스
라이선스
MIT
Available Tools
10 toolsask_ragA
向 RAG 知识库提问,并根据存储的信息返回答案。 使用场景:
询问特定主题或概念
请求解释或定义
从处理过的文档中获取信息
基于学习的文本或文档获取答案
参数: query: 要向知识库提出的问题或查询。
| Name | Required | Description | Default |
|---|---|---|---|
| query | 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 carries the full burden of behavioral disclosure. While it states the tool queries a RAG knowledge base and returns answers, it doesn't describe important behavioral aspects like: what types of answers are returned (structured/unstructured), whether there are rate limits, authentication requirements, response formats, or error conditions. For a query tool with no annotation coverage, this leaves significant gaps in understanding how the tool behaves.
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 well-structured with a clear purpose statement followed by usage scenarios and parameter documentation. It's appropriately sized for a single-parameter tool. The only minor inefficiency is the repetition of similar concepts in the usage scenarios (e.g., '询问特定主题或概念' and '请求解释或定义' could potentially be combined).
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 that there's an output schema (which handles return values), the description doesn't need to explain outputs. However, for a query tool with no annotations, the description should provide more behavioral context about how the tool operates, what it expects from the knowledge base, and potential limitations. The usage scenarios help, but more operational transparency would improve completeness.
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 description explicitly documents the single parameter: 'query: 要向知识库提出的问题或查询' (query: the question or query to ask the knowledge base). With 0% schema description coverage and only one parameter, this provides complete parameter semantics beyond what the bare schema offers. The description fully compensates for the lack of schema documentation.
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 tool's purpose: '向 RAG 知识库提问,并根据存储的信息返回答案' (Ask the RAG knowledge base questions and return answers based on stored information). This specifies the verb (ask/query) and resource (RAG knowledge base). However, it doesn't explicitly differentiate from its sibling 'ask_rag_filtered', which appears to be a similar querying tool with filtering capabilities.
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 provides four clear usage scenarios (asking about topics/concepts, requesting explanations/definitions, getting information from processed documents, obtaining answers based on learned text/documents). This gives good context about when to use the tool. However, it doesn't explicitly state when NOT to use it or mention alternatives like 'ask_rag_filtered' despite having that sibling tool available.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
ask_rag_filteredA
向 RAG 知识库提问,并使用特定过滤器聚焦搜索。 使用场景:
仅搜索 PDF 文档:file_type=".pdf"
查找包含表格的文档:min_tables=1
查找结构良好的文档:min_titles=5
搜索增强处理的文档:processing_method="unstructured_enhanced"
参数: query: 要向知识库提出的问题或查询。 file_type: 按文件类型过滤(例如 ".pdf", ".docx", ".txt")。 min_tables: 文档必须包含的最小表格数量。 min_titles: 文档必须包含的最小标题数量。 processing_method: 按处理方法过滤(例如 "unstructured_enhanced", "markitdown")。
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| file_type | No | ||
| min_tables | No | ||
| min_titles | No | ||
| processing_method | 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 the full burden. It describes the tool's filtering behavior well with specific examples, but doesn't mention other behavioral aspects like response format, error handling, rate limits, or authentication requirements. The description adds value by explaining filtering logic but lacks comprehensive 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.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured and appropriately sized. It starts with a clear purpose statement, provides usage scenarios with bullet points, then lists parameters with explanations. Every sentence earns its place, and there's no redundant information. The bilingual nature (Chinese with English examples) is efficient for the intended context.
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 complexity (5 parameters, filtering logic) and the presence of an output schema (which handles return values), the description is mostly complete. It explains the purpose, usage, and parameters thoroughly. The main gap is lack of behavioral context beyond filtering (e.g., performance characteristics, limitations), but the output schema reduces the need to describe return values.
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 fully compensates by providing detailed parameter explanations. Each parameter is clearly explained with examples: 'query: 要向知识库提出的问题或查询' (the question or query to ask the knowledge base), 'file_type: 按文件类型过滤(例如 ".pdf", ".docx", ".txt")' (filter by file type, e.g., ".pdf", ".docx", ".txt"), etc. The description adds significant meaning beyond the bare schema.
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 tool's purpose: '向 RAG 知识库提问,并使用特定过滤器聚焦搜索' (Ask the RAG knowledge base and use specific filters to focus the search). It specifies the verb ('提问' - ask/query) and resource ('RAG 知识库' - RAG knowledge base), and distinguishes it from the sibling 'ask_rag' by explicitly mentioning filtering capabilities.
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 provides explicit usage scenarios with concrete examples: '仅搜索 PDF 文档:file_type=".pdf"', '查找包含表格的文档:min_tables=1', etc. It clearly indicates when to use this tool (for filtered searches) versus the sibling 'ask_rag' (presumably for unfiltered queries), making the distinction clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
clear_embedding_cache_toolA
清除嵌入缓存以释放内存和磁盘空间。 使用场景:
在系统内存不足时释放内存
在更改嵌入模型后重置缓存
清除不再需要的旧缓存嵌入
排查与缓存相关的问题
返回: 有关缓存清理操作的确认消息。
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
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. It clearly states this is a destructive operation that clears cache to free resources, and mentions it returns a confirmation message. However, it doesn't specify potential side effects like performance impact during clearing or whether this requires special permissions.
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 efficiently structured with a clear purpose statement followed by specific usage scenarios in bullet points and a brief note about return values. Every sentence earns its place without redundancy.
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 this is a simple, parameterless tool with an output schema (confirmed by context signals), the description provides complete context: clear purpose, specific usage guidelines, behavioral information about the destructive nature, and mention of return confirmation. No additional information is needed.
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 tool has 0 parameters with 100% schema description coverage, so the baseline is 4. The description appropriately doesn't discuss parameters since none exist, focusing instead on usage scenarios and behavioral context.
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 specific action ('清除嵌入缓存' - clear embedding cache) and the purpose ('以释放内存和磁盘空间' - to free memory and disk space). It distinguishes this tool from sibling tools like 'get_embedding_cache_stats' (which reads cache stats) and 'optimize_vector_database' (which optimizes rather than clears).
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 provides explicit usage scenarios in a bulleted list: when system memory is low, after changing embedding models, to remove old/unneeded cache embeddings, and for troubleshooting cache-related issues. This gives clear guidance on when to use this tool versus alternatives like 'get_embedding_cache_stats' for inspection only.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_embedding_cache_statsA
获取有关嵌入缓存性能的详细统计信息。 使用场景:
检查缓存命中率以查看系统是否高效工作
监控缓存的内存使用情况
了解嵌入的重用频率
调试性能问题
返回: 有关嵌入缓存性能的详细统计信息。
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
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. It clearly indicates this is a read-only operation (获取/获取) and describes what kind of information will be returned. However, it doesn't mention potential limitations like whether this requires specific permissions, if there are rate limits, or how frequently the statistics are updated. The description adds useful context about the types of metrics available but doesn't fully cover behavioral aspects.
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 well-structured with a clear purpose statement followed by specific usage scenarios and a brief return statement. Each sentence earns its place by providing distinct value. It could be slightly more concise by combining the purpose and return statements, but overall it's efficiently organized.
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 that the tool has 0 parameters, an output schema exists, and the description provides clear purpose and usage guidance, this is reasonably complete. The description doesn't need to explain return values since an output schema exists, and it adequately covers when and why to use this tool. The main gap is the lack of behavioral details that would be helpful for a monitoring 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?
The tool has 0 parameters with 100% schema description coverage, so the baseline would be 3. However, the description explicitly states '使用场景' (usage scenarios) that help the agent understand when to invoke this parameterless tool, adding meaningful context beyond the empty schema. This elevates the score above baseline.
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 tool's purpose as '获取有关嵌入缓存性能的详细统计信息' (get detailed statistics about embedding cache performance), which is a specific verb+resource combination. It distinguishes itself from siblings like 'get_knowledge_base_stats' and 'get_vector_database_stats' by focusing specifically on cache performance. However, it doesn't explicitly contrast with 'clear_embedding_cache_tool' beyond the obvious read vs. write difference.
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 provides explicit usage scenarios in a bulleted list: checking cache hit rates, monitoring memory usage, understanding reuse frequency, and debugging performance issues. These give clear guidance on when to use this tool versus alternatives like 'get_vector_database_stats' for broader system monitoring or 'clear_embedding_cache_tool' for cache management.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_knowledge_base_statsA
获取有关知识库的综合统计信息,包括文档类型、处理方法和结构信息。 使用场景:
检查知识库中有多少文档
了解文件类型的分布
查看使用了哪些处理方法
分析存储文档的结构复杂性
返回: 有关知识库内容的详细统计信息。
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
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 the full burden. It discloses that the tool returns 'detailed statistical information' and implies read-only behavior by focusing on analysis. However, it lacks details on potential side effects (e.g., if it triggers background processing), performance characteristics (e.g., latency for large knowledge bases), or error conditions. The description adds some context but doesn't fully cover behavioral traits beyond basic functionality.
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 well-structured with a purpose statement, usage scenarios in bullet points, and an output note. Each sentence earns its place by clarifying different aspects (what it does, when to use it, what it returns). It could be slightly more concise by integrating the output note into the purpose, but overall it's efficient and front-loaded with key information.
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 low complexity (0 parameters) and the presence of an output schema, the description is reasonably complete. It covers purpose, usage, and output at a high level, which is sufficient for a stats-retrieval tool. However, without annotations, it could benefit from more behavioral details (e.g., idempotency, rate limits), but the output schema likely handles return values, reducing the need for extensive description.
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 input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description correctly omits parameter details, focusing instead on usage and output. This aligns with the baseline of 4 for zero parameters, as it avoids redundancy and adds value through context rather than repeating schema information.
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 tool's purpose: '获取有关知识库的综合统计信息' (Get comprehensive statistics about the knowledge base). It specifies the types of statistics (document types, processing methods, structural information) and distinguishes itself from siblings like 'get_embedding_cache_stats' or 'get_vector_database_stats' by focusing on knowledge base content rather than caching or database metrics. However, it doesn't explicitly contrast with all siblings (e.g., 'ask_rag' is for querying, not statistics).
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 provides explicit usage scenarios in a bulleted list: checking document count, understanding file type distribution, viewing processing methods, and analyzing structural complexity. This clearly indicates when to use this tool—for statistical analysis of knowledge base content—and implicitly distinguishes it from alternatives like querying tools ('ask_rag') or maintenance tools ('reindex_vector_database'). No exclusions are stated, but the context is well-defined.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_vector_database_statsB
获取向量数据库的详细统计信息。 使用场景:
检查数据库状态
分析文档分布
诊断性能问题
规划优化
返回: 向量数据库的详细统计信息。
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
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 the full burden of behavioral disclosure. While it mentions the tool returns detailed statistics, it doesn't specify whether this is a read-only operation, what permissions might be required, potential rate limits, or how the statistics are formatted. For a tool with zero annotation coverage, this leaves significant behavioral gaps unaddressed.
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 well-structured with clear sections: purpose statement, usage scenarios, and return information. It's appropriately sized for a zero-parameter tool. The only minor issue is some redundancy between the purpose statement and return section, but overall it's efficient and front-loaded.
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 that the tool has an output schema (which handles return value documentation) and zero parameters, the description provides adequate context about purpose and usage scenarios. However, with no annotations and multiple sibling statistics tools, it could benefit from more differentiation and behavioral details to be fully 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 tool has 0 parameters with 100% schema description coverage (empty schema). The description doesn't need to explain any parameters, which is appropriate. It correctly focuses on what the tool does rather than parameter details, earning a high score for this dimension.
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 states the tool '获取向量数据库的详细统计信息' (gets detailed statistics of the vector database), which is a clear verb+resource combination. However, it doesn't differentiate from sibling tools like 'get_knowledge_base_stats' or 'get_embedding_cache_stats', leaving ambiguity about what distinguishes these statistics tools. The purpose is understandable but lacks sibling differentiation.
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 includes a '使用场景' (usage scenarios) section listing four specific contexts: checking database status, analyzing document distribution, diagnosing performance issues, and planning optimization. This provides clear guidance on when to use the tool. However, it doesn't explicitly state when NOT to use it or mention alternatives among siblings, which prevents a perfect score.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
learn_documentA
使用高级非结构化处理技术(包含真正的语义分块)读取和处理文档文件,并将其添加到知识库。 当您想通过智能处理文档文件来训练人工智能时,可以使用此功能。
支持的文件类型:PDF、DOCX、PPTX、XLSX、TXT、HTML、CSV、JSON、XML、ODT、ODP、ODS、RTF、 图像(PNG、JPG、TIFF、带 OCR 的 BMP)、电子邮件(EML、MSG)以及超过 25 种格式。
高级功能:
基于文档结构(标题、章节、列表)的 REAL 语义分块
智能文档结构保存(标题、列表、表格)
自动去噪(页眉、页脚、无关内容)
结构化元数据提取
适用于任何文档类型的强大回退系统
通过语义边界增强上下文保存
使用示例:
处理布局复杂的研究论文或文章
从包含表格和列表的报告或手册中添加内容
从带格式的电子表格导入数据
将演示文稿转换为可搜索的知识
使用 OCR 处理扫描文档
文档将通过 REAL 语义分块进行智能处理,并与增强的元数据一起存储。
将保存处理后文档的副本以供验证。
参数: file_path:要处理的文档文件的绝对路径或相对路径。
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Describes advanced processing steps: REAL semantic chunking, structure preservation, denoising, metadata extraction, fallback system, and saving a copy for verification. No annotations, so description carries full burden; it discloses key behaviors without contradicting any annotations.
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?
Description is somewhat long but well-structured with bullet points for supported types, features, and examples. Front-loaded with purpose; each section adds value without redundancy.
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?
Covers input, processing behavior, and outcome (stored in knowledge base with metadata, copy saved). Output schema exists, so return values not needed. Could mention idempotency but overall 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?
Single parameter file_path is explained as 'absolute or relative path' in the description, adding meaning beyond the schema's type string. Schema coverage is 0%, so description compensates well.
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?
Clearly states the tool reads and processes document files using advanced semantic chunking and adds to knowledge base. Distinguishes from sibling learn_text by specifying document file types and advanced features.
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?
Provides context on when to use (train AI on document files) and lists specific use cases. Does not explicitly exclude alternatives, but implied by focus on structured documents.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
learn_textA
向 RAG 知识库添加一段新文本以供将来参考。 使用场景:
添加事实、定义或解释
存储对话中的重要信息
保存研究发现或笔记
添加特定主题的上下文
参数: text: 要学习并存储在知识库中的文本内容。 source_name: 来源的描述性名称(例如 "user_notes", "research_paper", "conversation_summary")。
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| source_name | No | manual_input |
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 the full burden of behavioral disclosure. While it mentions the tool adds text to a knowledge base for future reference, it lacks critical details such as whether this operation is idempotent, what permissions are required, how the text is processed (e.g., embedding generation), or potential side effects like storage limits. This is a significant gap for a mutation tool with zero annotation coverage.
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 well-structured and front-loaded with the core purpose, followed by usage scenarios and parameter explanations. Every sentence adds value without redundancy, and it efficiently conveys necessary information in a compact format, making it easy for an agent 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 tool's complexity (mutation with 2 parameters), no annotations, and an output schema (which reduces the need to describe return values), the description is moderately complete. It covers purpose, usage, and parameters but lacks behavioral details like error handling or processing behavior. This is adequate but has clear gaps for a tool that modifies a knowledge base.
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 description adds meaningful context for both parameters beyond the input schema, which has 0% description coverage. It explains that 'text' is the content to learn and store, and 'source_name' is a descriptive name for the source with examples like 'user_notes' or 'research_paper'. This compensates well for the schema's lack of descriptions, though it could provide more detail on format constraints.
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 tool's purpose with specific verb ('添加'/'add') and resource ('RAG 知识库'/'RAG knowledge base'), and distinguishes it from siblings like ask_rag (querying) and clear_embedding_cache_tool (maintenance). It explicitly defines the action as adding new text for future reference, making the purpose 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 provides clear usage scenarios (e.g., adding facts, storing conversation info, saving research notes), which helps the agent understand when to use this tool. However, it does not explicitly state when NOT to use it or mention alternatives like ask_rag for retrieval, leaving room for improvement in distinguishing from sibling tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
optimize_vector_databaseA
优化向量数据库以提高搜索性能。 使用场景:
搜索速度变慢
添加了许多新文档
希望提高系统的整体性能
返回: 有关优化过程的信息。
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. While it mentions the tool optimizes for performance, it doesn't describe what the optimization actually does (reindexing? compression? cache management?), whether it requires downtime, how long it takes, what permissions are needed, or potential risks. The return statement is vague ('有关优化过程的信息' - information about the optimization process).
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 appropriately concise with a clear purpose statement followed by bulleted usage scenarios and a return statement. Each section earns its place, though the return statement could be more specific. The structure is logical and front-loaded with the main purpose.
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 that the tool has no parameters, an output schema exists, and annotations are absent, the description provides adequate basic information about purpose and usage scenarios. However, for a performance optimization tool that likely involves significant system changes, the description lacks important behavioral details about what the optimization entails, its impact, and safety considerations.
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 tool has 0 parameters with 100% schema description coverage, so the schema already fully documents the parameter situation. The description appropriately doesn't discuss parameters since none exist, earning a baseline 4 for not creating confusion about non-existent parameters.
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 tool's purpose as '优化向量数据库以提高搜索性能' (optimize vector database to improve search performance), which is a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'reindex_vector_database' or 'clear_embedding_cache_tool', which might serve related performance purposes.
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 provides three clear usage scenarios (slow search, many new documents added, wanting overall performance improvement), giving good context about when to use this tool. However, it doesn't specify when NOT to use it or mention alternatives among the sibling tools, which would be needed for a perfect score.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
reindex_vector_databaseA
使用优化配置重新索引向量数据库。 使用场景:
更改配置文件
搜索速度非常慢
希望针对特定数据库大小进行优化
存在持续的性能问题
参数: profile: 配置文件('small', 'medium', 'large', 'auto')。 'auto' 会自动检测最佳配置文件
返回: 有关重新索引过程的信息。
| Name | Required | Description | Default |
|---|---|---|---|
| profile | No | auto |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden. It indicates this is a reindexing operation (implies mutation/write), mentions performance optimization, and describes the 'auto' profile option. However, it doesn't disclose important behavioral aspects like whether this operation is destructive, requires downtime, has rate limits, or specific permission requirements for a database mutation 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?
The description is well-structured and appropriately sized. It begins with the core purpose, then provides usage scenarios in bullet points, followed by parameter details, and finally return information. Every section adds value with no redundant information. The Chinese text is concise and clear.
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 this is a database mutation tool with no annotations but with an output schema, the description does well. It explains the purpose, when to use it, parameter details, and mentions what the return contains. The output schema existence means the description doesn't need to detail return values. However, for a potentially destructive database operation, more behavioral context would be helpful.
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 description adds significant value beyond the schema. The input schema has 0% description coverage and only shows 'profile' as a string parameter. The description explains the parameter meaning ('配置文件' - configuration file), lists the four possible values ('small', 'medium', 'large', 'auto'), and explains what 'auto' does ('会自动检测最佳配置文件' - automatically detects the best configuration file). This fully compensates for the poor schema coverage.
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 tool's purpose: '使用优化配置重新索引向量数据库' (Reindex vector database using optimized configuration). It specifies the verb ('重新索引' - reindex) and resource ('向量数据库' - vector database). However, it doesn't explicitly differentiate from sibling tools like 'optimize_vector_database' - both seem related to vector database optimization.
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 provides excellent usage guidelines with a dedicated '使用场景' (Usage scenarios) section listing four specific situations when to use this tool: after configuration changes, when search is very slow, for database size optimization, and for persistent performance issues. This gives clear context for when this tool is appropriate.
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.
10 tool updates
v1.0.0- First observed
ask_rag - First observed
ask_rag_filtered - First observed
clear_embedding_cache_tool - First observed
get_embedding_cache_stats - First observed
get_knowledge_base_stats - First observed
get_vector_database_stats - First observed
learn_document - First observed
learn_text - First observed
optimize_vector_database - First observed
reindex_vector_database
TDQS
Scored across 10 tools
Each tool has a clear, distinct purpose: querying with/without filters, learning from files or text, and various statistics and maintenance operations. There is no functional overlap.
Tool names follow a consistent verb_noun pattern in snake_case, e.g., ask_rag, learn_document, get_knowledge_base_stats. The only deviation is 'clear_embedding_cache_tool' which includes an unnecessary 'tool' suffix.
With 10 tools covering querying, learning, statistics, and maintenance, the set is well-scoped for a RAG knowledge base server. No tool is redundant, and the number is appropriate for the domain.
The tools cover essential operations (add, query, manage, maintain), but lack delete or list/update for documents, which are common for a full lifecycle. The gaps are minor but notable.
Maintenance
Related MCP Connectors
Your private knowledge base: upload documents (.md, .txt, .docx, PDF, images), the platform indexes
Ingest, manage, and retrieve documents for RAG-powered AI applications
- KumbukaOAuthai.kumbuka
Governed, auditable knowledge your team curates for its AI assistants, self-hostable
Cloud or self-hosted knowledge for AI agents: hybrid search, reranking, GraphRAG, scoped MCP tools.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA document knowledge base system that enables users to upload PDFs and query them semantically through a web interface or via the Model Context Protocol, allowing integration with AI tools like Cursor.42-
- FlicenseNot gradedqualityDmaintenanceIntelligent knowledge base management tool that enables searching, browsing, and analyzing documents across multiple datasets with smart document analysis capabilities.24-
- AlicenseNot gradedqualityDmaintenanceA local knowledge base system based on ChromaDB that supports automatic chunking, vector storage, and efficient similarity retrieval of txt and pdf documents, with MCP protocol support allowing AI assistants to directly access knowledge management functions.MIT
- AlicenseNot gradedqualityDmaintenanceIndexes local and enterprise documents to provide a unified personal knowledge base for AI clients via the Model Context Protocol. It supports full-text search across various file formats and integrates with platforms like Feishu and WeChat Work.40MIT