Docs/Extend pi-kit

MCP servers and interactive UI

Catalog services, your own servers, tool exposure, generative UI, A2UI and MCP Apps.

MCP servers give pi tools, and some give interactive apps. Settings → MCP servers manages catalog services and your own servers. /mcp and /connect open it.

Connect a catalog service#

  1. Open MCP servers → Servers and choose +.
  2. Pick a service: Linear, GitHub, Slack, Notion, Sentry, Atlassian, Figma, Gmail, Google Calendar, Outlook, or Composio for 850+ apps through one sign-in.
  3. Choose For me (your mcp.json) or This project only (the project's .pi/mcp.json; needs a trusted project).
  4. Sign in in the browser or enter a token.
  5. Check the state and the tool list.
Some services offer a read-only endpoint. Signing in from a browser on another machine works by pasting the redirect URL back. A server with a token always stays in your user file.

Add your own server#

Choose Your own server, then a URL or a command:
KindFields
URLAddress and headers. The check may report that sign-in is needed.
CommandProgram, arguments and environment variables. The check finds the program on the PATH but does not start it.
The backend's PATH can differ from your shell's; an absolute path avoids that. You can also load a client's JSON file in the wizard.

Tool exposure#

ModeBehavior
Codemode (default)The model calls the tools from code.
DirectEvery tool is declared in the model's tool list.
DeferredTools are found by search when needed.
Exposure controls how tools reach the model, not what the server may do. Changing it reloads the session.

Edit a server#

Use a server's pencil button. The form shows the JSON As it will be written. Save and reconnect, then check the state.
Editing a command server: command, arguments, environment and exposure.
Editing a command server: command, arguments, environment and exposure.
The Configuration tab lists the two files, ~/.pi/agent/mcp.json and the project's .pi/mcp.json. Edit here validates the JSON before saving; you can also open a file in your editor or reveal it. Sign-in tokens are kept in mcp-auth.json. With credential storage on, secrets you enter go to the credential store and mcp.json gets a resolver command. With it off or unavailable, they are written to mcp.json as plain text, readable only by your account, and the save says so. See Credential storage.
{
  "mcpServers": {
    "issues": {
      "command": "node",
      "args": ["/absolute/path/to/server.mjs"],
      "exposure": "direct"
    }
  }
}

Interactive UI in the transcript#

KindHow it works
Generative UIA tool returns HTML, CSS and JavaScript that run in a sandboxed frame. The built-in generateSandboxedUi tool draws charts, planners and other views. Controls update the view without another model turn.
A2UIA tool returns components and data that pi-kit renders: tables, cards, forms and buttons, through the built-in render_a2ui tool. A button sends your action and the selected data back to the agent; editing a field alone sends nothing.
MCP AppA server supplies an HTML app shown in a frame marked MCP app, sandboxed.
Input requestA tool or extension asks for a confirmation, a choice or text.
pi-kit renders these through CopilotKit's Angular integration and AG-UI.

Video walkthrough · English captions

Explore an interactive view in chat

Explore an interactive view in chat

Fictional demo data · Qwen3-TTS · Aiden (English)

Ask for a fictional power planner, adjust its sliders, and reset the budget. A demo tool supplies the prebuilt HTML interface, rendered through pi-kit’s CopilotKit integration.

Video walkthrough · English captions

Choose an item with A2UI

Choose an item with A2UI

Fictional demo data · Qwen3-TTS · Aiden (English)

Open a fictional supply checklist, inspect an item, and continue with its details. The tool-owned A2UI components send the selection back to the agent.

Examples#

The repository's examples folder has a2ui-failing-specs (an A2UI extension) and mcp-app-server (a toy issue tracker with an MCP App form). Its README explains how to install both. Add the server with the JSON above, reload, and ask for its tool.