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:
43
server.py
Normal file
43
server.py
Normal 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)
|
||||
Reference in New Issue
Block a user