Core Concepts

Resources

Expose static or templated MCP resources from src/resources/.

Resources are read-only MCP content the model can fetch with resources/read.

Add a resource folder

src/resources/inbox/
  resource.ts

Define the resource

inbox/resource.ts
import { defineResource } from "bitmcp";

const inbox =
  "# Inbox\n\n- Review quarterly report\n- Reply to design feedback";

export default defineResource({
  uri: "notes://inbox",
  name: "inbox",
  title: "Inbox",
  mimeType: "text/markdown",
  async read() {
    return { text: inbox };
  },
});

Test in dev

pnpm dev

Call resources/list and resources/read from your MCP client with URI notes://inbox.

Reference

Folder layout

FileRegisters
resource.tsStatic resource (defineResource)
template.tsParameterized template (defineResourceTemplate)

Folder name is the module name. URI and name come from your definition.

defineResource options

FieldDescription
uriStable resource URI
nameShort name for listings
titleDisplay title
mimeTypeMIME type returned on read
readReturns { text } or { blob }

Resource templates

For dynamic URIs, use defineResourceTemplate with uriTemplate, read, and optional complete for argument completion.