🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More β†’
Socket
Book a DemoSign in
Socket

@opencode-llm-wiki/mcp-server

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opencode-llm-wiki/mcp-server

MCP server for OpenCode LLM Wiki - Knowledge graph backend with vector search

latest
Source
npmnpm
Version
1.0.3
Version published
Weekly downloads
19
-90.36%
Maintainers
1
Weekly downloads
Β 
Created
Source

OpenCode LLM Wiki - MCP Server

npm version License: GPL v3

MCP (Model Context Protocol) server for OpenCode LLM Wiki - Knowledge graph backend with vector search.

πŸ“¦ Installation

From npm

npm install -g @opencode-llm-wiki/mcp-server

From source

git clone https://github.com/Moowningstar/opencode-llm-wiki.git
cd opencode-llm-wiki/src-mcp
npm install

πŸš€ Quick Start

Usage in Claude Desktop

Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "llm-wiki": {
      "command": "node",
      "args": [
        "/path/to/node_modules/@opencode-llm-wiki/mcp-server/src/server.js"
      ],
      "env": {
        "LLM_WIKI_API_URL": "http://localhost:19828"
      }
    }
  }
}

Usage in OpenCode

The MCP server is automatically configured via opencode.jsonc in the project root:

{
  "mcp": {
    "servers": {
      "llm-wiki": {
        "command": "node",
        "args": ["node_modules/@opencode-llm-wiki/mcp-server/src/server.js"],
        "env": {
          "LLM_WIKI_API_URL": "http://localhost:19828"
        }
      }
    }
  }
}

Start the Backend Server

Before using the MCP server, make sure the OpenCode LLM Wiki backend is running:

# Clone the main repository
git clone https://github.com/Moowningstar/opencode-llm-wiki.git
cd opencode-llm-wiki

# Build and run the Rust backend
cargo run --bin llm-wiki-server -- --port 19828

The MCP server communicates with the backend via HTTP API.

πŸ› οΈ Available MCP Tools

The server exposes 11 tools for interacting with your knowledge base:

Core Tools

ToolDescription
wiki_readRead a wiki page by path
wiki_listList all wiki pages
wiki_searchSearch pages by keyword
wiki_query_with_contextIntelligent context injection (keyword + vector search)
wiki_ingestIngest documents into the knowledge graph

Graph Tools

ToolDescription
wiki_get_graphGet knowledge graph data (nodes and edges)
wiki_graph_insightsAnalyze graph structure (isolated pages, bridges, statistics)
wiki_deep_researchMulti-hop reasoning with graph traversal and semantic search

Metadata Tools

ToolDescription
wiki_get_indexGet index.md (content catalog)
wiki_get_overviewGet overview.md (global summary with graph statistics)
wiki_get_purposeGet purpose.md (wiki goals and scope)

πŸ“– Tool Examples

Read a Page

{
  "tool": "wiki_read",
  "arguments": {
    "path": "entities/gpt-4.md"
  }
}

Search with Context

{
  "tool": "wiki_query_with_context",
  "arguments": {
    "query": "transformer architecture",
    "max_tokens": 4000
  }
}

Deep Research

{
  "tool": "wiki_deep_research",
  "arguments": {
    "query": "attention mechanisms in neural networks",
    "max_depth": 3,
    "max_results": 10
  }
}

Graph Insights

{
  "tool": "wiki_graph_insights",
  "arguments": {
    "analysis_type": "all"  // Options: "isolated", "bridges", "stats", "all"
  }
}

Ingest Documents

{
  "tool": "wiki_ingest",
  "arguments": {
    "path": "docs/architecture.md",
    "recursive": false
  }
}

πŸ—οΈ Architecture

The MCP server acts as a bridge between AI agents (like Claude Desktop) and the OpenCode LLM Wiki backend:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Claude Desktop β”‚
β”‚   (AI Agent)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚ MCP Protocol (stdio)
         ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   MCP Server    β”‚
β”‚  (Node.js)      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚ HTTP API
         ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Rust Backend   β”‚
β”‚  (Port 19828)   β”‚
β”‚                 β”‚
β”‚  β€’ RuVector DB  β”‚
β”‚  β€’ Graph Algos  β”‚
β”‚  β€’ Vector Searchβ”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Components

  • MCP Server (src/server.js): Implements Model Context Protocol, exposes 11 tools
  • Core API Client (src/lib/core-api-client.js): HTTP client for backend communication
  • Backend Server: Rust service providing vector search, graph algorithms, and storage

πŸ”§ Development

Run Server Manually

cd src-mcp
LLM_WIKI_API_URL=http://localhost:19828 node src/server.js

The server runs in stdio mode for MCP protocol communication.

Debug Mode

Set the DEBUG environment variable to see detailed logs:

DEBUG=llm-wiki:* LLM_WIKI_API_URL=http://localhost:19828 node src/server.js

Testing Tools

You can test individual tools using the MCP inspector or by sending JSON-RPC requests:

# Example: Test wiki_list tool
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"wiki_list","arguments":{}}}' | node src/server.js

πŸ“ Configuration

Environment Variables

  • LLM_WIKI_PROJECT - Project root path (default: ~/llm-wiki-projects/default)
  • LLM_WIKI_API_URL - API server URL (optional, for future HTTP mode)

Project Structure

my-wiki/
β”œβ”€β”€ .raw/              # Drop files here for auto-ingest
β”œβ”€β”€ .wiki/
β”‚   β”œβ”€β”€ entities/      # Named things (models, companies, people)
β”‚   β”œβ”€β”€ concepts/      # Ideas, techniques, phenomena
β”‚   β”œβ”€β”€ sources/       # Source summaries
β”‚   β”œβ”€β”€ queries/       # Research questions
β”‚   β”œβ”€β”€ index.md       # Content catalog (auto-maintained)
β”‚   └── overview.md    # Global summary (auto-generated)
β”œβ”€β”€ purpose.md         # Wiki goals and scope
β”œβ”€β”€ schema.md          # Structure rules
└── .llm-wiki/         # Internal data (database, cache)

πŸ”— Integration with OpenCode

How It Works

  • OpenCode starts β†’ Reads opencode.jsonc
  • MCP server launches β†’ node src-mcp/src/server.js
  • Server initializes β†’ Connects to wiki project at ${workspaceFolder}
  • Tools available β†’ OpenCode can call any of the 10 MCP tools
  • File watching β†’ Server monitors .raw/ and .wiki/ for changes

Usage in OpenCode

When you ask OpenCode a question about your knowledge base:

You: "What do I know about transformer architecture?"

OpenCode internally calls:
1. wiki_query_with_context(query="transformer architecture")
2. Receives relevant wiki pages with context
3. Answers your question with citations

🚨 Troubleshooting

Server Won't Start

# Check Node.js version (requires >= 18)
node --version

# Reinstall dependencies
cd src-mcp
rm -rf node_modules package-lock.json
npm install

No Wiki Pages Found

# Verify project structure
ls .wiki/

# Check if pages exist
ls .wiki/entities/
ls .wiki/concepts/

Vector Search Not Working

Vector search requires embeddings. If you see warnings about embedding generation:

  • Check if OpenAI API key is configured (for embedding generation)
  • Or use keyword-only search (works without embeddings)

πŸ“„ License

GPL-3.0

Keywords

llm

FAQs

Package last updated on 05 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts