MCP & AI Agents
Connect any AI agent to your vault — with persistent memory, reliability-ranked search, and auto-generated schema intelligence.
What is MCP?
MCP (Model Context Protocol) is an open standard that lets AI agents call tools and read resources from external servers. Wikori runs a built-in MCP server — so instead of copy-pasting content into your AI's chat, the agent can search and read your vault directly, on demand.
Beyond basic search, Wikori's MCP layer includes agent memory — agents save decisions, errors, and patterns into your vault as persistent entries. It also includes confidence-weighted search that ranks results by reliability, and an auto-generated vault schema that helps agents understand your knowledge base before asking a single question.
Starting the MCP Server
Click MCP in the left sidebar.
Enter a secret token in the MCP Secret field — this is like a password that your AI agents need to authenticate. Click Save Secret. Keep this private.
Click Start Server. The status badge turns green: Running on port 8787
Enable Auto-start on launch (in Settings) so the MCP server starts automatically every time Wikori opens. No manual step required.
Connect Claude Desktop
Open your Claude Desktop config file. On macOS it's at ~/Library/Application Support/Claude/claude_desktop_config.json, on Windows at %APPDATA%\Claude\claude_desktop_config.json.
Add the Wikori server to the mcpServers block:
Replace your-mcp-secret with the secret you set in Wikori. Restart Claude Desktop — Wikori will appear as a connected tool.
The Wikori MCP page has a Copy button that generates this snippet pre-filled with your secret and port. Use that to avoid typos.
Connect Cursor
Open Cursor Settings → Features → MCP Servers. Add a new server with type sse:
Connect Cline / Roo Code
In VS Code with Cline installed, open the Cline settings panel and add an MCP server with HTTP transport:
Connect OpenCode
OpenCode supports MCP via remote HTTP. Add to your opencode.json config:
Agent Prompts
For the best experience, add Wikori's system prompt to your agent so it knows how to navigate your knowledge base. Go to the MCP page in Wikori and copy the prompt from the Agent Prompt (MCP) section. Paste it into your agent's system prompt or instructions.
The prompt teaches the agent:
- How to list available vaults
- How to search across all vaults or a specific one
- How to read individual entries
- How to navigate the knowledge graph by entity or tag
If your agent doesn't support MCP, use the Legacy Prompt on the MCP page instead. It points the agent directly to your vault's index.md file for search-based navigation.
Multi-Vault Queries
Wikori's MCP server exposes all your vaults, not just the active one. An agent can:
- List all available vaults
- Search a specific vault by name or ID
- Search across all vaults simultaneously
- Compare content between vaults
You can say things like: "Search the 'startup' vault for anything about pricing" or "Find all mentions of Ray across all my vaults".
Agent Memory
Wikori gives AI agents persistent memory across sessions. Instead of starting from zero every time, an agent can save what it learns — decisions, errors, patterns, preferences — directly into your vault as first-class knowledge entries.
How agents save observations
The agent calls the memory_save tool with:
| Field | Description | Example |
|---|---|---|
| Observation | The text to save | "Agreed to migrate from AWS to GCP by Q3" |
| Type | decision, error, pattern, preference, or lesson | decision |
| Confidence | 0.0 to 1.0 | 0.95 |
| Memory tier | working, episodic, semantic, or procedural | working |
Each observation becomes a Markdown file with full YAML frontmatter, indexed alongside your human-authored documents on the next wiki rebuild.
The memory lifecycle
Raw observations from a single session — quick, unfiltered. The default tier for memory_save.
Consolidated summaries of a day's or week's work. The agent uses memory_consolidate to group raw observations and synthesize them into a clean summary.
Distilled facts and evergreen patterns — promoted from high-confidence episodic memories. These are the long-term reference material agents rely on months later.
Real-world examples
- Decision preservation: After a strategy call, the agent saves "Agreed to switch vendors by Q3. Confidence: 0.95." Three months later, a different session finds this entry and avoids reopening a settled question.
- Error logging: The agent generates a report in the wrong currency format. It saves "Error: This client expects BRL formatting." Next time, it checks observations before formatting and gets it right.
- Pattern recognition: After reviewing 5 vendor contracts, the agent saves "Pattern: All vendors include a 90-day termination clause. Negotiate for 30 days." Searchable, AI-discovered intelligence for the whole team.
Use memory_sessions to review recent working memories at the start of any new session. This gives your agent continuity without re-reading the entire vault.
Vault Schema
Every time you rebuild the wiki, Wikori auto-generates a SCHEMA.md file at the vault root. This file is a structured overview that tells AI agents what your vault contains before they search a single document.
What's in the schema
- Taxonomy: Entity types, tags, memory tiers, and source types found in the vault
- Inferred conventions: Patterns the system has detected (e.g., "entries tagged #compliance and typed decision appear together 12 times")
- Ground Truth: A curated list of entries with
confidence ≥ 0.9andsource_authority: high— the most reliable material in the vault
Agents read the schema via the get_vault_schema tool. A well-written agent prompt instructs the agent to call this first, before any search — so it understands the vault's structure and knows which entries to trust most.
The schema regenerates automatically on every wiki rebuild. You never need to write or edit it manually — it's always in sync with your vault's actual contents.
Confidence-Weighted Search
When agents search your vault, results are no longer ranked by keyword similarity alone. Wikori now factors in the reliability of each entry — so an official internal document always outranks a scraped blog post, even if the blog post mentions the search term more frequently.
How scoring works
Every entry carries metadata that affects its search rank:
| Factor | Effect | Example |
|---|---|---|
source_authority: high | 1.25× boost | Internal policy PDF, signed contract |
source_authority: medium | No change | Internal email, meeting transcript |
source_authority: low | 0.75× penalty | Scraped web page, blog post |
confidence score | Multiplier: 0.5 + (confidence × 0.5) | 0.9 confidence → 0.95× multiplier |
The result: primary sources float to the top. Agents can also see the authority and confidence of each result, so they can explain to the user why a particular source was chosen.
Use memory_smart_search instead of the basic search tool when you want reliability-aware ranking. It returns the same results, but reordered by trustworthiness and annotated with full metadata.
All Memory Tools Reference
| Tool | What it does | When to use it |
|---|---|---|
get_vault_schema | Read the auto-generated schema to understand the vault | At the start of every session, before any search |
memory_save | Save a decision, error, pattern, preference, or lesson | When the agent learns something worth preserving |
memory_smart_search | Search with confidence-weighted ranking | Any search where reliability matters (most searches) |
memory_sessions | List recent observations (newest first) | To review yesterday's work before starting today |
memory_consolidate | Group working memories and suggest consolidation | Weekly cleanup — compress raw notes into summaries |