vercel/ai · error · MCPClientError

Server does not support resources

Error message

Server does not support resources

What it means

MCPClientError thrown by assertCapability when 'resources/list', 'resources/read', or 'resources/templates/list' is requested but the server did not advertise the `resources` capability during initialize. The client validates `this.serverCapabilities.resources` before dispatching, avoiding a guaranteed server-side rejection.

Source

Thrown at packages/mcp/src/tool/mcp-client.ts:733

        if (!this.serverCapabilities.completions) {
          throw new MCPClientError({
            message: `Server does not support completions`,
          });
        }
        break;
      case 'tools/list':
      case 'tools/call':
        if (!this.serverCapabilities.tools) {
          throw new MCPClientError({
            message: `Server does not support tools`,
          });
        }
        break;
      case 'resources/list':
      case 'resources/read':
      case 'resources/templates/list':
        if (!this.serverCapabilities.resources) {
          throw new MCPClientError({
            message: `Server does not support resources`,
          });
        }
        break;
      case 'prompts/list':
      case 'prompts/get':
        if (!this.serverCapabilities.prompts) {
          throw new MCPClientError({
            message: `Server does not support prompts`,
          });
        }
        break;
      default:
        throw new MCPClientError({
          message: `Unsupported method: ${method}`,
        });
    }
  }

View on GitHub (pinned to 69428b1f8b)

Solutions

  1. Check the server's advertised capabilities in the initialize response before calling resource methods
  2. Await client.init() before any resources/* request so capabilities are negotiated
  3. Use a server that implements the resources capability, or migrate to tool-based access if that is all the server offers
  4. Guard resource calls behind a capability check in application code

Example fix

// before
await client.init();
const resources = await client.listResources({ params: {} });

// after
await client.init();
if (!serverAdvertisesResources) {
  throw new Error('This MCP server does not expose resources; use tools instead');
}
const resources = await client.listResources({ params: {} });
Defensive patterns

Strategy: try-catch

Validate before calling

await client.init();
const resourcesSupported = !!initResult.capabilities?.resources;
if (!resourcesSupported) throw new Error('Server does not expose resources');

Type guard

function isResourcesUnsupported(error: unknown): error is MCPClientError {
  return MCPClientError.isInstance(error) && error.message.includes('does not support resources');
}

Try / catch

try {
  const resources = await client.listResources({ params: {} });
} catch (error) {
  if (MCPClientError.isInstance(error) && error.message.includes('does not support resources')) {
    // degrade gracefully: skip resource UI or use tools
  } else {
    throw error;
  }
}

Prevention

When it happens

Trigger: Calling client.listResources(), client.readResource(), or listResourceTemplates() against a server whose initialize result lacks `capabilities.resources`, or before init() has populated serverCapabilities.

Common situations: Using a tools-only MCP server (the most common server type, e.g. filesystem or database tool servers) and assuming it also exposes resources; connecting to a minimal server implementation; stale client code written for a server that later dropped resource support.

Related errors


AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30). Data as JSON: /api/errors/d2e1e6f040de886e. Report an issue: GitHub.