# Koma Core MCP

This MCP server exposes protected RAG storage to agents: they can find public metadata and fetch full text only with the required access tier.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 13
- Author: swnotmetal
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/swnotmetal/Project-Koma/tree/HEAD/packages/koma-core-mcp
- Updated: 2026-10-13
- HTML: https://affpapa.org/en/nevibecode/mcp/koma-core-mcp

## What it does

Koma Core MCP exposes two tools to an agent. `search_docs` filters the public index by category or tag and returns fields such as `displayName`, `accessTier`, and `preview`. It does not reveal document text. `retrieve_doc` uses a `sourceId` from the search result to request the full document.

The server checks the requested `userTier` against each document tier. Supported values are `public`, `premium`, and `enterprise`. Three demo documents are loaded when the process starts, and the storage stays in memory between requests.

For production, the reference setup needs a real database behind `DatabaseAdapter` and a real master key. `KOMA_MASTER_KEY` can be supplied at launch; otherwise the server uses its demo key, so this setup is suited to testing the access boundary rather than persistent storage.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `KOMA_MASTER_KEY` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add koma-core-mcp -e KOMA_MASTER_KEY=<KOMA_MASTER_KEY> -- npx -y koma-core-mcp
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add koma-core-mcp --env KOMA_MASTER_KEY=<KOMA_MASTER_KEY> -- npx -y koma-core-mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "koma-core-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "koma-core-mcp"
            ],
            "env": {
                "KOMA_MASTER_KEY": "<KOMA_MASTER_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "koma-core-mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "koma-core-mcp"
            ],
            "env": {
                "KOMA_MASTER_KEY": "<KOMA_MASTER_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e KOMA_MASTER_KEY=<KOMA_MASTER_KEY> koma-core-mcp npx -y koma-core-mcp
```
Replace <…> with your own values

## When to use it
- search documents by category or tag
- return metadata without exposing content
- fetch a document from its `sourceId`
- check access against a user tier

## Example prompts
- Use `search_docs` to find documents tagged `api` and show their metadata.
- Call `retrieve_doc` for `api-reference` with the `premium` user tier.
- Check whether a `public` user can access `internal-architecture`.

## Similar
- [sap-ai-core](https://affpapa.org/en/nevibecode/skills/sap-ai-core.md) — skill · 723 installs
- [access](https://affpapa.org/en/nevibecode/skills/anthropics-access.md) — skill · 3867 installs
- [access-control-rbac](https://affpapa.org/en/nevibecode/skills/access-control-rbac.md) — skill · 757 installs
- [security-guidance](https://affpapa.org/en/nevibecode/skills/owasp-security-guidance.md) — skill · 401 installs
- [node9](https://affpapa.org/en/nevibecode/mcp/node9.md) — MCP server · ★ 219
- [Hashfile MCP](https://affpapa.org/en/nevibecode/mcp/hashfile-mcp.md) — MCP server · ★ 5

From the same set: [swnotmetal/project-koma](https://affpapa.org/en/nevibecode/by/swnotmetal/project-koma.md) — 2 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
