laravel-simple-rag
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@laravel-simple-ragsearch my knowledge base for 'OAuth2 setup'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
laravel-simple-rag — Laravel Knowledge Provider
A self-hosted, single-user knowledge manager and MCP server built on Laravel MCP. Organise your snippets, questions, documents, and context in a web UI, then expose everything to AI assistants (Claude, etc.) via the Model Context Protocol. LLMs can read your knowledge base and write answers, scraped content, and summaries back into it.

Table of Contents
Related MCP server: memory-mcp
Features
Web Knowledge Manager — CRUD UI for entries (markdown), entry types, topics, and responses
MCP Server — exposes all content to LLMs via the Model Context Protocol over OAuth2
Live Markdown editor — write and preview markdown side-by-side in the browser
Response management — add and edit responses on separate pages or inline on the entry view
Meta key-value pairs — attach arbitrary metadata (e.g.
source_url,model_name) to entries and responses via an interactive key-value editor; LLMs can write metadata tooIcons for entry types and topics — assign one of 25 curated SVG icons to categorise your knowledge visually; icons appear in tables, entry badges, and the dashboard
Personal access tokens — create and manage long-lived API tokens in Settings → API Tokens for scripted or direct API access
Full-text search — entry search uses native full-text indexes on MySQL/MariaDB/PostgreSQL, with automatic LIKE fallback on SQLite
Invitation-based registration — controlled access via invite codes (optional, see Configuration)
Fully self-hosted — no external dependencies beyond your own server
Screenshots

