Skip to main content
Glama
Solvro

SOLVRO MCP - Knowledge Graph RAG System

Official
by Solvro

┌─────────────┐     ┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│  Frontend   │────▶│  ToPWR API  │────▶│  MCP Server │────▶│    Neo4j    │
│    :80      │     │    :8000    │     │    :8005    │     │    :7687    │
└─────────────┘     └─────────────┘     └─────────────┘     └─────────────┘
React + Nginx         FastAPI              FastMCP          Knowledge Graph
  • PWrChat UI - Reactチャットボット(セッションサイドバー、ダーク/ライトモード切り替え、テーマの永続化)

  • インテリジェントクエリルーティング - ガードレールシステムがクエリの関連性を判断

  • 自然言語からCypherへの変換 - 質問をグラフクエリに変換

  • ナレッジグラフRAG - Neo4jを使用した検索拡張生成

  • MCPプロトコル - 標準モデルコンテキストプロトコルインターフェース

  • 可観測性 - オプションのLangfuseトレーシング統合

  • Docker対応 - ワンコマンドデプロイ


クイックスタート

# Setup
just setup
cp .env.example .env  # Edit with your API keys

# Run with Docker
just up      # Start Neo4j + MCP Server + API
just logs    # View logs
just down    # Stop services

Related MCP server: Unreal Engine Knowledge Graph MCP Server

アーキテクチャ

システム概要

┌─────────────┐     ┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│  Frontend   │────▶│  ToPWR API  │────▶│  MCP Server │────▶│    Neo4j    │
│    :80      │     │    :8000    │     │    :8005    │     │    :7687    │
└─────────────┘     └─────────────┘     └─────────────┘     └─────────────┘
React + Nginx         FastAPI              FastMCP          Knowledge Graph

サービス

ポート

説明

frontend

80

PWrChat — Nginxで提供されるReactチャットボットUI

topwr-api

8000

ToPWRアプリ用FastAPIバックエンド

mcp-server

8005

RAGパイプラインを備えたMCPサーバー

neo4j

7474/7687

ナレッジグラフデータベース

RAGパイプライン

システムの中心は、ユーザーのクエリをインテリジェントに処理するLangGraphベースのRAGパイプラインです:

パイプラインフロー:

  1. ガードレール - 高速LLMがクエリがナレッジベースに関連しているかを判断

  2. Cypher生成 - 高精度LLMが自然言語をCypherクエリに変換

  3. 検索 - Neo4jナレッジグラフに対してクエリを実行

  4. 応答 - 構造化されたコンテキストデータを返却

データパイプライン

ドキュメントをナレッジグラフに取り込むための独立したETLパイプライン:

パイプラインステップ:

  1. ドキュメント読み込み - PDFおよびテキストドキュメントの取り込み

  2. テキスト抽出 - OCRおよびコンテンツ抽出

  3. LLM処理 - コンテンツからCypherクエリを生成

  4. グラフ構築 - クエリを実行してナレッジグラフを構築


設定

.env.example を .env にコピーして設定します:

########################################
# LLM / AI Provider Keys
########################################

# OpenAI API key (optional)
OPENAI_API_KEY=

# DeepSeek API key (optional)
DEEPSEEK_API_KEY=

# Google Generative AI / PaLM API key (optional)
GOOGLE_API_KEY=

# CLARIN LLM API key (optional, used by API & client)
CLARIN_API_KEY=


########################################
# Langfuse Observability
########################################

LANGFUSE_SECRET_KEY=
LANGFUSE_PUBLIC_KEY=
LANGFUSE_HOST=https://cloud.langfuse.com


########################################
# Neo4j Database
########################################

# URI used by data pipeline, MCP server and graph config
NEO4J_URI=bolt://localhost:7687
NEO4J_USER=neo4j
NEO4J_PASSWORD=


########################################
# Data Pipeline Runtime Controls
########################################

# Max parallel pages processed per batch
DATA_PIPELINE_MAX_CONCURRENCY=4

# Minutes after which a stuck in-progress hash can be reclaimed
DATA_PIPELINE_CLAIM_STALE_MINUTES=30


########################################
# MCP Server Networking
########################################

# Bind host for the MCP server process
MCP_BIND_HOST=0.0.0.0

# Host/port used by API and MCP client to reach the MCP server
MCP_HOST=127.0.0.1
MCP_PORT=8005

コマンド

# Docker Stack
just up          # Start all services (including frontend at :80)
just down        # Stop services
just logs        # View logs
just ps          # Service status
just nuke        # Remove everything

# Local Development
just mcp-server  # Run MCP server
just api         # Run FastAPI
just kg "query"  # Query knowledge graph

# Frontend
just frontend-install  # Install npm dependencies
just frontend-dev      # Start dev server at :3000 (requires running API)
just frontend-build    # Build for production

# Quality
just lint        # Format & lint
just test        # Run tests
just ci          # Full CI pipeline
uv run --with pytest python -m pytest tests/data_pipeline/test_pipeline_concurrency.py -q
                # Run pipeline concurrency/idempotency tests only

# Data Pipeline
just prefect-up  # Start Prefect
just pipeline    # Run ETL

プロジェクト構造

src/
├── mcp_server/      # MCP server + RAG pipeline
├── mcp_client/      # CLI client
├── topwr_api/       # FastAPI backend
├── config/          # Configuration
└── data_pipeline/   # Prefect ETL flows

frontend/
├── src/
│   ├── api/         # API client
│   ├── hooks/       # useUserId, useSessions, useChat, useTheme
│   ├── components/  # Sidebar, Chat, shared UI
│   └── types/       # TypeScript mirrors of backend models
└── package.json     # React + Vite + TailwindCSS

docker/
├── compose.stack.yml    # Main stack (Neo4j + MCP + API + Frontend)
├── compose.prefect.yml  # Data pipeline
├── Dockerfile.mcp       # MCP server image
├── Dockerfile.api       # FastAPI image
├── Dockerfile.frontend  # React + Nginx image
└── nginx.conf           # SPA fallback + API proxy

APIの使用方法

チャットエンドポイント

curl -X POST http://localhost:8000/api/chat \
  -H "Content-Type: application/json" \
  -d '{"user_id": "user1", "message": "Czym jest nagroda dziekana?"}'

レスポンス:

{
  "session_id": "abc123",
  "message": "Nagroda dziekana to wyróżnienie przyznawane...",
  "metadata": {
    "source": "mcp_knowledge_graph",
    "trace_id": "xyz789"
  }
}

セッション管理

# Get session history
curl http://localhost:8000/api/sessions/{session_id}/history

# List user sessions  
curl http://localhost:8000/api/users/{user_id}/sessions

技術スタック

技術

用途

React 18 + TypeScript

フロントエンドチャットUI

Vite + TailwindCSS v3

ビルドツールおよびスタイリング

Nginx

フロントエンド提供 + APIプロキシ

FastMCP

モデルコンテキストプロトコルサーバー

LangGraph

RAGステートマシン

LangChain

LLMオーケストレーション

Neo4j

ナレッジグラフデータベース

FastAPI

REST APIバックエンド

Langfuse

可観測性(オプション)

Prefect

データパイプラインオーケストレーション

Docker

コンテナ化


ライセンス

MIT © Solvro

Maintenance

ActivityActive
ResponsivenessWithin a week

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables storage and retrieval of knowledge in a graph database format, allowing users to create, update, search, and delete entities and relationships in a Neo4j-powered knowledge graph through natural language.
    5
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to interact with Neo4j graph databases through natural language, supporting Cypher queries, schema management, data manipulation, and graph algorithms.
    MIT