Skip to content

mcp

MCP: models outside the app (ChatGPT, Claude, any MCP client) call the app's tools.

On this page 7
TypeScript
import { mcp } from "copilotz/plugins/interfaces";

What it keeps

It keeps 4 collections.

CollectionKept asFields
mcp_closeddocumentsat
mcp_openingdocumentsat
mcp_ratein memory, gone on restartuntil, count
mcp_receiptdocumentsstep, at, done, text, failed

What it lets callers do

Of its 4 Actions, people, agents, contacts and someone signed out may call none.

ActionPersonAgentContactAnyoneKeyWhat it does
mcp.callnononononoOne call to one of the app's tools, from a model outside (MCP).
mcp.publicnononononoOne call to one of a public server's tools, as the public (MCP): kept nowhere.

An agent works for a person, and calls what both may. A key calls only what its scope names.

Only the app's own code calls mcp.conversation and mcp.prune: its plugins, its schedules and the system.

It answers 1 route over HTTP:

MethodPath
POST/mcp/*

Where it shows

Its Views show to the model.

  • To the model: mcp:offered.

What it needs

You set it in resources.mcp: 2 settings are required.

SettingTypeRequiredWhat it is
mcp.<name>.instringyesThe space its conversations' chats live in (declared with the spaces plugin's spaces, or not); on a public server, the space its tools work in (ctx.in).
mcp.<name>.tools`Record<string, McpTool \null>`yesThe tools it offers, by name (the tools resource's), each with how it's offered ({} as it is).
mcp.<name>.titlestringnoWhat it's called, and its version.
mcp.<name>.versionstringnoWhat it's called, and its version.
mcp.<name>.instructions`string \object`noWhat the model is told about using it: the words, or an Action that says them ({ action }: given { server }, its name, answering the words or nothing), asked as each session starts (initialize, server/discover), so words the app changes reach new conversations without a restart.
mcp.<name>.clientstringnoWho calls (ChatGPT), as its chats show it: the sender of their steps, and their title.
mcp.<name>.handlesbooleannoA client that names no conversation (no openai/session, which ChatGPT sends) gets a handle to name it with (chat, on every tool), so its calls go on in one chat.
mcp.<name>.publicbooleannoA public server, which keeps nothing: each call runs its tool as the public ({ kind: "public" }, whom publicCallers lets in), with no contact, chat or step, and only the tools that only read (annotations.readOnly) are offered.
mcp.<name>.originsstring[]noThe browser origins it answers (Origin, or "*" for any): none unless said (no browser calls MCP).
mcp.<name>.widgetsMcpWidgetsnoIts widgets (with the app's widgets resource, widgetsOf): the template's options.
mcp.<name>.limitsPartial<McpLimits>noWhat it takes before it says no, over the defaults (MCP_LIMITS): see McpLimits.
mcp.<name>.exemptstring[]noCallers whose address is in these CIDR ranges (a shared proxy's: OpenAI's egress, every ChatGPT user's calls behind a few addresses) aren't limited by address; the server's other limits still hold.

It also reads caller, org, tools and widgets, resource kinds the app and other plugins fill.

What it requires

The runtime doesn't start without chat, spaces and contacts: add them too.

It ships with copilotz@1.0.0-rc.66.

What it does on its own

Some of its work starts without a caller: an event, or the time.

  • mcp.erased runs on thread.deleted.
  • mcp.forgotten runs on contact.deleted.
  • mcp.prune calls mcp.prune, every 10m. Drops MCP's counters, receipts and openings that are past.

Listing

It keeps every listing rule.