この紹介文は現在英語版のみです。
Based on elizabethsiegle/remote-mcp-server-authless-talk-to-db project
Project Overview
This is a remote MCP (Model Context Protocol) server project deployed on Cloudflare Workers that enables direct communication with Cloudflare D1 SQL databases without authentication. This project allows your AI coding IDEs to directly access databases, greatly enhancing the development experience.
Key Features
🚀 Authless Deployment
- Quick deployment to Cloudflare Workers
- Automatically get a public MCP server endpoint
- No complex authentication configuration required
🗄️ Database Integration
- Direct connection to Cloudflare D1 SQL database
- Support for complex SQL query operations
- Real-time database interaction capabilities
🤖 Multi-Client Support
- Windsurf: Enhance your AI coding experience
- Cursor: Smart code editor integration
- Claude Desktop: Anthropic’s AI assistant
- Workers AI LLM Playground: Cloudflare AI platform
- Other MCP protocol-compatible clients
⚡ High-Performance Architecture
- Edge computing based on Cloudflare Workers
- SSE (Server-Sent Events) real-time communication
- Low-latency data access
Tech Stack
- Runtime: Cloudflare Workers
- Database: Cloudflare D1 (SQLite)
- Protocol: MCP (Model Context Protocol)
- Communication: Server-Sent Events (SSE)
- Language: TypeScript
- Deployment: Wrangler CLI
Quick Start
Method 1: One-Click Deployment
Deploy directly to Cloudflare Workers using the command below:
npm create cloudflare@latest -- my-mcp-server --template=cloudflare/ai/demos/remote-mcp-authless
Method 2: Manual Deployment
-
Clone Repository
git clone https://github.com/elizabethsiegle/remote-mcp-server-authless-talk-to-db.git cd remote-mcp-server-authless-talk-to-db -
Install Dependencies
npm install -
Configure Environment
- Login to Cloudflare account
- Create D1 database
- Configure wrangler.jsonc
-
Deploy to Workers
npm run deploy
Usage Guide
Connect to Cloudflare AI Playground
- Visit https://playground.ai.cloudflare.com/
- Enter your MCP server URL:
remote-mcp-server-authless.{your-account}.workers.dev/sse - Start using MCP tools directly in the playground!
Connect to Claude Desktop
Add the following configuration in Claude Desktop settings:
{
"mcpServers": {
"d1-database": {
"command": "npx",
"args": [
"mcp-remote",
"https://remote-mcp-server-authless.{your-account}.workers.dev/sse"
]
}
}
}
Connect to Cursor/Windsurf
- Find MCP server configuration in IDE settings
- Add remote MCP server endpoint
- Restart IDE to load new tools
Custom Development
Adding New Tools
Define new tools in the init() method of src/index.ts:
this.server.tool({
name: "custom_query",
description: "Execute custom SQL queries",
inputSchema: {
type: "object",
properties: {
query: {
type: "string",
description: "SQL query to execute"
}
},
required: ["query"]
}
}, async (args) => {
// Tool implementation logic
});
Database Schema Design
Create suitable table structures for D1 database:
CREATE TABLE projects (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
description TEXT,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
Use Cases
🔍 Data Analysis
- Quick database statistics queries
- Generate data reports and charts
- Execute complex data analysis queries
🛠️ Development & Debugging
- Real-time database status checking
- Validate API data correctness
- Quickly locate data issues
📊 Project Management
- Query project progress data
- Generate team performance reports
- Monitor application usage
🎯 Smart Assistant
- Give AI direct access to business data
- Provide context-relevant suggestions
- Automate data processing tasks
Technical Highlights
MCP Protocol Support
- Standardized AI tool calling protocol
- Seamless integration with mainstream AI clients
- Extensible tool definition framework
Edge Computing Advantages
- Global distributed deployment
- Millisecond response times
- Automatic scaling and load balancing
Modern Development Experience
- Full-stack TypeScript development
- Hot reload and rapid iteration
- Complete type safety
Best Practices
Security Considerations
- Implement appropriate data access controls
- Validate and sanitize user inputs
- Monitor and log access
Performance Optimization
- Use database indexes to optimize queries
- Implement query result caching
- Limit concurrent connections
Maintainability
- Write clear tool documentation
- Implement automated testing
- Version control and release management
Contributing
We welcome community contributions! Please follow these steps:
- Fork the project repository
- Create a feature branch
- Submit code changes
- Create a Pull Request
Support & Feedback
- GitHub Issues: Submit issues and suggestions
- Discussions: Participate in community discussions
- Twitter: Follow for latest updates
Related Resources
- MCP Protocol Documentation
- Cloudflare Workers Guide
- Cloudflare D1 Documentation
- Claude Desktop Integration Guide
License
This project is licensed under the MIT License - see the LICENSE file for details.
Enable AI to directly access your database through MCP protocol - Start the new era of intelligent development! 🚀