Prerequisites
- Ensure you have
npx installed on your system.
- Make sure you have a Cloudflare account with the necessary subscription level for the features you intend to use.
Installation
-
Initialize MCP Server:
Run the following command to initialize the MCP server for Cloudflare:
npx @cloudflare/mcp-server-cloudflare init
Note: If you are not authenticated with Cloudflare, the MCP server will automatically run npx wrangler login and prompt you to complete the authentication process in your browser.
-
Restart Claude Desktop:
After initializing the MCP server, restart Claude Desktop. You should see a small icon indicating the available tools for use.
Development Setup
-
Install Dependencies:
In the current project folder, run:
pnpm install
-
Build and Watch:
Build the project and watch for changes by running:
pnpm build:watch
-
Link Claude Desktop:
In a second terminal, run:
node dist/index.js init
This will link Claude Desktop against your locally-installed version for testing. If not authenticated with Wrangler, the server will prompt you to authenticate in your browser.
Testing
-
Run All Tests:
Execute all tests using:
pnpm test
-
Run Tests with Coverage:
To run tests with coverage, use:
pnpm test:coverage
-
Run a Specific Test File:
To run a specific test file, execute:
pnpm test -- tests/tools/queues.test.ts
-
Run Tests in Watch Mode:
For development, run tests in watch mode:
pnpm test:watch
Usage Outside of Claude
npx installed on your system.Initialize MCP Server:
Run the following command to initialize the MCP server for Cloudflare:
npx @cloudflare/mcp-server-cloudflare init
Note: If you are not authenticated with Cloudflare, the MCP server will automatically run npx wrangler login and prompt you to complete the authentication process in your browser.
Restart Claude Desktop:
After initializing the MCP server, restart Claude Desktop. You should see a small icon indicating the available tools for use.
Install Dependencies:
In the current project folder, run:
pnpm install
Build and Watch:
Build the project and watch for changes by running:
pnpm build:watch
Link Claude Desktop:
In a second terminal, run:
node dist/index.js init
This will link Claude Desktop against your locally-installed version for testing. If not authenticated with Wrangler, the server will prompt you to authenticate in your browser.
Run All Tests:
Execute all tests using:
pnpm test
Run Tests with Coverage:
To run tests with coverage, use:
pnpm test:coverage
Run a Specific Test File:
To run a specific test file, execute:
pnpm test -- tests/tools/queues.test.ts
Run Tests in Watch Mode:
For development, run tests in watch mode:
pnpm test:watch
To run the server locally, use the following command:
node dist/index run <account-id>
Contribution
Contributions are welcome! Please feel free to submit a Pull Request.