SQLite-Anet-MCP Server

SQLite-Anet-MCP Server

SQLite-Anet-MCP Server A blazing-fast, Rust-powered SQLite server for AI agents—speak JSON-RPC, store insights, and manage your database like a pro.

marekkucak

Developer Tools
Visit Server

README

SQLite-Anet-MCP Server

A Rust implementation of the Model Control Protocol (MCP) server that provides SQLite database capabilities via a standardized protocol. This server enables AI agents to create, manage, and query SQLite databases directly.

This project is based on the Model Context Protocol SQLite Server reference implementation.


Features

  • 🗃️ Create and manage SQLite database tables
  • 🔍 Execute SELECT queries for data retrieval
  • ✏️ Execute INSERT, UPDATE, and DELETE queries for data manipulation
  • 📊 Describe table schemas and list available tables
  • 📝 Save and synthesize business insights from data
  • 🔄 NATS transport layer for message passing
  • 🛠️ JSON-RPC 2.0 compatible API
  • ⚡ Asynchronous request handling with Tokio

Requirements

  • Rust 1.70+
  • NATS server running locally or accessible via network
  • SQLite (included as a Rust dependency)

Installation

Clone the repository and build the server:

git clone https://github.com/yourusername/sqlite-anet-mcp.git
cd sqlite-anet-mcp

Configure your environment in a .env file:

NATS_URL=nats://localhost:4222
MCP_SUBJECT=mcp.requests
SQLITE_DB_PATH=./data/sqlite.db
RUST_LOG=debug

Getting Started

Running the Server

# Start a NATS server in another terminal or ensure one is already running
# Example:
nats-server

# Run the SQLite MCP server
cargo run

Testing the Server

You can test the server using the included test client:

cargo run --example test_client

This will set up a basic customer database and demonstrate the server's capabilities.

Chinook Database Test

To run the Chinook database test example:

cargo run --example chinook_test

Note: Before running the Chinook test, you need to:

  1. Download the Chinook SQLite database from: https://www.sqlitetutorial.net/sqlite-sample-database/
  2. Place the chinook.db file in the ./data/ directory
  3. Set SQLITE_DB_PATH=./data/chinook.db in your .env file or when running the example

Available Tools

1. list_tables

List all tables in the SQLite database.

Example:

{
  "name": "list_tables",
  "arguments": {}
}

2. describe_table

Get the schema information for a specific table.

Parameters:

  • table_name (required): Name of the table to describe

Example:

{
  "name": "describe_table",
  "arguments": {
    "table_name": "customers"
  }
}

3. create_table

Create a new table in the SQLite database.

Parameters:

  • query (required): CREATE TABLE SQL statement

Example:

{
  "name": "create_table",
  "arguments": {
    "query": "CREATE TABLE customers (id INTEGER PRIMARY KEY, name TEXT, email TEXT, join_date TEXT)"
  }
}

4. read_query

Execute a SELECT query on the SQLite database.

Parameters:

  • query (required): SELECT SQL query to execute

Example:

{
  "name": "read_query",
  "arguments": {
    "query": "SELECT * FROM customers WHERE join_date > '2023-01-01'"
  }
}

5. write_query

Execute an INSERT, UPDATE, or DELETE query on the SQLite database.

Parameters:

  • query (required): SQL query to execute (must be INSERT, UPDATE, or DELETE)

Example:

{
  "name": "write_query",
  "arguments": {
    "query": "INSERT INTO customers (name, email, join_date) VALUES ('John Doe', 'john@example.com', '2023-01-15')"
  }
}

6. append_insight

Add a business insight to the memo.

Parameters:

  • insight (required): Business insight discovered from data analysis

Example:

{
  "name": "append_insight",
  "arguments": {
    "insight": "Customer acquisition is stable and growing over time."
  }
}

Available Resources

Business Insights Memo

A living document of discovered business insights.

URI: memo://insights

Example:

{
  "method": "readResource",
  "params": {
    "uri": "memo://insights"
  }
}

Available Prompts

MCP Demo

A prompt to seed the database with initial data and demonstrate what you can do with an SQLite MCP Server + Claude.

Arguments:

  • topic (required): Topic to seed the database with initial data

Example:

{
  "method": "getPrompt",
  "params": {
    "name": "mcp-demo",
    "arguments": {
      "topic": "coffee shop sales"
    }
  }
}

Architecture

The server follows a modular design:

  • tools – SQLite database operations implementations
  • models – SQLite query and response structures
  • prompts – Interactive demo templates
  • resources – Business insights memo generation
  • sqlite – Core database functionality

Development

Adding New Features

To extend the server with additional SQLite capabilities:

  1. Define response structures in src/models/sqlite.rs
  2. Implement the tool in src/tools/ following the Tool trait
  3. Register the tool in src/main.rs

Troubleshooting

  • Ensure the NATS server is running and accessible
  • Check that the SQLite database path is correctly set
  • Verify the request format matches the expected input schema for each tool

License

MIT License


Acknowledgements

This project is built on top of the Anet MCP Server framework and is based on the Model Context Protocol SQLite Server reference implementation.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
MCP Package Docs Server

MCP Package Docs Server

Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.

Featured
Local
TypeScript
Claude Code MCP

Claude Code MCP

An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.

Featured
Local
JavaScript
@kazuph/mcp-taskmanager

@kazuph/mcp-taskmanager

Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.

Featured
Local
JavaScript
Linear MCP Server

Linear MCP Server

Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.

Featured
JavaScript
mermaid-mcp-server

mermaid-mcp-server

A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.

Featured
JavaScript
Jira-Context-MCP

Jira-Context-MCP

MCP server to provide Jira Tickets information to AI coding agents like Cursor

Featured
TypeScript
Linear MCP Server

Linear MCP Server

A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Featured
JavaScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Featured
Python