Skip to main content
Glama
rsutana

rocks-db

by rsutana

设置指南:Fullscale Rocks MCP 服务器

本指南介绍了如何安装、配置和启动 fullscale-rocks 数据库的 MCP 服务器。

1. 安装

如果尚未安装,请安装依赖项:

cd rocks-mcp
npm install

Related MCP server: DB MCP Server

2. 配置

服务器需要数据库凭据和 OAuth 公钥。

数据库设置

创建或编辑 rocks-mcp/.env:

MYSQL_HOST=127.0.0.1
MYSQL_PORT=3306
MYSQL_DATABASE=employee
MYSQL_USER=employee
MYSQL_PASSWORD=thisisapassword

PG_HOST=127.0.0.1
PG_PORT=5432
PG_DATABASE=employee
PG_USER=employee
PG_PASSWORD=thisisapassword

SSE_PORT=3001

身份验证

服务器会自动在以下位置查找 OAuth 公钥: /home/ryscript/fullscale-rocks/rocks-api/storage/oauth-public.key

请确保该文件存在,因为它用于验证来自 rocks-api 的 JWT 令牌。

3. 运行服务器

开发模式

使用 tsx 运行服务器(文件更改时自动重载):

npm run dev

生产模式

构建 TypeScript 代码并启动构建版本:

npm run build
npm start

4. 连接到 AI 应用程序

Claude Desktop

将此配置添加到你的 claude_desktop_config.json 中:

{
  "mcpServers": {
    "rocks-db": {
      "command": "node",
      "args": ["/home/ryscript/fullscale-rocks/rocks-mcp/build/index.js"]
    }
  }
}

通用 MCP 客户端 (SSE)

服务器还支持用于远程或基于 Web 的客户端的服务器发送事件 (SSE)。

  • SSE URL: http://localhost:3001/sse

  • Post Message URL: http://localhost:3001/message

你可以将其与 MCP Inspector 或其他兼容 SSE 的客户端一起使用。

5. 工具参考

服务器公开了以下工具:

工具

用途

要求

execute_read

运行 SELECT 查询

auth_token, db_type

execute_write

运行 INSERT/UPDATE/DELETE

auth_token (仅限管理员), db_type

list_tables

列出所有表

auth_token, db_type

describe_table

显示表的列信息

auth_token, db_type, table_name


注意:auth_token 应为从 rocks-api 登录过程中获得的有效 Bearer 令牌。

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables secure interaction with MySQL databases through SQL queries, supporting read-only operations without approval and write operations with user confirmation.
    6 npm
    ISC
  • A
    license
    A
    quality
    D
    maintenance
    Enables executing SQL queries, schema introspection, and data management for PostgreSQL and MySQL databases via natural language, supporting local, SSH, and AWS RDS connections.
    8
    145 npm
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    Enables read-only exploration and querying of PostgreSQL or MySQL databases via MCP, with schema discovery, safe SQL validation, natural language to SQL conversion, and CSV export.
    11
    1
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables secure SQL query execution on MySQL databases with authentication and permission control, allowing users to explore database tables and run read-only queries.
    -