Standard REST API:
http://{host}:{port}/api
Model Context Protocol (MCP) Endpoint:
http://{host}:{port}/mcp
Default Host/Port: http://localhost:35248
Performs a search across lexical and semantic (if enabled).
Endpoint: /search
Methods: GET, POST
query(required): Search query stringlimit(optional): Maximum number of results (default: 5)
GET /api/search?query=linux&limit=5
POST /api/search
Content-Type: application/json
{
"query": "linux",
"limit": 5
}{
"status": "success",
"time": 1.234,
"results": [
{
"article_id": 123,
"title": "Linux",
"text": "Linux was created in 1991...",
"type": "T",
"power": 1.234
}
]
}Searches only article titles using full-text search.
Endpoint: /search/title
Methods: GET, POST
query(required): Search query stringlimit(optional): Maximum number of results (default: 5)
GET /api/search/title?query=linux&limit=5
POST /api/search/title
Content-Type: application/json
{
"query": "linux",
"limit": 5
}Searches using full-text search.
Endpoint: /search/lexical
Methods: GET, POST
query(required): Search query stringlimit(optional): Maximum number of results (default: 5)
GET /api/search/lexical?query=linux&limit=5
POST /api/search/lexical
Content-Type: application/json
{
"query": "linux",
"limit": 5
}Searches using vector embeddings. Requires AI to be enabled.
Endpoint: /search/semantic
Methods: GET, POST
query(required): Search query stringlimit(optional): Maximum number of results (default: 5)
GET /api/search/semantic?query=linux&limit=5
POST /api/search/semantic
Content-Type: application/json
{
"query": "linux",
"limit": 5
}Calculate the Levenshtein distance between the provided word and the entries in the internal database vocabulary to find the closest match.
Endpoint: /search/distance
Methods: GET, POST
query(required): Search wordlimit(optional): Maximum number of results (default: 5)
GET /api/search/distance?query=linux&limit=5
POST /api/search/distance
Content-Type: application/json
{
"query": "linux",
"limit": 5
}Retrieves a complete article by ID.
Endpoint: /article
Methods: GET, POST
id(required): Article ID
GET /api/article?id=123
POST /api/article
Content-Type: application/json
{
"id": 123
}{
"status": "success",
"time": 1.234,
"article": {
"id": 123,
"title": "Linux",
"entity": "Q388",
"sections": [
{
"id": 1234,
"title": "History",
"content": "Linux was created in 1991..."
},
{
"id": 12345,
"title": "Design Philosophy",
"content": "Linux follows Unix philosophy..."
}
]
}
}Provides bidirectional communication over Server-Sent Events (SSE) and Streamable HTTP for integrating with compatible AI applications and development tools.
Endpoint: /mcp
Methods: GET, POST
session_id(required for non-initialization requests): Unique session identifier, passed either via theMcp-Session-Idheader or thesession_idquery parameter.
Used to establish the stateful, unidirectional server-to-client stream.
GET /mcp?session_id=a1b2c3d4e5f6
Establishes the initial connection. Does not require a session ID header.
POST /mcp
Content-Type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {},
"clientInfo": {
"name": "example-client",
"version": "1.0.0"
}
}
}Returns 200 OK alongside the assigned session ID inside the Mcp-Session-Id header.
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"protocolVersion": "2024-11-05",
"capabilities": {
"tools": {
"listChanged": false
},
"prompts": {
"listChanged": false
}
},
"serverInfo": {
"name": "wikilite",
"version": "1.6.9"
}
}
}Executes a tool on the server. Requires the returned Mcp-Session-Id header.
POST /mcp
Mcp-Session-Id: a1b2c3d4e5f6
Content-Type: application/json
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "search",
"arguments": {
"query": "linux",
"limit": 1
}
}
}{
"jsonrpc": "2.0",
"id": 2,
"result": {
"content": [
{
"type": "text",
"text": "Search results for 'linux' (limit 1):\n\n1. **Linux** (Article ID: 123)\n Match Score: 100.00%\n Snippet: Linux was created in 1991...\n\n"
}
],
"isError": false
}
}{
"status": "success",
"time": 1.234,
"results": [...], // For search endpoints
"article": [...] // For article endpoint
}{
"status": "error",
"message": "Error description"
}Search results include a type field indicating the source:
T: Title matchC: Content matchV: Vector match
The API uses standard HTTP status codes:
200: Success400: Bad Request (invalid parameters)500: Internal Server Error
- Combined Search:
curl 'http://localhost:35248/api/search?query=linux&limit=5'- Title Search:
curl -X POST http://localhost:35248/api/search/title \
-H 'Content-Type: application/json' \
-d '{"query": "linux"}'- Get Article:
curl 'http://localhost:35248/api/article?id=123'- Initialize MCP Session Handshake:
curl -X POST http://localhost:35248/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": {"name": "test", "version": "1.0"}}}'To use semantic search, you have two options:
- Remote Server:
You can pass the remote server URL using the--ai-api-urlflag. This allows the system to connect to a remote server where the vector search functionality is hosted. - Local Model: Alternatively, local semantic search execution can be performed using the GGUF model embedded into the database. Only the qwen3-embeddings-q8.0 format is supported for querying, and it cannot be used for database indexing or embedding processing.
- All search endpoints support both GET and POST methods
- The
limitparameter is shared across all search types - Semantic search requires additional configuration and services
- Results are deduplicated across search types in combined search