Skip to content

Doc Tool: look up Unity docs and Unity package docs #1

Description

@hackerzhuli

Unity Documentation MCP – Rust Implementation Plan

External Dependencies

  • scraper – parse Unity HTML
  • ort – run all-MiniLM-L6-V2.onnx for embedding (weights file shipped alongside binary)
  • qdrant-client – local vector storage & retrieval
  • serde + serde_json – payload serialization
  • tokio – async runtime for qdrant-client & file I/O
  • walkdir – recursive scan of Unity documentation folders
  • regex – light clean-up of raw text

Implementation Steps (Rust-only)

  1. Discovery

    • locate active Unity installation → find installed docs, for packages, fond installed docs in package.
  2. Parsing

    • For each .html, use scraper CSS selectors to extract:
      • signature
      • summary
      • return & key parameters
    • Drop script/style tags via quick regex.
  3. Chunking

    • One chunk = one method / property / enum entry (≈ 50–250 tokens).
    • No further split unless >512 tokens (rare).
  4. Embedding

    • Load MiniLM-L6-V2.onnx via ort.
    • Encode each chunk → 384-d float vector.
  5. Indexing

    • Start local Qdrant (single binary next to executable).
    • Upsert (vector, JSON payload) into collection “unity_api”.
  6. MCP Server

    • tools/list – list resolve_unity_type & get_unity_docs.
    • tools/call – perform vector search & return top-k chunks.
    • All data & binary stay beside the Rust binary; no network required.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions