npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@utarn/claude-code-index

v0.1.13

Published

Semantic code search MCP server for AI coding assistants

Readme

Claude Code Index

เพิ่มระบบ Semantic Search ให้ Claude Code ค้นหาโค้ดจากทั้ง codebase ด้วยคำถามภาษาธรรมชาติ

สิ่งที่ต้องเตรียม

  1. Node.js เวอร์ชัน 20 ขึ้นไป (แต่ไม่เกิน 24)
  2. Qdrant — Vector Database สำหรับเก็บ index
  3. ModelHarbor API Key — สำหรับ Embedding Model

ติดตั้ง Qdrant

เลือกวิธีใดวิธีหนึ่ง:

วิธีที่ 1: ใช้ Docker (แนะนำ)

docker run -d \
  --name qdrant \
  -p 6333:6333 \
  -p 6334:6334 \
  -v qdrant-data:/qdrant/storage \
  qdrant/qdrant:latest

หรือใช้ Docker Compose จาก repo นี้:

docker compose up -d qdrant

วิธีที่ 2: ดาวน์โหลด Binary

ไปที่ Qdrant Releases ดาวน์โหลดเวอร์ชันล่าสุดสำหรับระบบปฏิบัติการของคุณ แล้วรัน:

./qdrant

Qdrant จะทำงานที่ http://localhost:6333 โดย default

ตั้งค่า ModelHarbor API Key

สมัครและรับ API Key จาก ModelHarbor แล้วนำมาใส่ใน config

ตั้งค่า MCP สำหรับ Claude Code

รันคำสั่งนี้ใน terminal:

claude mcp add claude-code-index \
  -e MODELHARBOR_API_KEY=your-modelharbor-api-key \
  -- npx @utarn/claude-code-index-mcp@latest

เปลี่ยน your-modelharbor-api-key เป็น API Key จริงของคุณ

ระบบจะ auto-detect:

  • Embedding Provider → ModelHarbor (เมื่อตั้งค่า MODELHARBOR_API_KEY)
  • Vector DB → Qdrant ที่ http://localhost:6333 (default)

การใช้งาน

1. เปิด Claude Code ในโปรเจกต์

cd your-project-directory
claude

2. Index codebase

พิมพ์ใน Claude Code:

Index this codebase

3. ตรวจสอบสถานะ indexing

Check the indexing status

4. ค้นหาโค้ด

Find functions that handle user authentication

หรือถามเป็นภาษาไทยก็ได้:

ค้นหาฟังก์ชันที่จัดการการล็อกอินของผู้ใช้

เท่านี้ก็ใช้งานได้แล้ว

ตัวแปร Environment เพิ่มเติม

| ตัวแปร | ค่า default | คำอธิบาย | |--------|------------|----------| | MODELHARBOR_API_KEY | — | API Key สำหรับ ModelHarbor embedding | | QDRANT_URL | http://localhost:6333 | URL ของ Qdrant server | | QDRANT_API_KEY | — | API Key ของ Qdrant (ถ้ามี) | | EMBEDDING_MODEL | BAAI/bge-m3 | ชื่อ embedding model | | VECTOR_DB_PROVIDER | Qdrant | เปลี่ยนเป็น Milvus ได้ถ้าต้องการใช้ Milvus |

ตัวอย่างการตั้งค่า Qdrant URL แบบกำหนดเอง

claude mcp add claude-code-index \
  -e MODELHARBOR_API_KEY=your-modelharbor-api-key \
  -e QDRANT_URL=http://your-qdrant-host:6333 \
  -- npx @utarn/claude-code-index-mcp@latest

MCP Tools ที่ใช้ได้

| Tool | คำอธิบาย | |------|----------| | index_codebase | Index codebase directory | | search_code | ค้นหาโค้ดด้วยคำถามภาษาธรรมชาติ | | clear_index | ลบ index ของ codebase | | get_indexing_status | ตรวจสอบสถานะ indexing |

ใช้กับ AI Client อื่น ๆ

เพิ่มใน Claude Desktop config:

{
  "mcpServers": {
    "claude-code-index": {
      "command": "npx",
      "args": ["@utarn/claude-code-index-mcp@latest"],
      "env": {
        "MODELHARBOR_API_KEY": "your-modelharbor-api-key",
        "QDRANT_URL": "http://localhost:6333"
      }
    }
  }
}

เพิ่มใน ~/.cursor/mcp.json:

{
  "mcpServers": {
    "claude-code-index": {
      "command": "npx",
      "args": ["-y", "@utarn/claude-code-index-mcp@latest"],
      "env": {
        "MODELHARBOR_API_KEY": "your-modelharbor-api-key",
        "QDRANT_URL": "http://localhost:6333"
      }
    }
  }
}

เพิ่มใน ~/.gemini/settings.json:

{
  "mcpServers": {
    "claude-code-index": {
      "command": "npx",
      "args": ["@utarn/claude-code-index-mcp@latest"],
      "env": {
        "MODELHARBOR_API_KEY": "your-modelharbor-api-key",
        "QDRANT_URL": "http://localhost:6333"
      }
    }
  }
}

เพิ่มใน ~/.codex/config.toml:

[mcp_servers.claude-code-index]
command = "npx"
args = ["@utarn/claude-code-index-mcp@latest"]
env = { "MODELHARBOR_API_KEY" = "your-modelharbor-api-key", "QDRANT_URL" = "http://localhost:6333" }

ใช้กับ Embedding Provider อื่น

นอกจาก ModelHarbor ยังรองรับ provider อื่น ๆ:

| Provider | ตัวแปรที่ต้องตั้ง | Default Model | |----------|-------------------|---------------| | OpenAI | OPENAI_API_KEY | text-embedding-3-small | | VoyageAI | VOYAGEAI_API_KEY | voyage-code-3 | | Gemini | GEMINI_API_KEY | gemini-embedding-001 | | Ollama | ติดตั้ง Ollama ไว้ | nomic-embed-text | | DeepInfra | DEEPINFRA_API_KEY | BAAI/bge-m3 |

ตัวอย่างใช้ OpenAI:

claude mcp add claude-code-index \
  -e OPENAI_API_KEY=sk-your-openai-key \
  -- npx @utarn/claude-code-index-mcp@latest

การพัฒนาต่อ

ดูรายละเอียดที่ CONTRIBUTING.md

License

MIT License — ดูรายละระเอียดที่ LICENSE