Skip to main content
Glama

cloudflare-api-mcp

Это облегченный сервер протокола управления моделью (MCP), загружаемый с помощью create-mcp и развернутый на Cloudflare Workers.

Этот сервер MCP позволяет агентам (таким как Cursor) взаимодействовать с Cloudflare REST API .

Он все еще находится в стадии разработки, я буду добавлять больше инструментов по мере необходимости.

Доступные инструменты

Текущий список инструментов см. в src/index.ts. Каждый метод в классе — это инструмент MCP.

Установка

  1. Запустите скрипт автоматической установки, чтобы клонировать этот сервер MCP и развернуть его в своей учетной записи Cloudflare:

bun create mcp --clone https://github.com/zueai/cloudflare-api-mcp
  1. Откройте Cursor Settings -> MCP -> Add new MCP server и вставьте скопированную в буфер обмена команду.

  2. Загрузите свой ключ API Cloudflare и адрес электронной почты в ваши рабочие секреты:

bunx wrangler secret put CLOUDFLARE_API_KEY bunx wrangler secret put CLOUDFLARE_API_EMAIL

Местное развитие

Добавьте свой ключ API Cloudflare и адрес электронной почты в файл .dev.vars :

CLOUDFLARE_API_KEY=<your-cloudflare-api-key> CLOUDFLARE_API_EMAIL=<your-cloudflare-api-email>

Развертывание

  1. Запустите скрипт развертывания:

bun run deploy
  1. Перезагрузите окно курсора, чтобы увидеть новые инструменты.

Как создать новые инструменты MCP

Чтобы создать новые инструменты MCP, добавьте методы в класс MyWorker в src/index.ts . Каждая функция автоматически станет инструментом MCP, который может использовать ваш агент.

Пример:

/** * Create a new DNS record in a zone. * @param zoneId {string} The ID of the zone to create the record in. * @param name {string} The name of the DNS record. * @param content {string} The content of the DNS record. * @param type {string} The type of DNS record (CNAME, A, TXT, or MX). * @param comment {string} Optional comment for the DNS record. * @param proxied {boolean} Optional whether to proxy the record through Cloudflare. * @return {object} The created DNS record. */ createDNSRecord(zoneId: string, name: string, content: string, type: string, comment?: string, proxied?: boolean) { // Implementation }

Комментарии JSDoc важны:

  • Первая строка становится описанием инструмента.

  • Теги @param определяют параметры инструмента с типами и описаниями.

  • Тег @return определяет возвращаемое значение и тип.

Узнать больше

-
security - not tested
A
license - permissive license
-
quality - not tested

Related MCP Servers

  • -
    security
    A
    license
    -
    quality
    A lightweight MCP server that interacts with the Neon REST API, deployable on Cloudflare Workers for streamlined database management and integration.
    Last updated -
    10
    MIT License
  • -
    security
    A
    license
    -
    quality
    A lightweight MCP server for managing DNS records, purging cache, and interacting with the Cloudflare API through natural language commands.
    Last updated -
    22
    MIT License
  • -
    security
    A
    license
    -
    quality
    An MCP server that allows using natural language to manage Cloudflare resources (Workers, KV, R2, D1) through Claude Desktop, VSCode, and other MCP clients.
    Last updated -
    11
    9
    Apache 2.0
  • -
    security
    F
    license
    -
    quality
    A deployable authentication-free MCP (Model Context Protocol) server on Cloudflare Workers that allows you to add custom tools and connect to AI clients like Claude Desktop or Cloudflare AI Playground.
    Last updated -

View all related MCP servers

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/fefergrgrgrg/cloudflare-api-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server