anydb-mcp
Allows querying MongoDB databases using filter JSON queries, with optional collection parameter.
Allows querying MySQL databases using SQL queries.
Allows querying PostgreSQL databases using SQL queries.
Allows executing Redis commands (e.g., GET key) against Redis databases.
Allows querying SQLite databases using SQL queries, with file-based connection URIs.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@anydb-mcpShow me the top 10 users from my PostgreSQL database"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AnyDB MCP Server
The Universal Database Connector for AI Agents
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.
Related MCP server: mcpolyglot
📦 Quick Start
You can run this server directly using npx without installing anything manually.
🤖 Choose Your Client
Open Cursor Settings > Features > MCP.
Click + Add New MCP Server.
Enter the following details:
Name:
anydbType:
commandCommand:
npxArgs:
-y anydb-mcp
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"anydb": {
"command": "npx",
"args": ["-y", "anydb-mcp"]
}
}
}Edit your settings.json (Cmd/Ctrl + ,):
{
"context_servers": {
"anydb": {
"command": {
"path": "npx",
"args": ["-y", "anydb-mcp"]
}
}
}
}Add to your mcp_servers.json:
{
"mcpServers": {
"anydb": {
"command": "npx",
"args": ["-y", "anydb-mcp"]
}
}
}Note: On Windows, explicitly use npx.cmd.
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"]
}🔗 Connection URIs
The AI agent will provide these URIs automatically, or you can provide them in the chat context.
Database | Protocol | Example URI |
PostgreSQL |
|
|
MySQL |
|
|
SQLite |
|
|
MongoDB |
|
|
Redis |
|
|
🛠️ 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'@'%';
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 testSubmit a Pull Request.
License
MIT © Alexeev Alexandr
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.
Latest Blog Posts
- 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/officialalexeev/anydb-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server