Track MCP LogoTrack MCP
Track MCP LogoTrack MCP

The world's largest repository of Model Context Protocol servers. Discover, explore, and submit MCP tools.

Product

  • Categories
  • Top MCP
  • New & Updated
  • Submit MCP

Company

  • About

Legal

  • Privacy Policy
  • Terms of Service
  • Cookie Policy

© 2026 TrackMCP. All rights reserved.

Built with ❤️ by Krishna Goyal

    Mcp With D1 Data

    Demo MCP Server build using Cloudflare MCPAgent Durable Objects and D1 database

    2 stars
    TypeScript
    Updated Jun 20, 2025
    cloudflare
    cloudflare-d1
    cloudflare-kv
    cloudflare-workers
    mcp

    Table of Contents

    • Overview
    • Features
    • Database
    • MCP Server (MyMCP)
    • Query Tool
    • Introspection Tool
    • Integration Tests
    • Project Structure
    • Getting Started
    • Prerequisites
    • Installation
    • Development
    • Deployment
    • License

    Table of Contents

    • Overview
    • Features
    • Database
    • MCP Server (MyMCP)
    • Query Tool
    • Introspection Tool
    • Integration Tests
    • Project Structure
    • Getting Started
    • Prerequisites
    • Installation
    • Development
    • Deployment
    • License

    Documentation

    MCP Server: Demo

    Overview

    This repository serves as a demonstration of building an MCP (Model Context Protocol) server that can access and query actual database information. Uses

    the @modelcontextprotocol/sdk library leveraging Cloudflare's MCPAgent to implement tools, manage resources, and a D1 database.

    Features

    Database

    The project integrates with a D1 database (mcp-agent-d1-data) to retrieve data but you should be able to work with any database with some minor adjustments on the tools. Also included some niceties:

    • Schema Management: SQL migration files (up.sql, down.sql, seed.sql) in the db/ directory manage the database schema and seed data.

    MCP Server (MyMCP)

    The MyMCP class extends the McpAgent class from the @modelcontextprotocol/sdk library. It acts as the core server implementation, providing server sent events (SSE) as a foundational transport.

    • Durable Object: The server is implemented as a Durable Object, which allows stateful interactions and long process operations. It also comes with hibernation built-in when idle.

    Query Tool

    The query tool is designed to interact with the database by providing an interface where the LLM can send SQL queries onto the database. Use with care in production environments and practice proper authorization safeguards.

    Introspection Tool

    The schema-introspection tool is particularly useful to help the LLM understand the structure of the database to produce a more accurate query design.

    Integration Tests

    Included integration tests in the tests/ directory to get started. Validate the functionality of the MCP server and its tools, or use the tests for TDD.

    bash
    npm run test

    Project Structure

    code
    📦 d1-mcp
    ├── package.json
    ├── README.md
    ├── tsconfig.json
    ├── vitest.config.js
    ├── worker-configuration.d.ts
    ├── wrangler.jsonc
    ├── db
    │   ├── down.sql
    │   ├── seed.sql
    │   └── up.sql
    ├── public
    │   └── index.html
    ├── src
    │   ├── index.ts
    │   ├── metadata.ts
    │   ├── tools.ts
    │   └── utils.ts
    └── tests
        ├── index.test.ts
        └── tsconfig.json

    Getting Started

    Prerequisites

    • Node.js
    • Cloudflare Workers CLI (wrangler)

    Installation

    1. Clone the repository.

    2. Install dependencies:

    bash
    npm install

    Development

    • Start the development server:
    bash
    npm run dev

    Deployment

    • Deploy to Cloudflare Workers:
    bash
    npm run deploy

    License

    This project is licensed under the MIT License.

    Similar MCP

    Based on tags & features

    • MC

      Mcp Open Library

      TypeScript·
      42
    • AN

      Anilist Mcp

      TypeScript·
      57
    • MC

      Mcp Server Kubernetes

      TypeScript·
      1.1k
    • BR

      Browser Control Mcp

      TypeScript·
      183

    Trending MCP

    Most active this week

    • PL

      Playwright Mcp

      TypeScript·
      22.1k
    • SE

      Serena

      Python·
      14.5k
    • MC

      Mcp Playwright

      TypeScript·
      4.9k
    • MC

      Mcp Server Cloudflare

      TypeScript·
      3.0k
    View All MCP Servers

    Similar MCP

    Based on tags & features

    • MC

      Mcp Open Library

      TypeScript·
      42
    • AN

      Anilist Mcp

      TypeScript·
      57
    • MC

      Mcp Server Kubernetes

      TypeScript·
      1.1k
    • BR

      Browser Control Mcp

      TypeScript·
      183

    Trending MCP

    Most active this week

    • PL

      Playwright Mcp

      TypeScript·
      22.1k
    • SE

      Serena

      Python·
      14.5k
    • MC

      Mcp Playwright

      TypeScript·
      4.9k
    • MC

      Mcp Server Cloudflare

      TypeScript·
      3.0k