Skip to content

Conversation

@ajaypv
Copy link

@ajaypv ajaypv commented Dec 25, 2025

Problem

When using the template via:

npm create cloudflare@latest -- my-mcp-server --template=cloudflare/ai/demos/remote-mcp-authless

Running pnpm dev or npm run dev fails with:

Could not resolve "ai"
Could not resolve "@modelcontextprotocol/sdk/server/mcp.js"

Root Cause

The agents package requires @modelcontextprotocol/sdk and ai as peer dependencies, but they were not listed in package.json.

Solution

Added the missing dependencies:

  • @modelcontextprotocol/sdk: ^1.23.0
  • ai: ^6.0.3

Testing

  1. Created project using the template
  2. Ran pnpm install
  3. Ran pnpm dev
  4. Server starts successfully ✅

Environment

  • OS: Windows 11
  • Node: v22.x
  • pnpm: 10.6.2
  • wrangler: 4.54.0

@changeset-bot
Copy link

changeset-bot bot commented Dec 25, 2025

⚠️ No Changeset found

Latest commit: 9f1c8f1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

The agents package requires @modelcontextprotocol/sdk and ai as peer
dependencies, but they were not listed in package.json. This caused
build failures when running the template locally with wrangler dev.

Note: @modelcontextprotocol/sdk version must match what agents@0.3.0
uses internally (1.23.0) to avoid TypeScript type conflicts.

Errors fixed:
- Could not resolve 'ai'
- Could not resolve '@modelcontextprotocol/sdk/server/mcp.js'
@ajaypv ajaypv force-pushed the fix/remote-mcp-authless-missing-deps branch from ddbc5f5 to 9f1c8f1 Compare December 25, 2025 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant