| Crates.io | sochdb-mcp |
| lib.rs | sochdb-mcp |
| version | 0.4.3 |
| created_at | 2026-01-20 08:03:57.413173+00 |
| updated_at | 2026-01-23 20:38:34.488192+00 |
| description | Minimal MCP server for SochDB - AI-native database |
| homepage | https://sochdb.dev |
| repository | https://github.com/sochdb/sochdb |
| max_upload_size | |
| id | 2056039 |
| size | 277,623 |
Minimal Model Context Protocol (MCP) server for SochDB - an AI-native database.
This is a thin adapter layer that exposes SochDB's AI-native features via the MCP protocol, allowing LLM clients like Claude Desktop, Cursor, and ChatGPT to interact with your database.
MCP Client (Claude, Cursor, etc.)
│
│ JSON-RPC over stdio
▼
┌─────────────────────────────────┐
│ sochdb-mcp │
│ - Stdio framing (~50 lines) │
│ - JSON-RPC dispatch │
│ - MCP methods │
└─────────────────────────────────┘
│
│ Direct Rust calls
▼
┌─────────────────────────────────┐
│ SochDB │
│ - Context queries → AI context │
│ - TOON format → token savings │
│ - Path-based access │
└─────────────────────────────────┘
# Build from source
cargo build --release --package sochdb-mcp
# Binary is at target/release/sochdb-mcp
Add to your claude_desktop_config.json:
{
"mcpServers": {
"sochdb": {
"command": "/path/to/sochdb-mcp",
"args": ["--db", "/path/to/your/database"]
}
}
}
Add to your .cursor/mcp.json:
{
"mcpServers": {
"sochdb": {
"command": "/path/to/sochdb-mcp",
"args": ["--db", "./data"]
}
}
}
# Test the server manually
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' | sochdb-mcp --db ./test_data
sochdb.context_queryFetch AI-optimized context with token budgeting. This is SochDB's killer feature for LLMs.
{
"name": "sochdb.context_query",
"arguments": {
"sections": [
{
"name": "recent_messages",
"priority": 10,
"kind": "last",
"table": "messages",
"top_k": 5
},
{
"name": "user_profile",
"priority": 20,
"kind": "get",
"path": "users/current"
}
],
"token_budget": 2000
}
}
sochdb.queryExecute SochQL queries directly.
{
"name": "sochdb.query",
"arguments": {
"query": "SELECT * FROM users WHERE active = true"
}
}
sochdb.get / sochdb.put / sochdb.deletePath-based CRUD operations with O(|path|) complexity.
{
"name": "sochdb.get",
"arguments": {
"path": "users/123/profile/name"
}
}
sochdb.list_tables / sochdb.describeSchema introspection tools.
The server is intentionally minimal:
No external MCP framework. Just serde_json + SochDB.
2024-11-05tools: list and callresources: list and read (exposes tables)SochDB is already AI-native: Operations, SochQL, context engine, and token budgets are built-in. The MCP layer just exposes them.
Thin is good: The MCP server doesn't need to understand schemas or indexing. It translates between JSON-RPC and SochDB calls.
No framework bloat: A few hundred lines of code vs. pulling in a heavy MCP SDK.
All logs go to stderr (required for stdio transport - stdout is for protocol messages only).
Set RUST_LOG=sochdb_mcp=debug for verbose output.
Apache-2.0