# Rag Setup Project

> Set up LightRAG persistent memory for a Cursor project with MCP configuration

- **Type:** Skill
- **Install:** `agentstack add skill-butchokoy25-lightrag-claude-skills-rag-setup-project`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [butchokoy25](https://agentstack.voostack.com/s/butchokoy25)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [butchokoy25](https://github.com/butchokoy25)
- **Source:** https://github.com/butchokoy25/lightrag-claude-skills/tree/main/skills/rag-setup-project

## Install

```sh
agentstack add skill-butchokoy25-lightrag-claude-skills-rag-setup-project
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# RAG Setup Project — Configure LightRAG for a Cursor Project

Set up a project-level LightRAG knowledge graph instance for the current Cursor project. Creates the MCP configuration so Claude Code can query and store project-specific memory.

## What this does

1. Creates `.cursor/mcp.json` in the project root with the LightRAG MCP server entry
2. Merges with existing MCP config if other servers are already configured
3. Optionally seeds the graph with project context (README, package.json, architecture docs)

## Setup steps

### 1. Create or merge MCP config

If `.cursor/mcp.json` does NOT exist:

```bash
node -e "
const fs = require('fs');
const config = {
  mcpServers: {
    'lightrag-projects': {
      command: 'npx',
      args: ['-y', 'lightrag-mcp@latest'],
      env: {
        LIGHTRAG_URL: 'http://YOUR_LIGHTRAG_HOST:YOUR_PROJECT_PORT',
        LIGHTRAG_API_KEY: process.env.LIGHTRAG_API_KEY || 'YOUR_API_KEY'
      }
    }
  }
};
fs.mkdirSync('.cursor', { recursive: true });
fs.writeFileSync('.cursor/mcp.json', JSON.stringify(config, null, 2));
console.log('Created .cursor/mcp.json');
"
```

If `.cursor/mcp.json` already exists, merge:

```bash
node -e "
const fs = require('fs');
const existing = JSON.parse(fs.readFileSync('.cursor/mcp.json', 'utf-8'));
existing.mcpServers = existing.mcpServers || {};
existing.mcpServers['lightrag-projects'] = {
  command: 'npx',
  args: ['-y', 'lightrag-mcp@latest'],
  env: {
    LIGHTRAG_URL: 'http://YOUR_LIGHTRAG_HOST:YOUR_PROJECT_PORT',
    LIGHTRAG_API_KEY: process.env.LIGHTRAG_API_KEY || 'YOUR_API_KEY'
  }
};
fs.writeFileSync('.cursor/mcp.json', JSON.stringify(existing, null, 2));
console.log('Merged lightrag-projects into existing .cursor/mcp.json');
"
```

### 2. Update .gitignore

Suggest adding `.cursor/` to `.gitignore` if not already present:

```bash
node -e "
const fs = require('fs');
const gitignore = fs.existsSync('.gitignore') ? fs.readFileSync('.gitignore', 'utf-8') : '';
if (!gitignore.includes('.cursor')) {
  fs.appendFileSync('.gitignore', '\n# Cursor IDE config\n.cursor/\n');
  console.log('Added .cursor/ to .gitignore');
} else {
  console.log('.cursor/ already in .gitignore');
}
"
```

### 3. Optionally seed the graph

If the user wants to seed the project graph with existing docs:

```bash
node -e "
const fs = require('fs');
const BASE = 'http://YOUR_LIGHTRAG_HOST:YOUR_PROJECT_PORT';
const API_KEY = process.env.LIGHTRAG_API_KEY || 'YOUR_API_KEY';

const files = ['README.md', 'package.json', 'ARCHITECTURE.md', 'CLAUDE.md']
  .filter(f => fs.existsSync(f));

(async () => {
  for (const file of files) {
    const text = fs.readFileSync(file, 'utf-8');
    await fetch(BASE + '/documents/text', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'X-API-Key': API_KEY
      },
      body: JSON.stringify({
        file_source: '[SEED] ' + file + ' — project bootstrap',
        text: text.slice(0, 10000)
      })
    });
    console.log('Seeded:', file);
  }
  console.log('Done. Seeded ' + files.length + ' files.');
})();
"
```

## After setup

- Restart Claude Code to pick up the new MCP config
- Use `/rag-project-query` to query project memory
- Use `/rag-project-remember` to store project-specific knowledge
- Use `/rag-project-sync` at end of session to persist learnings

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [butchokoy25](https://github.com/butchokoy25)
- **Source:** [butchokoy25/lightrag-claude-skills](https://github.com/butchokoy25/lightrag-claude-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** yes
- **Shell / process execution:** no
- **Environment & secrets:** yes
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-butchokoy25-lightrag-claude-skills-rag-setup-project
- Seller: https://agentstack.voostack.com/s/butchokoy25
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
