Skip to main content
Platform feature. Requires WANIWANI_API_KEY. Works whether your MCP server is self-hosted or on Managed Hosting. About the Platform.
The SDK includes a knowledge base client for semantic search. Ingest markdown files, then search from any tool handler.

Setup

The KB client is available on the Waniwani client instance:

Ingest files

Load markdown content into your knowledge base. Ingestion is destructive and replaces all existing chunks.
The managed project template includes a ready-made embed script:

Ingest script for self-hosted projects

If you’re running your own MCP server, create a simple script to read your docs and push them to Waniwani. This runs standalone and doesn’t need to be inside an MCP server.
scripts/kb-ingest.ts
Run it with npx tsx scripts/kb-ingest.ts or bun scripts/kb-ingest.ts.
A built-in waniwani embed CLI command is coming soon to @waniwani/cli, so you won’t need a custom script.

Ingest input

filename
string
required
Identifier for the source file.
content
string
required
Markdown content. Chunked server-side.
metadata
Record<string, string>
Arbitrary key-value pairs stored with each chunk. Can be used to filter search results.

Ingest response

Each result contains:

Using search in a tool

List sources

List all ingested files with their chunk counts: