- Server:
get_temperature, a data tool with no UI, andshow_weather, a render tool. - View: a detail card from the view kit, shown in chat when
show_weatherruns. - Look pack: the design tokens the card reads.
This server has no authentication so the example stays short. A server that reads or changes user data must require OAuth. See Authentication.
1. Create the app
server.ts is the whole app.
2. Read the server
server.ts
appToolwill not build a tool unless you statereadOnlyHintanddestructiveHint. Permission prompts and directory review depend on them.view: cardtiesshow_weatherto the View. The SDK sets_meta.ui.resourceUri(and the older flat key) for you.- The render tool returns
content(text the model reads) andstructuredContent(data the View reads). - The View has no network access.
view()declares an empty CSP unless you add domains.
3. Run it
allternit dev starts the server on port 3000 and prints the MCP URL, the manifest URL and the command to add it as a connector.
4. Test it
allternit test runs the same rules directory review runs (annotations, descriptions, CSP), then starts the server and checks what a real MCP client sees: the tools, the ui:// resource and its MIME type. It exits non-zero on errors.
5. Make the server reachable and connect it
Allternit connects to your server from its own infrastructure, so the URL must be public and usehttps. Connector URLs that resolve to loopback, private, or link-local addresses are refused. During development, expose your local port through a tunnel.
Then add the server as a connector. This request uses the connector API:
6. See it render
Start a chat and ask: “Show me the weather in Tokyo.” The model callsshow_weather, and the card appears in the conversation, styled by your look pack. If it does not, see Troubleshooting.
7. Package it
weather.zip in the layout Package your plugin describes.
Next steps
- Learn each package: Overview, Server, Bridge, View kit, Look packs, CLI.
- Add OAuth: Authentication.
- Submit it: Submit and review.