vercel/ai · error · MCPClientError
Server does not support prompts
Error message
Server does not support prompts
What it means
MCPClientError thrown by assertCapability when 'prompts/list' or 'prompts/get' is requested but the server did not advertise the `prompts` capability during the initialize handshake. The client checks `this.serverCapabilities.prompts` before dispatching the request.
Source
Thrown at packages/mcp/src/tool/mcp-client.ts:741
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}`,
});
}
}
private async request<T extends z.ZodType<object>>({
request,
resultSchema,
options,
}: {
request: Request;
resultSchema: T;View on GitHub (pinned to 69428b1f8b)
Solutions
- Confirm the server advertises `prompts` in its initialize capabilities
- Call and await init() before prompts/* requests
- Use a server that implements the prompts capability, or refactor to retrieve prompts another way (e.g. resources or a local template store)
- Verify you are connecting to the intended MCP server URL
Example fix
// before
const prompts = await client.listPrompts({ params: {} });
// after
await client.init();
try {
const prompts = await client.listPrompts({ params: {} });
} catch (error) {
if (MCPClientError.isInstance(error)) {
// handle prompts unsupported: fall back to local prompt templates
}
} Defensive patterns
Strategy: try-catch
Validate before calling
await client.init();
const promptsSupported = !!initResult.capabilities?.prompts;
if (!promptsSupported) throw new Error('Server does not expose prompts'); Type guard
function isPromptsUnsupported(error: unknown): error is MCPClientError {
return MCPClientError.isInstance(error) && error.message.includes('does not support prompts');
} Try / catch
try {
const prompts = await client.listPrompts({ params: {} });
} catch (error) {
if (MCPClientError.isInstance(error) && error.message.includes('does not support prompts')) {
// fall back to local prompt templates
} else {
throw error;
}
} Prevention
- Confirm prompt support in the initialize handshake before wiring prompt UI
- Await client init before prompts/* calls
- Maintain local fallback prompt templates for servers without prompts capability
When it happens
Trigger: Calling client.listPrompts() or a prompts/get request against a server whose initialize result omits `capabilities.prompts`, or calling before init() so serverCapabilities is still {}.
Common situations: Pointing prompt-template UI code at a tools-only MCP server (most MCP servers implement tools but not prompts); server was updated/rolled back and dropped prompt support; client connected to the wrong endpoint URL.
Related errors
- Server does not support tools
- Server does not support resources
- Unsupported method: ${method}
- ACP MCP server name "ai-sdk-harness-tools" is reserved for H
- ACP MCP server name "ai-sdk-harness-tools" is reserved for H
AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30).
Data as JSON: /api/errors/04c20aae72275faa.
Report an issue: GitHub.