1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
[]
# Phase 7h — Model Context Protocol (MCP) server adapter for SQLRite.
#
# Wraps a SQLRite database as an MCP server over stdio. LLM agents
# (Claude Code, Cursor, Codex, the official `mcp-inspector`, etc.)
# spawn the `sqlrite-mcp` binary as a subprocess and get a fixed set
# of tools — `list_tables`, `describe_table`, `query`, `execute`,
# `schema_dump`, `vector_search`, plus `ask` (Phase 7g.8) when the
# `ask` feature is on — for driving the database without any custom
# integration.
#
# **Hand-rolled JSON-RPC 2.0 over line-delimited JSON on stdio.** No
# tokio, no async runtime. Same dep-frugal "build it ourselves"
# theme as `sqlrite-ask`'s hand-rolled JSON over `ureq`. The MCP
# wire format is small and stable enough that ~600 LOC is all the
# protocol layer + dispatch + 7 tools take.
#
# Published to crates.io as `sqlrite-mcp`. Joins the lockstep
# release wave (`sqlrite-mcp-vX.Y.Z` tag) — see `docs/release-plan.md`.
= "sqlrite-mcp"
= "0.14.0"
= ["Joao Henrique Machado Silva <joaoh82@gmail.com>"]
= "2024"
= "1.85"
= "Model Context Protocol (MCP) server for SQLRite. Exposes a SQLRite database to LLM agents over stdio."
= "https://github.com/joaoh82/rust_sqlite"
= "MIT"
= "README.md"
= ["sqlrite", "mcp", "llm", "ai", "anthropic"]
= ["database", "command-line-utilities"]
[[]]
= "sqlrite-mcp"
= "src/main.rs"
[]
# Default is the full build with the `ask` tool wired in. The `ask`
# tool calls into `sqlrite::ask::ask_with_database` (powered by the
# `sqlrite-ask` crate), which needs the engine's `ask` feature on,
# which in turn pulls `ureq` + `rustls` for the LLM HTTP transport.
#
# Disabling default features (`--no-default-features`) gives a lean
# MCP binary with the six pure-SQL tools and no LLM machinery — the
# right shape for embedded use, ultra-light Docker images, or
# situations where the operator doesn't want any outbound HTTP from
# the server process.
= ["ask"]
= ["sqlrite/ask"]
[]
# The engine. We deliberately turn the engine's `default` features
# off (which excludes the `cli` feature and its rustyline/clap pull
# weight) and only enable `ask` when our own `ask` feature is on.
# Keeps the MCP binary small + boot-fast.
= { = "sqlrite-engine", = "..", = "0.14.0", = false }
# JSON-RPC + tool I/O. The MCP wire format is JSON in / JSON out;
# tool argument schemas are JSON; tool results are JSON. serde +
# serde_json carry their weight.
= { = "1", = ["derive"] }
= "1"
# CLI parsing for `sqlrite-mcp [DB_PATH] [--read-only] [--in-memory]`.
# Same crate the REPL uses, so no extra weight in the workspace's
# resolved dep set.
= { = "4", = ["derive"] }
# `dup` / `dup2` for the stdout-redirect dance in `main.rs`. The MCP
# wire format owns stdout exclusively; the engine's REPL-convenience
# `print!` / `println!` calls inside `process_command` (CREATE-table
# schema dump, INSERT row dump, SELECT result table) would otherwise
# corrupt the JSON-RPC channel. We redirect process fd 1 to fd 2 at
# startup so any wayward stdout write goes to stderr (visible in the
# MCP client's server-log pane), and write JSON-RPC responses to a
# saved-off duplicate of the original fd 1. See `src/stdio_redirect.rs`
# for the surgical implementation. libc is already a transitive dep of
# clap + the engine — listing it here is a free declaration of intent.
= "0.2"
[]
# Spawning the binary in integration tests, then piping JSON-RPC
# requests + reading responses — pure stdlib via std::process::Command.
# No deps needed.