# PremAgentic MCP server

> Enforces governed, on-premises knowledge retrieval for AI agents using local document indexing and strict access control rules.

- Repository: https://github.com/premagentic/premagentic
- Page: https://hostedmcp.org/servers/premagentic/premagentic
- Transport: stdio
- Stars: 1
- License: AGPL-3.0
- Latest version: 0.1.0

## Install

### Claude Code

```sh
claude mcp add --env 'PREM_AGENT_TOKEN=<YOUR_PREM_AGENT_TOKEN>' --env 'PREM_API_URL=<PREM_API_URL>' premagentic -- docker run -i --rm ghcr.io/premagentic/premagentic-mcp:0.1.0
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "premagentic": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/premagentic/premagentic-mcp:0.1.0"
      ],
      "env": {
        "PREM_AGENT_TOKEN": "<YOUR_PREM_AGENT_TOKEN>",
        "PREM_API_URL": "<PREM_API_URL>"
      }
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "premagentic": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/premagentic/premagentic-mcp:0.1.0"
      ],
      "env": {
        "PREM_AGENT_TOKEN": "<YOUR_PREM_AGENT_TOKEN>",
        "PREM_API_URL": "<PREM_API_URL>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"premagentic","type":"stdio","command":"docker","args":["run","-i","--rm","ghcr.io/premagentic/premagentic-mcp:0.1.0"],"env":{"PREM_AGENT_TOKEN":"<YOUR_PREM_AGENT_TOKEN>","PREM_API_URL":"<PREM_API_URL>"}}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "premagentic": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/premagentic/premagentic-mcp:0.1.0"
      ],
      "env": {
        "PREM_AGENT_TOKEN": "<YOUR_PREM_AGENT_TOKEN>",
        "PREM_API_URL": "<PREM_API_URL>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add premagentic --env 'PREM_AGENT_TOKEN=<YOUR_PREM_AGENT_TOKEN>' --env 'PREM_API_URL=<PREM_API_URL>' -- docker run -i --rm ghcr.io/premagentic/premagentic-mcp:0.1.0
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.premagentic]
command = "docker"
args = ["run", "-i", "--rm", "ghcr.io/premagentic/premagentic-mcp:0.1.0"]

[mcp_servers.premagentic.env]
PREM_AGENT_TOKEN = "<YOUR_PREM_AGENT_TOKEN>"
PREM_API_URL = "<PREM_API_URL>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'PREM_AGENT_TOKEN=<YOUR_PREM_AGENT_TOKEN>' -e 'PREM_API_URL=<PREM_API_URL>' premagentic docker -- run -i --rm ghcr.io/premagentic/premagentic-mcp:0.1.0
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "premagentic": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/premagentic/premagentic-mcp:0.1.0"
      ],
      "env": {
        "PREM_AGENT_TOKEN": "<YOUR_PREM_AGENT_TOKEN>",
        "PREM_API_URL": "<PREM_API_URL>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `PREM_AGENT_TOKEN` | yes | yes | The token of a registered agent, issued with 'prem tokens issue <agent>'. It begins with prem_agt_. |
| `PREM_API_URL` | yes | no | The PremAgentic API's address, such as https://prem.example.org:8443. Plain http:// only for localhost. |
| `SSL_CERT_FILE` | no | no | Only for an API whose certificate prem setup signed itself: that certificate's path inside the container, mounted read-only. |

## FAQ

### Does PremAgentic send my documents to the cloud?

No, with the default local embedding provider, it makes no outbound calls and sends no documents anywhere on its own.

### Can PremAgentic be used with AI agents?

Yes, agents can connect over MCP to access read-only tools for searching knowledge and retrieving document sections.

### Does it support image recognition?

No, the system does not recognize text in pictures or scanned pages.