Requirements
PHP 8.4+
Composer
Node.js & npm
SQLite, MySQL, or PostgreSQL
(Optional) Redis for queue/cache
Installation
# 1. Clone and install dependencies
git clone https://github.com/your-username/laravel-simple-rag.git
cd laravel-simple-rag
composer install
npm install
# 2. Environment setup
cp .env.example .env
php artisan key:generate
# 3. Configure your database in .env, then run migrations
php artisan migrate
# 4. Generate Passport OAuth2 keys (required for MCP auth)
php artisan passport:keys
# 5. Build frontend assets
npm run build
# 6. Start the development server
composer run devFor production, deploy with Laravel Forge or any standard Laravel hosting. Run
npm run buildinstead ofnpm run dev.
Configuration
The following custom environment variables control application behaviour. Set them in your .env file.
Variable | Default | Description |
|
| When |
|
| When |
|
| When |
First-Time Setup
1. Register your account
If APP_REQUIRE_INVITATION is false (default), open your app URL and register directly.
If invitations are required, first generate an invitation code on the server:
php artisan invitation:manage create --description="my account"Then open your app URL and register using the code.
2. List or deactivate invitation codes
php artisan invitation:manage list
php artisan invitation:manage deactivate --code=YOUR_CODE3. (Optional) Enable personal access tokens
If you want to use Settings → API Tokens to create long-lived tokens for scripted API access, create the Passport personal access client once:
php artisan passport:client --personal --no-interaction4. Set up your entry types
After logging in, go to Entry Types and create the types you want to use (e.g. question, snippet, document, context). Entry types are how you and the LLM categorize knowledge.
5. (Optional) Create topics
Go to Topics and create topic tags (e.g. Programming, Personal, Work) to organise entries across types.
Using the Web UI
Page | URL | Description |
Dashboard |
| Overview of your knowledge base |
Entries |
| Browse, filter, and search all entries |
New Entry |
| Create an entry with the Markdown editor |
Edit Entry |
| Edit content, meta, and manage responses |
New Response |
| Add a response with the Markdown editor |
Edit Response |
| Edit a response's content and meta |
Entry Types |
| Manage your entry type labels and icons |
Topics |
| Manage your topic tags and icons |
Settings |
| Profile, password, two-factor, API tokens |
Entries are the core unit — a title, Markdown content, a type, and optional topics. Responses are attached to entries and represent answers or generated content (written by you or by an LLM via MCP).
Both entries and responses support optional meta key-value pairs — arbitrary data attached to the record (e.g. source_url, model_name, confidence). The UI provides an interactive key-value editor; LLMs can supply meta via the MCP tools.
MCP Server
The RAG MCP server is available at /mcp/rag and is protected by Laravel Passport OAuth2.
Authentication (OAuth2)
The MCP server uses the standard OAuth2 flow. MCP clients (like Claude Desktop) handle authentication automatically once registered.
To verify your server is working, use the built-in inspector:
# Test the RAG server interactively
php artisan mcp:inspector ragThis launches the MCP Inspector and prints the client configuration to copy into your MCP client.
Registering with Claude Desktop
Add the following to your Claude Desktop MCP configuration (claude_desktop_config.json):
{
"mcpServers": {
"knowledge-base": {
"command": "npx",
"args": ["mcp-remote", "https://your-app-url.com/mcp/rag"]
}
}
}Replace https://your-app-url.com with your actual app URL. On first connection, Claude Desktop will open a browser window to complete the OAuth2 authorization — approve it to grant access.
Local development: Run
php artisan mcp:inspector ragfor the exact configuration to use. The localragserver is also registered for stdio-based testing.
HTTPS note: Many AI agents run on Node.js, which uses its own certificate store. Self-signed or local certificates may cause connection failures. For local testing, prefer plain
http://; usehttps://on production with a valid certificate.
Available Tools
All tools are scoped to your authenticated account.
Tool | Description |
| Search entries by keyword, type ID, topic ID, and/or |
| Fetch a single entry by ID. Pass |
| List all responses stored for a given entry ID. |
| List all your entry types with their IDs. Call this before creating entries. |
| List all your topics with their IDs. Call this before tagging entries. |
| Create a new entry. Requires |
| Store a response linked to an entry. Requires |
| Create a new topic tag. Requires |
| Attach an existing topic to an existing entry. Requires |
Available Prompts
Prompts are reusable instruction templates that guide the LLM through multi-step workflows using the tools above.
answer_question
Finds an unanswered question entry matching a query and stores an answer as a response.
Argument: query (required) — topic or keywords to search for
Workflow the LLM follows:
Calls
search_entrieswith the query keywordIdentifies entries that look like unanswered questions
Calls
get_entrywithwith_responses: trueto check for existing answersComposes a thorough Markdown answer
Calls
create_responseto store it
scrape_and_store
Fetches a URL, extracts the meaningful content, and stores it as a new entry.
Arguments:
url(required) — the page to fetchtype_id(optional) — entry type to use; if omitted, the LLM callslist_typesfirst
Workflow the LLM follows:
Fetches the URL content
Extracts title and body (skips navigation, ads, footers)
Formats as clean Markdown
Calls
create_entryto store it
Available Resources
Resource | URI Template | Description |
Entry |
| Returns the full Markdown content of an entry, including its type and topics. |
Key Use Cases
Q&A Flow
Create an entry with type
questionand your question as the title/content.Ask your AI assistant to use the
answer_questionprompt with a matching keyword.The LLM searches for the question, writes an answer, and stores it as a response.
Review and edit the response in the web UI.
Web Scraping Flow
Tell your AI assistant to use the
scrape_and_storeprompt with a URL.The LLM fetches the page, converts it to Markdown, and creates an entry.
The entry appears in your knowledge base immediately.
Knowledge Retrieval
Use
search_entrieswith keywords or type/topic filters to find relevant context.Use
get_entrywithwith_responses: trueto pull a complete entry with all its stored answers.Access any entry directly via the
entry://entries/{id}resource URI.
Development
# Run the development server (Vite + PHP server + queue worker)
composer run dev
# Run tests
php artisan test --compact
# Test the RAG MCP server interactively
php artisan mcp:inspector rag
# Format PHP code
vendor/bin/pint
# Run static analysis
vendor/bin/phpstan analyseUser management
php artisan user:manage list
php artisan user:manage promote --email=user@example.com
php artisan user:manage demote --email=user@example.comRun php artisan user:manage --help for full usage.
Invitation management
php artisan invitation:manage create [--description=] [--count=]
php artisan invitation:manage list
php artisan invitation:manage deactivate --code=CODEThis server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/schrojf/laravel-simple-rag'
If you have feedback or need assistance with the MCP directory API, please join our Discord server