# MCP SQLite npx 服务器
## 基本信息
- Slug: `johnnyoshika-mcp-server-sqlite-npx`
- Source: modelscope
- Publisher: @johnnyoshika/mcp-server-sqlite-npx
- Categories: developer-tools / databases
- Hosted: No
- License: MIT License
- Source URL: https://www.modelscope.cn/mcp/servers/@johnnyoshika/mcp-server-sqlite-npx
## 简介
使用 SQLite 的 Node.js 版本的模型上下文协议服务器实现，为没有 Python UVX 运行程序的环境提供基于 npx 的替代方案。
## 安装提示

```bash
npx -y @smithery/cli install mcp-server-sqlite-npx --client claude
```

## MCP Server 详情

# MCP SQLite 服务器

[![smithery 徽章](https://smithery.ai/badge/mcp-server-sqlite-npx)](https://smithery.ai/server/mcp-server-sqlite-npx)

这是一个基于 [官方 Python 参考实现](https://github.com/modelcontextprotocol/servers/tree/main/src/sqlite) 的 Node.js 版本的 Model Context Protocol SQLite 服务器。此版本为无法使用 Python 的 UVX 运行器的环境提供了一个基于 npx 的替代方案，例如 [LibreChat](https://github.com/danny-avila/LibreChat/issues/4876#issuecomment-2561363955)。

## 与 Claude Desktop 一起使用

### 通过 Smithery 安装

要通过 [Smithery](https://smithery.ai/server/mcp-server-sqlite-npx) 自动安装适用于 Claude Desktop 的 MCP SQLite 服务器：

```bash
npx -y @smithery/cli install mcp-server-sqlite-npx --client claude
```


### 手动安装

将以下内容添加到 `claude_desktop_config.json` 文件中：

```json
{
  "mcpServers": {
    "sqlite": {
      "command": "/absolute/path/to/npx",
      "args": [
        "-y",
        "mcp-server-sqlite-npx",
        "/absolute/path/to/database.db"
      ],
      "env": {
        "PATH": "/absolute/path/to/executables",
        "NODE_PATH": "/absolute/path/to/node_modules"
      }
    }
  }
}
```


在 macOS 上使用 nvm 的完整示例：

```json
{
  "mcpServers": {
    "sqlite": {
      "command": "/Users/{username}/.nvm/versions/node/v22.12.0/bin/npx",
      "args": [
        "-y",
        "mcp-server-sqlite-npx",
        "/Users/{username}/projects/database.db"
      ],
      "env": {
        "PATH": "/Users/{username}/.nvm/versions/node/v22.12.0/bin:/usr/local/bin:/usr/bin:/bin",
        "NODE_PATH": "/Users/{username}/.nvm/versions/node/v22.12.0/lib/node_modules"
      }
    }
  }
}
```


在 Windows 上使用 nvm 的完整示例：

```json
{
  "mcpServers": {
    "sqlite": {
      "command": "C:\\Program Files\\nodejs\\npx.cmd",
      "args": [
        "-y",
        "mcp-server-sqlite-npx",
        "C:\\Users\\{username}\\projects\\database.db"
      ],
      "env": {
        "PATH": "C:\\Program Files\\nodejs;%PATH%",
        "NODE_PATH": "C:\\Program Files\\nodejs\\node_modules"
      }
    }
  }
}
```


## 开发

1. 安装依赖项：

```bash
npm ci
```


2. 构建 TypeScript 代码：

```bash
npm run build
```


### 使用 MCP Inspector 测试

你可以使用 [MCP Inspector 工具](https://modelcontextprotocol.io/docs/tools/inspector) 来测试服务器：

```bash
npx @modelcontextprotocol/inspector node dist/index.js /absolute/path/to/database.db
```


点击 `Connect` 并进入 `Tools` 开始使用服务器。

### 用 Claude Desktop 测试

将以下内容添加到 `claude_desktop_config.json` 文件中：

```json
{
  "mcpServers": {
    "sqlite": {
      "command": "/absolute/path/to/node",
      "args": [
        "/absolute/path/to/dist/index.js",
        "/absolute/path/to/database.db"
      ]
    }
  }
}
```


示例：

- `/absolute/path/to/node`: `/Users/{username}/.nvm/versions/node/v20.18.1/bin/node`
- `/absolute/path/to/index.js`: `/Users/{username}/projects/mcp-server-sqlite-npx/dist/index.js`
- `/absolute/path/to/database.db`: `/Users/{username}/projects/database.db`

### 发布

- 在 package.json 中更新版本号
- `npm install`
- 提交并附带信息：`Release {version, e.g. 0.1.6}`

