Skip to main content
Glama
williamRR

MCP Filesystem Server

by williamRR

RIG MCP 도구

AI 어시스턴트를 위한 지능형 코드 분석, 그래프 기반 아키텍처 통찰력 및 파일 작업을 제공하는 MCP(Model Context Protocol) 서버입니다.

개요

RIG MCP 도구는 세 가지 지능형 계층을 결합합니다:

  • 정적 분석 — SQLite에 저장된 AST 파싱(ts-morph, tree-sitter)을 통해 구축된 저장소 지능형 그래프(RIG)로, LLM 비용 없이 그래프 쿼리를 가능하게 합니다.

  • 의미론적 검색 — 로컬 모델(nomic-embed-text 또는 호환 모델)을 사용하는 임베딩 기반 심볼 검색입니다. 임베딩은 첫 실행 후 SQLite에 캐시됩니다. 전체 파일 대신 정확한 코드 스니펫을 반환하여 토큰 사용량을 최소화합니다.

  • LLM 기반 도구 — 코드에 대한 자연어 추론을 위해 구성 가능한 OpenAI 호환 API를 호출하는 도구 세트입니다.

Related MCP server: PT-MCP (Paul Test Man Context Protocol)

설치

npm 사용

npx rig-mcp-tools

소스에서 빌드

git clone <repository-url>
cd rig-mcp-tools
npm install
npm run build

Docker

docker build -t rig-mcp-tools .
docker run rig-mcp-tools

구성

MCP 클라이언트 (Claude Desktop, Cursor 등)

{
  "mcpServers": {
    "rig-tools": {
      "command": "node",
      "args": ["/path/to/dist/index.js"],
      "env": {
        "WORKSPACE_PATH": "/your/project",
        "GLM_API_URL": "http://localhost:1234/v1/chat/completions",
        "GLM_MODEL": "qwen2.5-coder-7b-instruct-mlx@8bit",
        "EMBEDDING_API_URL": "http://localhost:1234/v1/embeddings",
        "EMBEDDING_MODEL": "text-embedding-nomic-embed-text-v1.5"
      }
    }
  }
}

환경 변수

변수

기본값

설명

WORKSPACE_PATH

/workspace

루트 작업 공간 경로

GLM_API_URL

http://localhost:1234/v1/chat/completions

LLM API 엔드포인트 (OpenAI 호환)

GLM_MODEL

qwen2.5-coder-7b-instruct-mlx@8bit

LLM 기반 도구용 모델

EMBEDDING_API_URL

http://localhost:1234/v1/embeddings

임베딩 API 엔드포인트

EMBEDDING_MODEL

text-embedding-nomic-embed-text-v1.5

의미론적 검색용 모델

LLM 및 임베딩 도구는 선택 사항이며, 모든 정적 분석 도구는 API 없이도 작동합니다.

사용 가능한 도구

RIG — 그래프 분석

이 도구들은 AST 파싱을 통해 저장소를 SQLite 그래프로 인덱싱하며, LLM 호출 없이 쿼리합니다.

get_smart_context

그래프 중심성 및 키워드 점수를 사용하여 쿼리에 가장 관련성이 높은 파일과 심볼을 검색합니다.

{ "rootPath": "/project", "text": "authentication flow" }

get_architectural_metrics

저장소 아키텍처에 대한 요약: 그래프 중심성에 따라 순위가 매겨진 핵심 허브, 진입점 및 안정적인 기반.

{ "rootPath": "/project" }

graph_analyzer

핫스팟 감지 및 리팩토링 권장 사항을 포함한 컴포넌트 수준의 복잡도 분석.

{ "rootPath": "/project" }

generate_call_graph

컴포넌트, 파일 또는 심볼 간의 호출 그래프나 의존성 다이어그램을 생성합니다.

{
  "rootPath": "/project",
  "level": "component",
  "format": "mermaid",
  "maxDepth": 5
}

level: "component" | "file" | "symbol"
format: "mermaid" | "dot" | "json"

generate_diagram

RIG에서 C4 아키텍처 다이어그램, 시퀀스 다이어그램, 호출 그래프 또는 의존성 시각화를 생성합니다.

{
  "rootPath": "/project",
  "type": "c4-container",
  "format": "mermaid",
  "focus": "auth",
  "maxDepth": 3,
  "style": "default"
}

type: "c4-context" | "c4-container" | "c4-component" | "sequence" | "call-graph" | "dependency-graph"
format: "mermaid" | "plantuml" | "dot"
style: "default" | "compact" | "detailed"

extract_method

RIG 심볼 좌표를 사용하여 소스 파일에서 함수나 클래스를 대상 파일로 정밀하게 추출합니다.

{
  "rootPath": "/project",
  "sourceFile": "src/utils/helpers.ts",
  "symbolName": "formatDate",
  "targetFile": "src/utils/date.ts"
}

파일 작업

순수 파일시스템 도구로, 그래프나 LLM이 필요하지 않습니다.

read_files

한 번의 호출로 최대 10개의 파일 내용을 읽습니다.

{ "files": ["src/index.ts", "src/config.ts"] }

write_code_unit

특정 내용으로 파일을 쓰거나 덮어씁니다. 필요에 따라 상위 디렉토리를 생성합니다.

{ "path": "src/utils/new-file.ts", "content": "export const foo = 1;" }

ls_tree

디렉토리 구조를 ASCII 트리로 나열합니다.

{ "path": "/project/src", "maxDepth": 3 }

search_code

코드베이스 전체에서 텍스트 또는 정규식 패턴을 재귀적으로 검색합니다.

{ "path": "/project/src", "pattern": "useEffect", "useRegex": false }

inspect_symbols

