Resources
mcdbus exposes three MCP resource templates that provide read-only snapshots of D-Bus structure. Resources use a dbus:// URI scheme and return plain-text, newline-separated data.
When to use resources vs tools
Section titled “When to use resources vs tools”Resources are best for loading context into a conversation. An MCP client can attach a resource URI and the server returns the current state as a text block. Resources are stateless, read-only, and produce compact output suitable for context windows.
Tools are better for interactive exploration where you need formatted output, progress reporting, filtering options, or write operations. The list_services tool, for example, returns a Markdown-formatted list with a count header, while the dbus://{bus}/services resource returns raw service names one per line.
Use resources when you want to seed a conversation with structural context. Use tools when you need to drill into specifics or take action.
dbus://{bus}/services
Section titled “dbus://{bus}/services”Live list of well-known service names on a D-Bus bus.
Template parameters
Section titled “Template parameters”| Parameter | Type | Description |
|---|---|---|
bus | string | "session" or "system" |
Behavior
Section titled “Behavior”Queries org.freedesktop.DBus.ListNames on each access. Unique connection names (those starting with :) are filtered out. The result is sorted alphabetically.
Return format
Section titled “Return format”Newline-separated list of well-known service names.
org.freedesktop.DBusorg.freedesktop.Notificationsorg.freedesktop.portal.Desktoporg.kde.KWinorg.mpris.MediaPlayer2.firefoxExample URI
Section titled “Example URI”dbus://session/servicesdbus://system/servicesdbus://{bus}/{service}/objects
Section titled “dbus://{bus}/{service}/objects”Object tree for a D-Bus service, produced by a bounded breadth-first walk.
Template parameters
Section titled “Template parameters”| Parameter | Type | Description |
|---|---|---|
bus | string | "session" or "system" |
service | string | Well-known service name |
Bounds
Section titled “Bounds”| Limit | Value |
|---|---|
| Maximum nodes | 200 |
| Maximum depth | 15 |
These limits are tighter than the list_objects tool (which allows 500 nodes and depth 20) because resources are intended for context loading, not exhaustive enumeration.
Return format
Section titled “Return format”Newline-separated, sorted list of object paths.
//org/freedesktop/NotificationsExample URI
Section titled “Example URI”dbus://session/org.freedesktop.Notifications/objectsdbus://system/org.freedesktop.systemd1/objectsdbus://{bus}/{service}/{path}/interfaces
Section titled “dbus://{bus}/{service}/{path}/interfaces”List of interfaces available at a specific D-Bus object path.
Template parameters
Section titled “Template parameters”| Parameter | Type | Description |
|---|---|---|
bus | string | "session" or "system" |
service | string | Well-known service name |
path | string | URL-encoded object path |
Path encoding
Section titled “Path encoding”The path segment must be URL-encoded. Forward slashes become %2F. The server automatically URL-decodes the path and prepends a leading / if one is missing after decoding.
| Object path | Encoded path segment |
|---|---|
/org/freedesktop/Notifications | %2Forg%2Ffreedesktop%2FNotifications |
/ | %2F |
Return format
Section titled “Return format”Newline-separated list of interface names, including standard D-Bus interfaces.
org.freedesktop.DBus.Peerorg.freedesktop.DBus.Introspectableorg.freedesktop.DBus.Propertiesorg.freedesktop.NotificationsExample URI
Section titled “Example URI”dbus://session/org.freedesktop.Notifications/%2Forg%2Ffreedesktop%2FNotifications/interfaces