---
title: "Groups & organization"
description: "group and tags, on-disk layout, URI schemes, and conditional registration."
canonical_url: "https://mcp-toolkit.nuxt.dev/resources/organization"
---
# Groups & organization

> group and tags, on-disk layout, URI schemes, and conditional registration.

## Groups and Tags

Organize your resources with `group` and `tags` for categorization. These fields work the same way as for [tools](https://mcp-toolkit.nuxt.dev/tools/groups-organization#groups-and-tags).

```typescript [server/mcp/resources/config/app-settings.ts]
import { defineMcpResource } from '@nuxtjs/mcp-toolkit/server'

export default defineMcpResource({
  group: 'config',
  tags: ['readonly', 'settings'],
  description: 'Application settings',
  file: 'config/app.json',
})
```

You can also place resource files in subdirectories to auto-infer the group:

```text
server/mcp/resources/
├── config/
│   └── app-settings.ts   → group: 'config'
├── docs/
│   └── readme.ts         → group: 'docs'
└── schema.ts             → no group
```

<callout color="info" icon="i-lucide-info">

Resource `group` and `tags` are stored on the definition objects but are not yet included in `resources/list` protocol responses. This will be supported when [SEP-1300](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1300) is adopted by the MCP SDK.

</callout>

## File Organization

Organize your resources in the `server/mcp/resources/` directory. Both flat and nested layouts are supported:

```text
server/
└── mcp/
    └── resources/
        ├── readme.ts
        ├── file.ts
        └── config/
            └── app-settings.ts
```

Each file should export a default resource definition. Subdirectories automatically set the `group`.

## URI Schemes

You can use any URI scheme that makes sense for your use case:

- `file://` - File system resources
- `api://` - API endpoints
- `http://` / `https://` - Web resources
- `custom://` - Custom schemes

## Conditional Registration

You can control whether a resource is visible to clients using the `enabled` guard:

```typescript [server/mcp/resources/internal-data.ts]
export default defineMcpResource({
  name: 'internal-data',
  uri: 'app://internal',
  enabled: event => event.context.user?.role === 'admin',
  handler: async (uri) => ({
    contents: [{ uri: uri.toString(), text: 'Internal data...' }],
  }),
})
```

<callout color="primary" icon="i-lucide-book-open">

See the [Dynamic Definitions](https://mcp-toolkit.nuxt.dev/advanced/dynamic-definitions) guide for detailed documentation on auth-based filtering.

</callout>

## Next Steps

- [Tools](https://mcp-toolkit.nuxt.dev/tools/overview) - Create tools to perform actions
- [Prompts](https://mcp-toolkit.nuxt.dev/prompts/overview) - Create reusable prompts
- [Handlers](https://mcp-toolkit.nuxt.dev/handlers/overview) - Create custom MCP endpoints
- [Dynamic Definitions](https://mcp-toolkit.nuxt.dev/advanced/dynamic-definitions) - Conditionally register definitions
- [Examples](https://mcp-toolkit.nuxt.dev/examples/file-operations) - More resource examples


## Sitemap

See the full [sitemap](https://mcp-toolkit.nuxt.dev/sitemap.md) for all pages.
