跳到正文

Remote MCP Server - Authless Database Communication

不活跃
elizabethsiegle/remote-mcp-server-authless-talk-to-db

部署在 Cloudflare Workers 上的远程 MCP 服务器,无需认证即可与 Cloudflare D1 数据库通信。通过标准的模型上下文协议,将 Windsurf、Cursor、Claude Desktop 等 AI 编程工具直接连接到你的数据库。

在 GitHub 查看
星标
1
Fork
1
关注
1
未关闭 Issue
0

该介绍目前仅提供英文版本。

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

  1. Clone Repository

    git clone https://github.com/elizabethsiegle/remote-mcp-server-authless-talk-to-db.git
    cd remote-mcp-server-authless-talk-to-db
  2. Install Dependencies

    npm install
  3. Configure Environment

    • Login to Cloudflare account
    • Create D1 database
    • Configure wrangler.jsonc
  4. Deploy to Workers

    npm run deploy

Usage Guide

Connect to Cloudflare AI Playground

  1. Visit https://playground.ai.cloudflare.com/
  2. Enter your MCP server URL: remote-mcp-server-authless.{your-account}.workers.dev/sse
  3. 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

  1. Find MCP server configuration in IDE settings
  2. Add remote MCP server endpoint
  3. 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:

  1. Fork the project repository
  2. Create a feature branch
  3. Submit code changes
  4. Create a Pull Request

Support & Feedback

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! 🚀

按共同分类和标签排序的同类开源项目。

全部 AI 项目 →