anydb-mcp
Zero-config MCP server that empowers AI agents to safely query SQL and NoSQL databases like PostgreSQL, MySQL, SQLite, MongoDB, and Redis.
README
AnyDB MCP Server
<div align="center">
The Universal Database Connector for AI Agents
</div>
anydb-mcp is a professional, zero-config Model Context Protocol (MCP) server that empowers AI agents to safely query SQL and NoSQL databases.
It acts as a universal bridge, allowing tools like Cursor, Claude, Gemini, and Zed to interact with your data effortlessly using a single unified interface.
✨ Features
- 🔌 Universal Support: Works with PostgreSQL, MySQL, SQLite, MongoDB, and Redis out of the box.
- 🚀 Zero Config: No configuration files required. Just run it via
npx. - ⚡ Stateless & Fast: Connections are created on-demand and closed immediately.
- 🛡️ Secure: Designed for read-only access (enforceable via DB users).
- 🧠 Smart Parsing: Automatically detects database types from standard connection URIs.
📦 Quick Start
You can run this server directly using npx without installing anything manually.
🤖 Choose Your Client
<details open> <summary><strong>Cursor</strong> (Recommended)</summary>
- Open Cursor Settings > Features > MCP.
- Click + Add New MCP Server.
- Enter the following details:
- Name:
anydb - Type:
command - Command:
npx - Args:
-y anydb-mcp
- Name:
</details>
<details> <summary><strong>Claude Desktop</strong></summary>
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"anydb": {
"command": "npx",
"args": ["-y", "anydb-mcp"]
}
}
}
</details>
<details> <summary><strong>Zed Editor</strong></summary>
Edit your settings.json (Cmd/Ctrl + ,):
{
"context_servers": {
"anydb": {
"command": {
"path": "npx",
"args": ["-y", "anydb-mcp"]
}
}
}
}
</details>
<details> <summary><strong>Gemini CLI</strong></summary>
Add to your mcp_servers.json:
{
"mcpServers": {
"anydb": {
"command": "npx",
"args": ["-y", "anydb-mcp"]
}
}
}
Note: On Windows, explicitly use npx.cmd.
</details>
<details> <summary><strong>VS Code (Cline / Roo Cline)</strong></summary>
- Open the MCP Servers tab (usually in the sidebar or settings).
- Select Configure MCP Servers.
- Add the configuration:
"anydb": {
"command": "npx",
"args": ["-y", "anydb-mcp"]
}
</details>
🔗 Connection URIs
The AI agent will provide these URIs automatically, or you can provide them in the chat context.
| Database | Protocol | Example URI |
|---|---|---|
| PostgreSQL | postgres:// |
postgres://user:pass@localhost:5432/mydb |
| MySQL | mysql:// |
mysql://user:pass@localhost:3306/mydb |
| SQLite | sqlite:// |
sqlite:///Users/alex/data.db (Absolute path) |
| MongoDB | mongodb:// |
mongodb://user:pass@localhost:27017 |
| Redis | redis:// |
redis://:pass@localhost:6379 |
🛠️ Tool Usage
The server exposes one powerful tool: db_query.
Arguments:
uri(string, required): The connection string.query(string, required): The SQL query, MongoDB filter (JSON), or Redis command.collection(string, optional): Required only for MongoDB.
Examples:
SQL (Postgres/MySQL/SQLite):
SELECT id, email FROM users WHERE created_at > '2024-01-01' LIMIT 5;
MongoDB:
{ "status": "active", "age": { "$gt": 21 } }
Redis:
GET session:12345
🔒 Security Best Practices
- Read-Only User: ALWAYS create a dedicated database user with SELECT-only permissions (or equivalent) for the AI.
- Postgres:
GRANT SELECT ON ALL TABLES IN SCHEMA public TO ai_user; - MySQL:
GRANT SELECT ON mydb.* TO 'ai_user'@'%';
- Postgres:
- Network: Ensure the database host is accessible from the machine running the MCP server.
- Data Privacy: Be cautious. The AI has access to whatever data the query returns.
👨💻 Contributing
We welcome contributions! Please see CONTRIBUTING.md for details.
- Fork the repo.
npm installnpm test- Submit a Pull Request.
License
MIT © Alexeev Alexandr
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。