mcp-db-wrapper-example
mcp-db-wrapper-example
foro.sh 数据库入门套件:一个封装小型 SQL 数据库的 MCP 服务器。它附带一个演示表(notes),让你开箱即用即可查询,并提供 AI 编码代理可用的工具来读写数据。
在 Claude Code 中打开此项目? 无需安装。本仓库在
.claude/skills/中提供了代理所需的技能:如何部署此服务器,以及如何添加对模型而言物有所值的工具。
部署前准备
未经任何配置,此项目运行在本地 SQLite 文件上,每次重启和重新部署时数据都会被清除——适合试用,不适合存放重要数据。
要持久保存数据,请在项目的 Secrets 选项卡中将 DATABASE_URL 设置为密钥(使用指向你控制卷上文件的 sqlite:/// URL)。如需使用不同类型的数据库,请参阅下方的存储部分。
Related MCP server: sqlite-mcp
工具
工具 | 功能说明 |
| 查看数据库中的所有表 |
| 执行读取查询( |
| 向表中添加一行数据 |
自定义改造
这是一个起点,而非成品。在 Claude Code(或其他 AI 编码代理)中打开此仓库,并让它:
添加你的项目实际需要的表
添加针对你特定数据操作需求的工具——不仅仅是原始的
query/insert——例如find_customer(email)、log_event(...)在拥有真实数据库后指向它(请参阅下方的存储部分)
你无需了解 FastMCP 或模型上下文协议即可完成这些操作——用自然语言描述你的需求,让代理编写代码即可。
存储
数据库类型在 pyproject.toml 中声明:
[tool.mcp-db-wrapper]
database = "sqlite"server.py 会读取此配置,如果 DATABASE_URL 不匹配(例如,当 database = "sqlite" 时使用了非 sqlite:/// 的 URL),则拒绝启动,因为类型是配置项,而非从任意设置的 URL 推断而来。
默认情况下,如果没有设置 DATABASE_URL 密钥,项目运行在 /tmp/db.sqlite3 上,自动创建,无需配置,但每次重启和重新部署时数据会被清除(平台不挂载持久卷)。将 DATABASE_URL 设置为指向你控制卷上的 sqlite:/// 路径,即可持久保存数据。如需使用完全不同的数据库类型(例如 Postgres),请让编码代理替换相应的驱动程序并更新上述 database 配置。
本地运行
uv run server.py服务器通过可流式 HTTP 在 http://localhost:8000/mcp 上提供 MCP 服务(设置 PORT 可更改端口——foro 在部署时注入的端口名相同)。
部署
其 pyproject.toml 已包含 foro.sh 所需的所有配置,因此此仓库可直接部署:登录,选择此仓库,部署即可。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceAn MCP server that enables AI assistants to create and manage persistent SQLite databases through natural language without requiring SQL knowledge. It allows users to propose schemas, store records, and perform complex queries across multiple databases for structured data tracking.MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that enables AI agents to interact with SQLite databases by querying schemas, executing SQL, and inspecting table metadata. It supports safe database access through configurable read-only modes, query timeouts, and dry-run execution plans.MIT
- FlicenseNot gradedqualityBmaintenanceAn MCP server that exposes relational databases (PostgreSQL/MySQL) to AI agents with natural language to SQL query support.19
- FlicenseNot gradedqualityDmaintenanceMCP server that provides SQLite database operations. Allows AI assistants to query, modify and manage SQLite databases through the Model Context Protocol.
Related MCP Connectors
GibsonAI MCP server: manage your databases with natural language
Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.
MCP server exposing the Backtest360 engine API as tools for AI agents.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/foro-sh/mcp-db-wrapper-example'
If you have feedback or need assistance with the MCP directory API, please join our Discord server