Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions examples/codex-memory-plugin/.codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "openviking-memory",
"description": "Explicit OpenViking memory tools for Codex via MCP.",
"interface": {
"displayName": "OpenViking Memory",
"shortDescription": "OpenViking memory tools for Codex",
"longDescription": "Adds explicit OpenViking MCP tools for manual memory recall, store, forget, and health checks.",
"developerName": "OpenViking",
"category": "productivity",
"capabilities": [
"Memory recall",
"Manual memory storage",
"Manual memory deletion"
],
"websiteURL": "https://github.com/volcengine/OpenViking"
}
}
2 changes: 2 additions & 0 deletions examples/codex-memory-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
servers/
11 changes: 11 additions & 0 deletions examples/codex-memory-plugin/.mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"mcpServers": {
"openviking-memory": {
"command": "node",
"args": [
"servers/memory-server.js"
],
"cwd": "."
}
}
}
114 changes: 114 additions & 0 deletions examples/codex-memory-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# OpenViking Memory MCP Server for Codex

Small Codex MCP example for explicit OpenViking memory operations.

This example intentionally stays MCP-only:

- no lifecycle hooks
- no background capture worker
- no writes to `~/.codex`
- no checked-in build output

Codex gets four tools:

- `openviking_recall`
- `openviking_store`
- `openviking_forget`
- `openviking_health`

## Files

- `.codex-plugin/plugin.json`: plugin metadata
- `.mcp.json`: MCP server wiring for Codex
- `src/memory-server.ts`: MCP server source
- `package.json`: build and start scripts
- `tsconfig.json`: TypeScript build config

## Prerequisites

- Codex CLI
- OpenViking server
- Node.js 22+

Start OpenViking before using the MCP server:

```bash
openviking-server --config ~/.openviking/ov.conf
```

## Build

```bash
cd examples/codex-memory-plugin
npm install
npm run build
```

## Install in Codex

Use the built server:

```bash
codex mcp add openviking-memory -- \
node /ABS/PATH/TO/OpenViking/examples/codex-memory-plugin/servers/memory-server.js
```

Or copy `.mcp.json` into a Codex workspace and adjust the `cwd` path if needed.

## Config

The server reads OpenViking connection settings from `~/.openviking/ov.conf`.

Supported environment overrides:

- `OPENVIKING_CONFIG_FILE`: alternate `ov.conf` path
- `OPENVIKING_API_KEY`: API key override
- `OPENVIKING_ACCOUNT`: account identity, default from `ov.conf`
- `OPENVIKING_USER`: user identity, default from `ov.conf`
- `OPENVIKING_AGENT_ID`: agent identity, default `codex`
- `OPENVIKING_TIMEOUT_MS`: HTTP timeout, default `15000`
- `OPENVIKING_RECALL_LIMIT`: recall result limit, default `6`
- `OPENVIKING_SCORE_THRESHOLD`: recall threshold, default `0.01`

## Tools

### `openviking_recall`

Search OpenViking memory.

Parameters:

- `query`: search query
- `target_uri`: optional search scope, default `viking://user/memories`
- `limit`: optional max results
- `score_threshold`: optional minimum score

### `openviking_store`

Store a memory by creating a short OpenViking session, adding the text, and
committing the session. Memory creation is extraction-dependent; the tool
reports when OpenViking commits the session but extracts zero memory items.

Parameters:

- `text`: information to store
- `role`: optional message role, default `user`

### `openviking_forget`

Delete an exact memory URI. This example intentionally does not auto-delete by
query; use `openviking_recall` first, then pass the exact URI.

Parameters:

- `uri`: exact `viking://user/.../memories/...` or `viking://agent/.../memories/...` URI

### `openviking_health`

Check server reachability.

## Remove

```bash
codex mcp remove openviking-memory
```
19 changes: 19 additions & 0 deletions examples/codex-memory-plugin/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "codex-openviking-memory",
"version": "0.1.0",
"description": "OpenViking memory MCP server for Codex",
"type": "module",
"scripts": {
"build": "tsc",
"dev": "tsc --watch",
"start": "node ./servers/memory-server.js"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.12.1",
"zod": "^4.3.6"
},
"devDependencies": {
"@types/node": "^22.0.0",
"typescript": "^5.7.0"
}
}
Loading
Loading