AST 분석(ts-morph)을 사용하여 파일에서 클래스 및 함수 시그니처를 추출합니다.

{ "file": "src/tools/index.ts" }

run_shell_task

허용된 쉘 명령을 실행합니다.

{ "command": "npm run build", "timeout": 60000 }

허용된 접두사: npm test, npm run, npm list, npx vitest, npx tsc, npx eslint, node --version, tsc, git status, git diff, git log, git show, git blame, ls, pwd, cat, wc.


품질 분석

정적 분석 도구로, LLM이 필요하지 않습니다.

detect_patterns

Babel AST 분석을 사용하여 안티 패턴, 코드 스멜 및 보안 문제를 감지합니다.

{ "sourceCode": "...", "filePath": "src/auth/login.ts" }

suggest_refactor

긴 함수, 깊은 중첩, 매직 넘버, 중복 코드, 누락된 타입 주석 등 리팩토링 기회를 감지합니다.

{
  "file_path": "src/services/user.ts",
  "max_suggestions": 10,
  "min_priority": 3,
  "include_diff": true
}

file_path 또는 code_snippet 중 하나는 반드시 제공되어야 합니다.

analyze_dependencies

임포트 분석을 통해 TypeScript 파일의 경량 의존성 그래프를 구축합니다. 노드, 순환 의존성 및 Graphviz용 DOT 형식을 반환합니다.

{ "rootPath": "/project/src" }

임베딩 기반

EMBEDDING_API_URLEMBEDDING_MODEL이 필요합니다. 임베딩은 심볼당 한 번 생성되어 .rig/index.db에 캐시되며, 이후 쿼리는 쿼리 문자열만 임베딩합니다.

search_semantic

벡터 유사성을 사용한 의미론적 심볼 검색입니다. 코드 스니펫과 함께 가장 관련성이 높은 함수와 클래스를 반환합니다. 전체 파일을 컨텍스트에 로드하지 않으려면 read_files 이전에 이 도구를 사용하세요. 임베딩은 심볼당 한 번 생성되어 .rig/index.db에 캐시됩니다.

{
  "repoPath": "/project",
  "query": "how is authentication handled",
  "maxResults": 5,
  "threshold": 0.3
}

LLM 기반

GLM_API_URLGLM_MODEL이 필요합니다.

analyze_logic

코드 조각에 대해 자연어로 질문합니다. 구성된 LLM을 사용하여 동작, 의도 또는 로직을 추론합니다.

{
  "filePath": "/project/src/auth/login.ts",
  "question": "What edge cases does this miss?"
}

파일 내용을 컨텍스트에 전달하지 않으려면 code 대신 filePath를 선호하세요.

smart_summarize

임포트, 익스포트, 목적 및 주요 의존성을 포함하여 코드 파일에 대한 지능형 요약을 생성합니다.

{ "filePath": "/project/src/services/user.ts", "maxLength": 200 }

generate_unit_tests

특정 함수나 클래스에 대한 vitest 단위 테스트를 생성합니다. RIG 인덱스를 사용하여 전체 파일이 아닌 메서드 본문만 추출하므로 토큰 효율적입니다. 해피 패스, 엣지 케이스 및 오류 케이스를 다룹니다.

{
  "repoPath": "/project",
  "symbolName": "createUser",
  "filePath": "src/services/user.ts"
}

filePath는 심볼이 여러 파일에 존재할 경우에만 필요합니다.

investigate_ts_fix

tsc --noEmit을 실행하고 LLM을 사용하여 각 TypeScript 오류에 대한 최소한의 수정 사항을 설명하고 제안합니다. 토큰 효율적: 전체 파일이 아닌 오류 라인 주변의 스니펫(±8 라인)만 전달합니다.

{
  "repoPath": "/project",
  "filePath": "src/services/user.ts",
  "maxErrors": 5
}

filePathmaxErrors는 선택 사항입니다. filePath를 생략하면 저장소 전체의 모든 오류를 조사합니다.


아키텍처

src/
├── cli/           # rig-indexer CLI (pre-index a repo into .rig/index.db)
├── graph/         # RIG graph engine (indexer, parsers, SQLite storage, types)
├── security/      # Path validation and safe extension checks
└── tools/         # MCP tool implementations (19 tools)

저장소 사전 인덱싱

대규모 코드베이스의 경우, RIG 도구를 사용하기 전에 사전 인덱싱하세요:

npx tsx src/cli/index.ts /path/to/project --db /path/to/project/.rig/index.db

옵션: --max-files <n>, --include-tests, --json

개발

npm run build   # Compile TypeScript
npm run dev     # Run in development mode
npm test        # Run test suite
npm run clean   # Clean build artifacts

라이선스

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

No tool schema history has been recorded yet.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Provides intelligent code context and analysis through semantic compression, AST parsing, and multi-language support. Offers 60-80% token reduction while enabling AI assistants to understand codebases through local analysis, OpenAI-enhanced insights, and GitHub repository integration.
    6
    10
    3
    MIT
  • F
    license
    B
    quality
    Not graded
    maintenance
    Provides comprehensive codebase analysis and semantic understanding through integrated knowledge graphs, enabling AI assistants to understand project structure, patterns, dependencies, and context through multiple analysis tools and format generators.
    9
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables LLMs to perform high-performance code search and analysis across multiple languages using symbol indexing, regex text search, and structural AST pattern matching. It also provides tools for technology stack detection and dependency analysis with persistent caching for optimized performance.
    7
    -
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI coding agents to query a pre-built semantic knowledge graph of code, reducing token usage and tool calls. Supports 16 tools for code exploration, analysis, and context building.
    14
    7
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/williamRR/mcp-filesystem-rig'

If you have feedback or need assistance with the MCP directory API, please join our Discord server