Are you the author? Sign in to claim
๐ง Personal knowledge MCP server with vector database for Opencode. Store and retrieve knowledge using semantic search,
A personal knowledge MCP server with vector database for the Opencode ecosystem
Store and retrieve knowledge using semantic search, powered by local embeddings. No external API keys required.
~/.local/share/opencode-personal-knowledge/Add to ~/.config/opencode/opencode.jsonc:
{
"mcp": {
"personal-knowledge": {
"type": "local",
"command": ["bunx", "opencode-personal-knowledge"],
"enabled": true
}
}
}
Restart Opencode โ the MCP tools will be available immediately.
git clone https://github.com/NocturnLabs/opencode-personal-knowledge.git
cd opencode-personal-knowledge
bun install
bun run mcp # Start MCP server
| Tool | Description |
|---|---|
store_knowledge | Store a new knowledge entry with optional tags |
search_knowledge | Semantic similarity search |
search_knowledge_text | Keyword-based text search |
get_knowledge | Retrieve entry by ID |
update_knowledge | Update an existing entry |
delete_knowledge | Delete an entry |
list_knowledge | List entries with filters |
get_knowledge_stats | Database statistics |
Log and search across entire OpenCode sessions.
| Tool | Description |
|---|---|
start_logging_session | Begin logging a session |
log_message | Log a user/agent message to the session |
search_session | Semantic search within a session |
search_all_sessions | Search across ALL logged sessions |
list_sessions | List all sessions |
get_session | Get session details and messages |
end_session | End session with optional summary |
User: "store a knowledge entry about Opencode Features"
Agent: Researches and stores entry:
โ
Stored knowledge entry #2: "Opencode Features"
๐ Indexed for semantic search
User: "@search_knowledge for opencode"
Agent: Returns semantic matches:
Found 1 similar entry:
### 1. Opencode Features (85% similar)
Opencode is an open source AI coding agent...
User: "Start logging this session, call it 'auth debugging'"
Agent: Starts session and logs all exchanges:
โ
Started session #1: "auth debugging"
User: "Search this session for JWT"
Agent: Returns semantic matches from the session:
Found 2 matches in session #1:
### 1. [user] (92% match)
The JWT token expires too fast...
### 2. [agent] (88% match)
The TTL is set to 60 instead of 3600...
By default, data is stored in:
~/.local/share/opencode-personal-knowledge/
โโโ knowledge.db # SQLite database
โโโ vectors/ # LanceDB vector store
Override with environment variable:
export OPENCODE_PK_DATA_DIR=/custom/path
Uses BGE-small-en-v1.5 via FastEmbed (auto-downloads on first use).
MIT ยฉ NocturnLabs
Made with ๐ค for the Opencode ecosystem
Google's universal MCP server supporting PostgreSQL, MySQL, MongoDB, Redis, and 10+ databases
Official MongoDB integration โ query collections, run aggregations, inspect schemas
Secure MCP server for MySQL database interaction, queries, and schema management
Run Claude Code as an MCP server so any agent can delegate coding tasks to it