Server Stats
--
uptime
Databases: 0
Total Docs: 0
Databases
Database Overview

Select a database to view details

Execute queries on the selected database

Results will appear here

Add documents to the selected database

Results will appear here

JSON-RPC 2.0 API Documentation
Download OpenRPC JSON

All methods are available via POST /rpc using the JSON-RPC 2.0 protocol.

rpc.discover

Returns the OpenRPC discovery document describing all available methods.

Parameters: None
Returns: OpenRPC 1.2.6 specification object
{"jsonrpc":"2.0","method":"rpc.discover","params":{},"id":1}
server.ping

Health check endpoint. Returns server status and version.

Parameters: None
Returns: {"status": "ok", "version": "..."}
{"jsonrpc":"2.0","method":"server.ping","params":{},"id":1}
server.stats

Returns server statistics including uptime, database count, and total documents.

Parameters: None
Returns: {"uptime_secs": 120, "databases": 3, "total_docs": 5000}
{"jsonrpc":"2.0","method":"server.stats","params":{},"id":1}
server.exit

Initiate a clean server shutdown. Use with caution.

Parameters: None
Returns: {"success": true, "message": "..."}
{"jsonrpc":"2.0","method":"server.exit","params":{},"id":1}

db.list

List all available databases/indexes with document counts and sizes.

Parameters: None
Returns: {"databases": [{"name": "...", "doc_count": 100, "size_bytes": 4096}]}
{"jsonrpc":"2.0","method":"db.list","params":{},"id":1}
db.create

Create a new database/index with a schema definition.

Param Type Description
name string Database name
schema object Schema with fields array
Returns: {"success": true, "name": "my_db"}
{"jsonrpc":"2.0","method":"db.create","params":{"name":"my_db","schema":{"fields":[{"name":"title","type":"text","stored":true,"indexed":true}]}},"id":1}
db.delete

Permanently delete a database/index and all its data.

Param Type Description
name string Database name to delete
Returns: {"success": true}
{"jsonrpc":"2.0","method":"db.delete","params":{"name":"my_db"},"id":1}
db.close

Close a database to free memory. Data remains on disk and can be reopened.

Param Type Description
name string Database name to close
Returns: {"success": true, "was_open": true}
{"jsonrpc":"2.0","method":"db.close","params":{"name":"my_db"},"id":1}
db.select

Select a database for subsequent operations (doc, search, schema, index).

Param Type Description
name string Database name to select
Returns: {"success": true, "name": "my_db", "doc_count": 100}
{"jsonrpc":"2.0","method":"db.select","params":{"name":"my_db"},"id":1}
db.info

Get information about the currently selected database.

Parameters: None (requires db.select first)
Returns: {"name": "my_db", "doc_count": 100, "segment_count": 3}
{"jsonrpc":"2.0","method":"db.info","params":{},"id":1}

schema.get

Get the schema of the currently selected database.

Parameters: None (requires db.select first)
Returns: {"fields": [{"name": "title", "type": "text", "stored": true}]}
Field types: text, str, u64, i64, f64, date, bytes, json, bool, ip
{"jsonrpc":"2.0","method":"schema.get","params":{},"id":1}

doc.add

Add a single document to the selected database.

Param Type Description
document object Document fields matching the schema
Returns: {"success": true, "opstamp": 1}
{"jsonrpc":"2.0","method":"doc.add","params":{"document":{"title":"Hello","body":"World"}},"id":1}
doc.add_batch

Add multiple documents in a single batch operation.

Param Type Description
documents array Array of document objects
Returns: {"success": true, "count": 10, "opstamp": 11}
{"jsonrpc":"2.0","method":"doc.add_batch","params":{"documents":[{"title":"Doc 1"},{"title":"Doc 2"}]},"id":1}
doc.delete

Delete documents matching a field/value term.

Param Type Description
field string Field name to match
value string|number Value to match for deletion
Returns: {"success": true}
{"jsonrpc":"2.0","method":"doc.delete","params":{"field":"id","value":"doc_123"},"id":1}

index.commit

Commit pending changes to the index. Makes added/deleted documents permanent.

Parameters: None (requires db.select first)
Returns: {"success": true, "opstamp": 12}
{"jsonrpc":"2.0","method":"index.commit","params":{},"id":1}
index.reload

Reload the index reader to see the latest committed changes.

Parameters: None (requires db.select first)
Returns: {"success": true}
{"jsonrpc":"2.0","method":"index.reload","params":{},"id":1}

search.query

Execute a search query on the selected database. Supports multiple query types.

Param Type Description
query object Query definition (see types below)
limit integer Max results (default: 10)
offset integer Skip results (default: 0)
Query types:
  • {"type":"all"} - Match all documents
  • {"type":"term","field":"title","value":"hello"} - Exact term match
  • {"type":"match","field":"body","value":"search terms"} - Full-text match
  • {"type":"phrase","field":"body","value":"exact phrase"} - Phrase match
  • {"type":"prefix","field":"title","value":"hel"} - Prefix match
Returns: {"total_hits": 42, "hits": [...], "took_ms": 5}
{"jsonrpc":"2.0","method":"search.query","params":{"query":{"type":"match","field":"title","value":"hello"},"limit":10},"id":1}
search.count

Count documents matching a query without returning results.

Param Type Description
query object Query definition (same types as search.query)
Returns: {"count": 42}
{"jsonrpc":"2.0","method":"search.count","params":{"query":{"type":"all"}},"id":1}

Connect AI assistants (Claude, etc.) to this HeroIndex server via the Model Context Protocol (MCP).

Connection Details
MCP Endpoint loading...
Port loading...
Protocol JSON-RPC 2.0 over HTTP (Streamable HTTP transport)
Claude Code Setup

Add HeroIndex as an MCP server in Claude Code:

loading...

After adding, Claude will be able to:

  • Create and manage full-text search databases
  • Add, delete, and batch-add documents
  • Execute search queries: term, match, phrase, prefix
  • Get database info, schema, and server stats
  • Manage index lifecycle: commit, reload
Claude Desktop Setup

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

loading...
Available MCP Tools
Tool Description Category
server_ping Health check - returns server status and version Server
server_stats Get uptime, database count, and total documents Server
db_list List all databases with document counts and sizes Database
db_create Create a new full-text search database with schema Database
db_delete Permanently delete a database and all its data Database
db_close Close a database to free memory Database
db_select Select a database for subsequent operations Database
db_info Get info about the selected database Database
schema_get Get the schema of the selected database Schema
doc_add Add a single document to the selected database Documents
doc_add_batch Add multiple documents in a single batch Documents
doc_delete Delete documents matching a field/value term Documents
index_commit Commit pending changes to the index Index
index_reload Reload the index reader for latest changes Index
search_query Execute a search query (all, term, match, phrase, prefix) Search
search_count Count documents matching a query Search
Protocol Details

The MCP endpoint speaks JSON-RPC 2.0. Supported methods:

initialize Handshake with protocol version and capabilities
tools/list List all available tools with JSON schemas
tools/call Execute a tool by name with arguments
ping Health check

No authentication required. The MCP endpoint is open for local use.

Performance Test
Create a test database, load 100k documents, and benchmark search
1Setup & Load
Loading... 0%
2Search Benchmark
3Results Summary