Components
Code to copy. These files are not part of the npm package: pick one, copy it into your application and change it
as you like. Each has no dependency other than ngx-mcp-apps and Angular, and is compiled and used on this site,
so what you copy is code that runs.
Start from a whole app
One file that is the entire application, written for Angular 22. Its page runs it live. The chart of The example is another whole app in one file.
Or take the pieces
Nine small files, one job each, for when the app grows. They work from Angular 18 and take their colours from the text around them, so they follow your theme without a stylesheet.
- Connection statusA small badge that says whether the app is talking to a host.
mcp-status.ts - Tool result statesWraps the part of the app that needs the tool result.
mcp-tool-state.ts - Button that calls a server toolPut it on a <button>: a click calls a tool of your MCP server through the host.
mcp-call-tool.ts - Follow server stateA tool result reaches the app once.
mcp-live-value.ts - Host themeFollows the light or dark theme of the host.
mcp-theme.ts - Fullscreen buttonAsks the host to show the app in fullscreen, and back.
mcp-fullscreen-button.ts - Tell the modelA text box with the two ways an app can talk back.
mcp-tell-model.ts - Link opened by the hostInside the host iframe a normal link is usually blocked by the sandbox.
mcp-host-link.ts - Standalone noticeA line shown only when the app runs outside a host, for example with ng serve.
mcp-standalone-notice.ts
How to use a piece
Put the file in a folder such as src/app/mcp/ and import the class where you use it:
import { McpStatus } from './mcp/mcp-status';
@Component({
imports: [McpStatus],
template: `<mcp-status />`,
})
export class App {}From Angular 19 you can delete the line standalone: true of a piece: it is the default.