Skip to main content

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 resources
  • custom://namespace/resource - Custom protocol resources
  • https://example.com/api/resource - HTTP-based resources

Common Mistakes

  • Using name instead of uri for resources (tools and prompts use name, resources use uri)
  • Providing an empty or invalid URI
  • Forgetting the URI scheme (e.g., file://, https://)
  • PKU111 - Missing Name (for tools/prompts)
  • PKU123 - Missing Description
  • PKU370 - Missing Title