PremAgentic
On-premises document retrieval for agents, with folder-level access rules checked first
- Pricing
- Open source
- Platforms
- Windows, Linux, self-hosted
- Runs
- Locally
- Version
- 0.1.0
- Listing updated
- 1 day ago
About PremAgentic
PremAgentic is an open-source MCP server for knowledge and memory. It runs locally on your machine and is started by your AI client.
PremAgentic indexes Markdown, text, PDF, Word and Excel files on your own servers and returns cited passages to people and AI assistants. An administrator sets an ordered list of allow and deny entries per folder; the first entry that names the caller decides, and no entry means no. Those rules are checked on every search, before anything is retrieved, so an HR group can reach salary bands that an engineering group cannot.
It adds lifecycle gates too: superseded material is held back unless history is requested, a document declaring a machine author is held from agents until a person reviews it, and a document past its stale-after date is flagged for people and withheld from agents. Answers are passages with file, heading, page or sheet citations; it generates no prose, never writes to the source, and does not read text inside pictures or scanned pages.
The MCP server runs from an OCI container over stdio and connects to the PremAgentic API using PREM_API_URL and an agent token issued with prem tokens issue. By default embeddings are local with no outbound calls or API keys, but an assistant on a hosted model does receive the passages it retrieves, and a folder can be barred from such agents. It runs on Windows and Linux with PostgreSQL 14 or later, under AGPL 3.0.
Install
Run in a terminal
claude mcp add premagentic --env PREM_API_URL='<PREM_API_URL>' --env PREM_AGENT_TOKEN='<PREM_AGENT_TOKEN>' -- docker run -i --rm -e PREM_API_URL -e PREM_AGENT_TOKEN ghcr.io/premagentic/premagentic-mcp:0.1.0Add to claude_desktop_config.json
{
"mcpServers": {
"premagentic": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"PREM_API_URL",
"-e",
"PREM_AGENT_TOKEN",
"ghcr.io/premagentic/premagentic-mcp:0.1.0"
],
"env": {
"PREM_API_URL": "<PREM_API_URL>",
"PREM_AGENT_TOKEN": "<PREM_AGENT_TOKEN>"
}
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"premagentic": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"PREM_API_URL",
"-e",
"PREM_AGENT_TOKEN",
"ghcr.io/premagentic/premagentic-mcp:0.1.0"
],
"env": {
"PREM_API_URL": "<PREM_API_URL>",
"PREM_AGENT_TOKEN": "<PREM_AGENT_TOKEN>"
}
}
}
}Add to .vscode/mcp.json
{
"servers": {
"premagentic": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"PREM_API_URL",
"-e",
"PREM_AGENT_TOKEN",
"ghcr.io/premagentic/premagentic-mcp:0.1.0"
],
"env": {
"PREM_API_URL": "<PREM_API_URL>",
"PREM_AGENT_TOKEN": "<PREM_AGENT_TOKEN>"
}
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"premagentic": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"PREM_API_URL",
"-e",
"PREM_AGENT_TOKEN",
"ghcr.io/premagentic/premagentic-mcp:0.1.0"
],
"env": {
"PREM_API_URL": "<PREM_API_URL>",
"PREM_AGENT_TOKEN": "<PREM_AGENT_TOKEN>"
}
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"premagentic": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"PREM_API_URL",
"-e",
"PREM_AGENT_TOKEN",
"ghcr.io/premagentic/premagentic-mcp:0.1.0"
],
"env": {
"PREM_API_URL": "<PREM_API_URL>",
"PREM_AGENT_TOKEN": "<PREM_AGENT_TOKEN>"
}
}
}
}Configuration
PREM_API_URLThe PremAgentic API's address, such as https://prem.example.org:8443. Plain http:// only for localhost.RequiredPREM_AGENT_TOKENThe token of a registered agent, issued with 'prem tokens issue <agent>'. It begins with prem_agt_.RequiredSSL_CERT_FILEOnly for an API whose certificate prem setup signed itself: that certificate's path inside the container, mounted read-only.
What it does
- Folder-level access rules
- Ordered allow and deny entries decide who can read each folder.
- Cited passages only
- Returns passages with file and heading, page or sheet citations, without generated prose.
- Local embeddings
- The default provider makes no outbound call and needs no API key.
- Lifecycle gates
- Withholds superseded, unreviewed machine-authored and stale documents from agents.
- Model-location control
- A folder can be marked never to be served to agents running on hosted models.
- Audit trail
- Records where each agent's model runs on every audit row.
Good for
- Give an assistant access to internal documents without exposing restricted folders
- Return the current version of a policy rather than a superseded draft
- Keep clinical or legal files closed to staff who should not see them
- Run document search with no cloud service
Pricing
Open source
Open source under AGPL 3.0
Prices change. Check premagentic.com before you buy.
PremAgentic FAQ
Does it send my documents to the cloud?
Not with the default local embedding provider. An assistant on a hosted model does receive the passages each search returns.
Which file types does it read?
Markdown, text, PDF, Word (.docx) and Excel (.xlsx, .xlsb); the last three need allowed extensions.
Can agents write to my documents?
No. Agents read from it and never write.
What licence is it under?
GNU Affero General Public License 3.0.
Is PremAgentic free?
Yes. PremAgentic is open source, so you can use and self-host it for free.
How do I add PremAgentic to Claude Code?
Run this command in your terminal: claude mcp add premagentic --env PREM_API_URL='<PREM_API_URL>' --env PREM_AGENT_TOKEN='<PREM_AGENT_TOKEN>' -- docker run -i --rm -e PREM_API_URL -e PREM_AGENT_TOKEN ghcr.io/premagentic/premagentic-mcp:0.1.0
What are the best alternatives to PremAgentic?
The closest alternatives to PremAgentic are REA, Codebase Memory, XERJ, Claude Code Ultimate Guide and Nautilus Compass Memory.
Alternatives to PremAgentic

REA
MCP serverCLI and MCP server that lets coding agents reverse engineer apps and binaries
Runs locally- Open source
- 464K GitHub stars
- Developer tools

Codebase Memory
MCP serverLocal MCP server that builds a code knowledge graph for AI coding agents
Runs locally- Open source
- 48.7K GitHub stars
- Knowledge and memory

XERJ
MCP serverLocal search engine for AI agents with cited answers over your code and docs
Runs locally- Open source
- 19.2K GitHub stars
- Knowledge and memory

Claude Code Ultimate Guide
MCP serverMCP server for searching the Claude Code Ultimate Guide from any MCP client
Runs locally- Open source
- 6.5K GitHub stars
- AI models and LLM tooling

Nautilus Compass Memory
MCP serverLocal-first long-term memory layer for AI agents, served over MCP
Not checked yet- 5 tools
- Remote
- Open source
- 1.3K GitHub stars
- Knowledge and memory
Agent Roast
MCP serverOffline review that flags agent changes which weaken tests, assertions or CI
Runs locally- Open source
- 4 Hacker News points
- Developer tools