Cover image
Try Now
2025-03-31

SQLITE-ANET-MCP服务器为AI代理使用燃烧的,施加的SQLITE服务器 - 启动JSON-RPC,商店Insights,并像Pro一样管理您的数据库。

3 years

Works with Finder

1

Github Watches

0

Github Forks

0

Github Stars

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.

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Lists Tailwind CSS classes in monospaced font

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • https://appia.in
  • Siri Shortcut Finder – your go-to place for discovering amazing Siri Shortcuts with ease

  • Daren White
  • A supportive coach for mastering all Spanish tenses.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

  • HiveNexus
  • 一个适用于中小型团队的AI聊天机器人,支持DeepSeek,Open AI,Claude和Gemini等车型。 专为中小团队设计的ai聊天应用,支持deepSeek,打开ai,claude,双子座等模型。

  • ravitemer
  • 一个功能强大的Neovim插件,用于管理MCP(模型上下文协议)服务器

  • patruff
  • Ollama和MCP服务器之间的桥梁,使本地LLMS可以使用模型上下文协议工具

    Reviews

    1 (1)
    Avatar
    user_lIiQjpud
    2025-04-16

    I have been using sqlite-anet-mcp, created by marekkucak, for a while now and it has significantly improved my workflow. The easy integration with SQLite databases and the seamless operation with MCP applications make it a valuable tool. The comprehensive documentation available at https://github.com/marekkucak/sqlite-anet-mcp is really helpful for getting started quickly. I highly recommend it to anyone working with MCP systems.