Initial commit: RAG MCP Server with relationship graph

Features:
- Vector search with Pinecone + Vertex AI embeddings
- Document relationships (link, unlink, related, graph)
- Auto-link with LLM analysis
- Intelligent merge with Gemini

Modular structure:
- clients/: Pinecone, Vertex AI
- tools/: core, relations, stats
- utils/: validation, logging

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
kappa
2026-02-03 11:05:45 +09:00
commit 2858e0a344
17 changed files with 1450 additions and 0 deletions

43
server.py Normal file
View File

@@ -0,0 +1,43 @@
"""
RAG System MCP Server Entry Point
Refactored modular structure with:
- config.py: Environment variables and constants
- clients/: Pinecone and Vertex AI clients
- tools/: MCP tool implementations
- utils/: Validation and logging
"""
from fastmcp import FastMCP
from config import FASTMCP_HOST, FASTMCP_PORT
from utils import setup_logging
from tools import (
rag_save,
rag_retrieve,
rag_update,
rag_delete,
rag_link,
rag_unlink,
rag_related,
rag_graph,
rag_stats
)
# Setup logging
setup_logging()
# Initialize FastMCP server
mcp = FastMCP("RAG")
# Register tools
mcp.tool()(rag_save)
mcp.tool()(rag_retrieve)
mcp.tool()(rag_update)
mcp.tool()(rag_delete)
mcp.tool()(rag_link)
mcp.tool()(rag_unlink)
mcp.tool()(rag_related)
mcp.tool()(rag_graph)
mcp.tool()(rag_stats)
if __name__ == "__main__":
mcp.run(transport="http", host=FASTMCP_HOST, port=FASTMCP_PORT)