Skip to content
23 changes: 23 additions & 0 deletions .changeset/upset-bugs-dress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
'workers-observability': patch
'cloudflare-casb-mcp-server': patch
'cloudflare-browser-mcp-server': patch
'containers-mcp': patch
'workers-bindings': patch
'docs-vectorize': patch
'workers-builds': patch
'@repo/mcp-common': patch
'dns-analytics': patch
'dex-analysis': patch
'docs-autorag': patch
'cloudflare-ai-gateway-mcp-server': patch
'auditlogs': patch
'demo-day': patch
'cloudflare-autorag-mcp-server': patch
'logpush': patch
'cloudflare-radar-mcp-server': patch
---

chore: add suffixes to common files in apps and packages

It can be confusing switching between 16 files named 'index.ts', or 3 files named workers.ts. This change renames common files to have suffixes such as .types.ts, .api.ts, etc. to make it easier to work across files in the monorepo.
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ import {
handleTokenExchangeCallback,
} from '@repo/mcp-common/src/cloudflare-oauth-handler'
import { handleDevMode } from '@repo/mcp-common/src/dev-mode'
import { getUserDetails, UserDetails } from '@repo/mcp-common/src/durable-objects/user_details'
import { getUserDetails, UserDetails } from '@repo/mcp-common/src/durable-objects/user_details.do'
import { getEnv } from '@repo/mcp-common/src/env'
import { RequiredScopes } from '@repo/mcp-common/src/scopes'
import { CloudflareMCPServer } from '@repo/mcp-common/src/server'
import { registerAccountTools } from '@repo/mcp-common/src/tools/account'
import { registerAccountTools } from '@repo/mcp-common/src/tools/account.tools'

import { MetricsTracker } from '../../../packages/mcp-observability/src'
import { registerAIGatewayTools } from './tools/ai-gateway'
import { registerAIGatewayTools } from './tools/ai-gateway.tools'

import type { AuthProps } from '@repo/mcp-common/src/cloudflare-oauth-handler'
import type { Env } from './context'
import type { Env } from './ai-gateway.context'

const env = getEnv<Env>()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { UserDetails } from '@repo/mcp-common/src/durable-objects/user_details'
import type { AIGatewayMCP } from './index'
import type { UserDetails } from '@repo/mcp-common/src/durable-objects/user_details.do'
import type { AIGatewayMCP } from './ai-gateway.app'

export interface Env {
OAUTH_KV: KVNamespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getCloudflareClient } from '@repo/mcp-common/src/cloudflare-api'
import { GatewayIdParam, ListLogsParams, LogIdParam, pageParam, perPageParam } from '../types'

import type { LogListParams } from 'cloudflare/resources/ai-gateway'
import type { AIGatewayMCP } from '../index'
import type { AIGatewayMCP } from '../ai-gateway.app'

