university_rules_mcp_server
University Rules RAG MCP Agent
RAG、Reranker、永続化インデックス、DeepSeek API、MCP をゼロから学ぶための Python プロジェクトです。《中山大学学部生学籍管理規定》を知識ベースとして、関連条項を検索し、出典付きの回答を生成します。同じ検索機能は MCP Tool として Agent から呼び出すこともできます。
このプロジェクトは技術学習用です。実際の学籍に関する手続きについては、大学の最新の公式規定および教務部門の回答を優先してください。
機能
ローカルの管理規定テキストを「第何条」単位で分割します。
BGE Embedding による意味検索。
キーワード + 意味による Hybrid Search。
BGE Reranker による候補条項の再ランキング。
ドキュメントベクトルと条項メタデータをローカルに保存し、Document Embedding の再生成を回避します。
DeepSeek を使用して、最終条項に基づき出典付きの回答を生成します。
search_university_rules(question)MCP Tool を公開します。
Related MCP server: byrdocs-search-mcp
アーキテクチャ
用户问题
↓
持久化向量索引
↓
Hybrid Search:Top 10 候选条款
↓
Reranker:Top 3 最相关条款
├─→ DeepSeek:生成带来源的自然语言回答
└─→ MCP Tool:将条款 JSON 返回给 Agentプロジェクト構成
knowledge_base/ # 学习用管理规定文本
rag_search.py # 基础关键词检索
semantic_search.py # Embedding 语义检索
hybrid_search.py # 混合检索
rerank_search.py # Reranker 精排
index_store.py # 本地索引读写和有效性判断
final_rag_chat.py # 完整 RAG + DeepSeek 问答
university_rules_mcp_server.py # RAG MCP Server
test_*.py # 单元测试インストール
Python 3.10 以降の使用を推奨します:
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txtEmbedding または Reranker を初めて実行するとき、モデルはローカルの Hugging Face キャッシュにダウンロードされます。次回以降はそのキャッシュが再利用されます。
実行
基本検索:
python rag_search.pyフル RAG 質疑応答版:
$env:DEEPSEEK_API_KEY="你的 DeepSeek API Key"
python final_rag_chat.pyfinal_rag_chat.py のフロー:
本地索引 → Hybrid Top 10 → Reranker Top 3 → DeepSeek 回答index/ は初回実行時に自動生成され、ドキュメントベクトルとメタデータを保存します。このディレクトリは知識ベースから再構築できるため、Git の監視対象外(無視)になっています。
MCP Server
Server を起動:
python university_rules_mcp_server.pyMCP Inspector で検証:
npx @modelcontextprotocol/inspector python university_rules_mcp_server.pyコア検索ツール:
search_university_rules(question)このツールは DeepSeek を呼び出さず、RAG 検索と Reranker による再ランキング後の 3 件の出典を返します。これらは MCP Client や Agent がそのまま利用できます。
テスト
python -m unittest discover -p "test_*.py" -vデータとセキュリティ
knowledge_base/内の管理規定は、このプロジェクトの学習資料として一緒に保存されます。API Key をコード、README、または
.envに書き込んだ状態でコミットしないでください。.envは Git で無視されています。index/はローカルで生成されたデータであり、Git で無視されています。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Search your knowledge bases from any AI assistant using hybrid RAG.
Search source collections your team vetted. Every passage cites its URL and fetch date.
Token-efficient search for coding agents over public and private documentation.
x402-gated web search gateway. Tools: search, search_enriched.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables hybrid search over policies using Reciprocal Rank Fusion and provides grounded, context-aware answers via a LangGraph agent with COSTAR prompting.4
- FlicenseNot gradedqualityBmaintenanceEnables AI clients to search BUPT byrdocs materials, past exam papers, and freshmen knowledge base via natural language.
- AlicenseNot gradedqualityBmaintenanceEnables hybrid document search (BM25 and dense) over a configurable corpus via MCP tools, returning passages and sources for AI agents to cite in answers.MIT
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to search Nokia product documentation with hybrid BM25+vector search and return section-precise deep-link citations.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/1551156271-coder/university-rules-rag-mcp-agent'
If you have feedback or need assistance with the MCP directory API, please join our Discord server