PKU220: Missing URI Property
Error Message
[PKU220] MCP resource is missing the required 'uri' property.
What Went Wrong
You're trying to register an MCP resource without providing a uri property. MCP resources use URIs instead of names for identification.
How to Fix
Add a uri property to your MCP resource:
import { addMCPResource } from '@pikku/core/mcp'
import { pikkuFunc } from '#pikku'
addMCPResource({
uri: 'file:///config/settings', // ✅ Add this
title: 'Application Settings',
description: 'Current application configuration',
func: pikkuFunc(async () => {
return { content: 'your resource data' }
}),
})
URI Format
MCP resource URIs typically follow these patterns:
file:///path/to/resource- File-based resourcescustom://namespace/resource- Custom protocol resourceshttps://example.com/api/resource- HTTP-based resources
Common Mistakes
- Using
nameinstead ofurifor resources (tools and prompts usename, resources useuri) - Providing an empty or invalid URI
- Forgetting the URI scheme (e.g.,
file://,https://)