export function registerAIGatewayTools(agent: AIGatewayMCP) {
agent.server.tool(
Expand Down
2 changes: 1 addition & 1 deletion apps/ai-gateway/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineWorkersConfig } from '@cloudflare/vitest-pool-workers/config'

import type { Env } from './src/context'
import type { Env } from './src/ai-gateway.context'

export interface TestEnv extends Env {
CLOUDFLARE_MOCK_ACCOUNT_ID: string
Expand Down
2 changes: 1 addition & 1 deletion apps/ai-gateway/wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
{
"$schema": "node_modules/wrangler/config-schema.json",
"main": "src/index.ts",
"main": "src/ai-gateway.app.ts",
"compatibility_date": "2025-03-10",
"compatibility_flags": ["nodejs_compat"],
"name": "mcp-cloudflare-ai-gateway-dev",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ import {
handleTokenExchangeCallback,
} from '@repo/mcp-common/src/cloudflare-oauth-handler'
import { handleDevMode } from '@repo/mcp-common/src/dev-mode'
import { getUserDetails, UserDetails } from '@repo/mcp-common/src/durable-objects/user_details'
import { getUserDetails, UserDetails } from '@repo/mcp-common/src/durable-objects/user_details.do'
import { getEnv } from '@repo/mcp-common/src/env'
import { RequiredScopes } from '@repo/mcp-common/src/scopes'
import { CloudflareMCPServer } from '@repo/mcp-common/src/server'
import { registerAccountTools } from '@repo/mcp-common/src/tools/account'
import { registerAccountTools } from '@repo/mcp-common/src/tools/account.tools'

import { MetricsTracker } from '../../../packages/mcp-observability/src'
import { registerAuditLogTools } from './tools/auditlogs'
import { registerAuditLogTools } from './tools/auditlogs.tools'

import type { AuthProps } from '@repo/mcp-common/src/cloudflare-oauth-handler'
import type { Env } from './context'
import type { Env } from './auditlogs.context'

const env = getEnv<Env>()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { UserDetails } from '@repo/mcp-common/src/durable-objects/user_details'
import type { AuditlogMCP } from './index'
import type { UserDetails } from '@repo/mcp-common/src/durable-objects/user_details.do'
import type { AuditlogMCP } from './auditlogs.app'

export interface Env {
OAUTH_KV: KVNamespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { z } from 'zod'

import { fetchCloudflareApi } from '@repo/mcp-common/src/cloudflare-api'

import type { AuditlogMCP } from '../index'
import type { AuditlogMCP } from '../auditlogs.app'

export const actionResults = z.enum(['success', 'failure', ''])
export const actionTypes = z.enum(['create', 'delete', 'view', 'update', 'login'])
Expand Down
2 changes: 1 addition & 1 deletion apps/auditlogs/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineWorkersConfig } from '@cloudflare/vitest-pool-workers/config'

import type { Env } from './src/context'
import type { Env } from './src/auditlogs.context'

export interface TestEnv extends Env {
CLOUDFLARE_MOCK_ACCOUNT_ID: string
Expand Down
2 changes: 1 addition & 1 deletion apps/auditlogs/wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
{
"$schema": "node_modules/wrangler/config-schema.json",
"main": "src/index.ts",
"main": "src/auditlogs.app.ts",
"compatibility_date": "2025-03-10",
"compatibility_flags": ["nodejs_compat"],
"name": "mcp-cloudflare-auditlogs-dev",
Expand Down
8 changes: 4 additions & 4 deletions apps/autorag/src/index.ts → apps/autorag/src/autorag.app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ import {
handleTokenExchangeCallback,
} from '@repo/mcp-common/src/cloudflare-oauth-handler'
import { handleDevMode } from '@repo/mcp-common/src/dev-mode'
import { getUserDetails, UserDetails } from '@repo/mcp-common/src/durable-objects/user_details'
import { getUserDetails, UserDetails } from '@repo/mcp-common/src/durable-objects/user_details.do'
import { getEnv } from '@repo/mcp-common/src/env'
import { RequiredScopes } from '@repo/mcp-common/src/scopes'
import { CloudflareMCPServer } from '@repo/mcp-common/src/server'
import { registerAccountTools } from '@repo/mcp-common/src/tools/account'
import { registerAccountTools } from '@repo/mcp-common/src/tools/account.tools'

import { MetricsTracker } from '../../../packages/mcp-observability/src'
import { registerAutoRAGTools } from './tools/autorag'
import { registerAutoRAGTools } from './tools/autorag.tools'

import type { AuthProps } from '@repo/mcp-common/src/cloudflare-oauth-handler'
import type { Env } from './context'
import type { Env } from './autorag.context'

const env = getEnv<Env>()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { UserDetails } from '@repo/mcp-common/src/durable-objects/user_details'
import type { AutoRAGMCP } from './index'
import type { UserDetails } from '@repo/mcp-common/src/durable-objects/user_details.do'
import type { AutoRAGMCP } from './autorag.app'

export interface Env {
OAUTH_KV: KVNamespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getCloudflareClient } from '@repo/mcp-common/src/cloudflare-api'

import { pageParam, perPageParam } from '../types'

import type { AutoRAGMCP } from '../index'
import type { AutoRAGMCP } from '../autorag.app'

import V4PagePaginationArray = Cloudflare.V4PagePaginationArray

Expand Down
2 changes: 1 addition & 1 deletion apps/autorag/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineWorkersConfig } from '@cloudflare/vitest-pool-workers/config'

import type { Env } from './src/context'
import type { Env } from './src/autorag.context'

export interface TestEnv extends Env {
CLOUDFLARE_MOCK_ACCOUNT_ID: string
Expand Down
2 changes: 1 addition & 1 deletion apps/autorag/wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
{
"$schema": "node_modules/wrangler/config-schema.json",
"main": "src/index.ts",
"main": "src/autorag.app.ts",
"compatibility_date": "2025-03-10",
"compatibility_flags": ["nodejs_compat"],
"name": "mcp-cloudflare-autorag-dev",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ import {
handleTokenExchangeCallback,
} from '@repo/mcp-common/src/cloudflare-oauth-handler'
import { handleDevMode } from '@repo/mcp-common/src/dev-mode'
import { getUserDetails, UserDetails } from '@repo/mcp-common/src/durable-objects/user_details'
import { getUserDetails, UserDetails } from '@repo/mcp-common/src/durable-objects/user_details.do'
import { getEnv } from '@repo/mcp-common/src/env'
import { RequiredScopes } from '@repo/mcp-common/src/scopes'
import { CloudflareMCPServer } from '@repo/mcp-common/src/server'
import { registerAccountTools } from '@repo/mcp-common/src/tools/account'
import { registerAccountTools } from '@repo/mcp-common/src/tools/account.tools'

import { MetricsTracker } from '../../../packages/mcp-observability/src'
import { registerBrowserTools } from './tools/browser'
import { registerBrowserTools } from './tools/browser.tools'

import type { AuthProps } from '@repo/mcp-common/src/cloudflare-oauth-handler'
import type { Env } from './context'
import type { Env } from './browser.context'

const env = getEnv<Env>()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { UserDetails } from '@repo/mcp-common/src/durable-objects/user_details'
import type { BrowserMCP } from './index'
import type { UserDetails } from '@repo/mcp-common/src/durable-objects/user_details.do'
import type { BrowserMCP } from './browser.app'

export interface Env {
OAUTH_KV: KVNamespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { z } from 'zod'

import { getCloudflareClient } from '@repo/mcp-common/src/cloudflare-api'

import type { BrowserMCP } from '../index'
import type { BrowserMCP } from '../browser.app'

export function registerBrowserTools(agent: BrowserMCP) {
agent.server.tool(
Expand Down
2 changes: 1 addition & 1 deletion apps/browser-rendering/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineWorkersConfig } from '@cloudflare/vitest-pool-workers/config'

import type { Env } from './src/context'
import type { Env } from './src/browser.context'

export interface TestEnv extends Env {
CLOUDFLARE_MOCK_ACCOUNT_ID: string
Expand Down
2 changes: 1 addition & 1 deletion apps/browser-rendering/wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
{
"$schema": "node_modules/wrangler/config-schema.json",
"main": "src/index.ts",
"main": "src/browser.app.ts",
"compatibility_date": "2025-03-10",
"compatibility_flags": ["nodejs_compat"],
"name": "mcp-cloudflare-browser-dev",
Expand Down
2 changes: 1 addition & 1 deletion apps/cloudflare-one-casb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This is a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) server that supports remote MCP connections, with Cloudflare OAuth built-in.

You should use this as a template to build an MCP server for Cloudflare, provided by Cloudflare at `server-name.mcp.cloudflare.com`. It has a basic set of tools `apps/template-start-here/src/tools/logs.ts` — you can modify these to do what you need
You should use this as a template to build an MCP server for Cloudflare, provided by Cloudflare at `server-name.mcp.cloudflare.com`. It has a basic set of tools `apps/template-start-here/src/tools/logpush.tools.ts` — you can modify these to do what you need

## Getting Started

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ import {
handleTokenExchangeCallback,
} from '@repo/mcp-common/src/cloudflare-oauth-handler'
import { handleDevMode } from '@repo/mcp-common/src/dev-mode'
import { getUserDetails, UserDetails } from '@repo/mcp-common/src/durable-objects/user_details'
import { getUserDetails, UserDetails } from '@repo/mcp-common/src/durable-objects/user_details.do'
import { getEnv } from '@repo/mcp-common/src/env'
import { RequiredScopes } from '@repo/mcp-common/src/scopes'
import { CloudflareMCPServer } from '@repo/mcp-common/src/server'
import { registerAccountTools } from '@repo/mcp-common/src/tools/account'
import { registerAccountTools } from '@repo/mcp-common/src/tools/account.tools'

import { MetricsTracker } from '../../../packages/mcp-observability/src'
import { registerIntegrationsTools } from './tools/integrations'
import { registerIntegrationsTools } from './tools/integrations.tools'

import type { AuthProps } from '@repo/mcp-common/src/cloudflare-oauth-handler'
import type { Env } from './context'
import type { Env } from './cf1-casb.context'

export { UserDetails }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { CASBMCP, UserDetails } from './index'
import type { CASBMCP, UserDetails } from './cf1-casb.app'

export interface Env {
ENVIRONMENT: 'development' | 'staging' | 'production'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { z } from 'zod'

import { withAccountCheck } from '@repo/mcp-common/src/api/account'
import { withAccountCheck } from '@repo/mcp-common/src/api/account.api'
import {
handleAssetById,
handleAssetCategories,
Expand All @@ -10,14 +10,14 @@ import {
handleAssetsSearch,
handleIntegrationById,
handleIntegrations,
} from '@repo/mcp-common/src/api/cf1-integration'
} from '@repo/mcp-common/src/api/cf1-integration.api'
import {
assetCategoryTypeParam,
assetCategoryVendorParam,
} from '@repo/mcp-common/src/schemas/cf1-integrations'
} from '@repo/mcp-common/src/types/cf1-integrations.types'

import type { ToolDefinition } from '@repo/mcp-common/src/types/tools'
import type { CASBMCP } from '../index'
import type { ToolDefinition } from '@repo/mcp-common/src/types/tools.types'
import type { CASBMCP } from '../cf1-casb.app'

const PAGE_SIZE = 3

Expand Down
2 changes: 1 addition & 1 deletion apps/cloudflare-one-casb/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineWorkersConfig } from '@cloudflare/vitest-pool-workers/config'

import type { Env } from './src/context'
import type { Env } from './src/cf1-casb.context'

export interface TestEnv extends Env {
CLOUDFLARE_MOCK_ACCOUNT_ID: string
Expand Down
2 changes: 1 addition & 1 deletion apps/cloudflare-one-casb/wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
{
"$schema": "node_modules/wrangler/config-schema.json",
"main": "src/index.ts",
"main": "src/cf1-casb.app.ts",
"compatibility_date": "2025-03-10",
"compatibility_flags": ["nodejs_compat"],
"migrations": [
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion apps/demo-day/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "@repo/typescript-config/workers.json",
"include": ["src/index.ts"],
"include": ["src/demo-day.app.ts"],
"compilerOptions": {
"types": ["@types/node"]
}
Expand Down
2 changes: 1 addition & 1 deletion apps/demo-day/wrangler.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "node_modules/wrangler/config-schema.json",
"main": "src/index.ts",
"main": "src/demo-day.app.ts",
"compatibility_date": "2025-03-10",
"compatibility_flags": ["nodejs_compat"],
"account_id": "6702657b6aa048cf3081ff3ff3c9c52f",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ import {
handleTokenExchangeCallback,
} from '@repo/mcp-common/src/cloudflare-oauth-handler'
import { handleDevMode } from '@repo/mcp-common/src/dev-mode'
import { getUserDetails, UserDetails } from '@repo/mcp-common/src/durable-objects/user_details'
import { getUserDetails, UserDetails } from '@repo/mcp-common/src/durable-objects/user_details.do'
import { getEnv } from '@repo/mcp-common/src/env'
import { RequiredScopes } from '@repo/mcp-common/src/scopes'
import { CloudflareMCPServer } from '@repo/mcp-common/src/server'
import { registerAccountTools } from '@repo/mcp-common/src/tools/account'
import { registerAccountTools } from '@repo/mcp-common/src/tools/account.tools'
import { MetricsTracker } from '@repo/mcp-observability'

import { registerDEXTools } from './tools/dex'
import { registerDEXTools } from './tools/dex-analysis.tools'

import type { AuthProps } from '@repo/mcp-common/src/cloudflare-oauth-handler'
import type { Env } from './context'
import type { Env } from './dex-analysis.context'

export { UserDetails }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { UserDetails } from '@repo/mcp-common/src/durable-objects/user_details'
import type { CloudflareDEXMCP } from './index'
import type { UserDetails } from '@repo/mcp-common/src/durable-objects/user_details.do'
import type { CloudflareDEXMCP } from './dex-analysis.app'

export interface Env {
OAUTH_KV: KVNamespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { z } from 'zod'

import { fetchDexTestAnalyzation, fetchDexTests } from '../api/dex'

import type { CloudflareDEXMCP } from '../index'
import type { CloudflareDEXMCP } from '../dex-analysis.app'

// DEX parameter schema
const dexTestIdParam = z.string().describe('The DEX Test ID to analyze details of.')
Expand Down
2 changes: 1 addition & 1 deletion apps/dex-analysis/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineWorkersConfig } from '@cloudflare/vitest-pool-workers/config'

import type { Env } from './src/context'
import type { Env } from './src/dex-analysis.context'

export interface TestEnv extends Env {
CLOUDFLARE_MOCK_ACCOUNT_ID: string
Expand Down
Loading