Building an OctoMesh app with your own AI agent
This page is for developers who want to build an application on OctoMesh with their own AI agent, for example Claude Code. It shows the way of working in six steps; the tutorials explain each part in depth.
Reading time: about 10 minutes. Setup: about one hour, once.
What an OctoMesh app is
An OctoMesh app is mostly model, not code:
Blueprint one installation sets up everything in a tenant
├── Data model (Construction Kit) e.g. Appointment, Technician, Customer, ServiceType
├── Pipelines logic and interfaces, e.g. book an appointment, import a CSV export
└── User interface an Angular app from the template repository
Your AI agent builds these parts. It works directly with your tenant through the OctoMesh MCP server:
- Knowledge first. The agent takes its know-how from the knowledge pages of
your tenant: how to build apps, pipelines and blueprints, how to deploy them
and how to find errors. It searches them with
knowledge_searchand opens them withknowledge_get. The pages are updated with every platform update. - Then the tools. The agent does the work with the tools of the MCP server: read and validate the data model, query entities, validate pipelines, install blueprints. Every tool runs with your login and your roles, never with more.
- Command line only where needed. Local tools and
octo-cliremain only where no MCP tool exists; the table below lists them.
You set the direction, check and decide. The agent drafts, validates and builds.
1. Set up (once)
| What | How |
|---|---|
| A test tenant with the OctoMesh builder knowledge | Your OctoMesh administrator gives you the tenant URL and a login. Ask for the builder knowledge (blueprint System.Ai.Builder) to be installed. |
| An MCP client | For example Claude Code. Any client with the streamable HTTP transport and OAuth login works. |
| Connect the MCP server | claude mcp add --transport http --scope user octomesh https://mcp.<your-domain>/<tenant>/mcp, then run /mcp in Claude Code, select octomesh and log in in the browser. Details: tutorial 4. |
| The app template | meshmakers/template-repo: Node.js as given in its .nvmrc, and your own Telerik licence for Kendo UI in the environment variable TELERIK_LICENSE. |
| Optional: OctoMesh skills for your agent | claude plugin marketplace add meshmakers/octo-claude-skills, then claude plugin install octo-claude-skills. Helpful for the local work on the template; the path on this page works without them. |
Connection test. Ask the agent:
Which data models does my tenant have, and what do the knowledge pages say about building an app?
If it answers with the models and cites pages such as app-index, everything is
connected. If knowledge_search returns a builderKnowledgeHint instead, the
builder knowledge is not installed in your tenant: ask a tenant administrator to
install the blueprint System.Ai.Builder. Until then the agent can only rely on
the tool descriptions.
Start each session with: "Read the knowledge pages first (knowledge_search) and
cite the pages you use." An agent that answers from general knowledge guesses.
2. An app in six steps
The example is a small app for booking service appointments. Each step follows the same pattern: you say, the agent does, you check.
Step 1: Requirements to a domain list
You say: "Here is the description and the mock-up of the appointment planner. Derive the data objects, rules and interfaces."
The agent reads the knowledge pages on data modelling and returns a list, for example:
- Objects: Appointment, ServiceType, Technician with skills and working hours, Customer
- Rules: no booking without a matching skill; at most one appointment per technician and slot
- Interfaces: import of the existing schedule as a CSV export
You check: the list against the requirements, and you answer its open questions. This list is the yardstick for every following step.
Step 2: Data model
You say: "Design the data model. Reuse what the public Construction Kits already offer."
The agent looks for existing types and models (search_types,
get_type_schema, list_ck_catalog_models), writes the draft and lets the
server validate it without importing it (validate_ck_model). The server
compiles the source files of the draft for this check; nothing is written.
You check: names, associations and required attributes, for example with the
review checklist of tutorial 7. Only then is the model
imported, and only into the test tenant: missing catalog models with
import_ck_from_catalog, your own model with prepare_file_upload and
import_ck_model. The import takes a compiled model only, so the model is
compiled locally first with octo-ckc
(install the compiler).
prepare_file_upload returns an upload path (/file-transfer/upload/<transferId>).
The agent sends the compiled file there with a PUT to the host of the MCP
server without the /<tenant>/mcp path, as raw bytes with
Content-Type: application/octet-stream, and then calls import_ck_model with
the transfer id:
curl -X PUT -H "Content-Type: application/octet-stream" \
--data-binary @<compiled-model-file> \
"https://mcp.<your-domain>/file-transfer/upload/<transferId>"
The upload slot expires after about 30 minutes.
Step 3: Logic and interfaces
You say: "Create the endpoints to book, move and cancel an appointment" or "Import the CSV export."
The agent writes the pipelines, validates them against the adapter of your
tenant (get_adapters, validate_pipeline_definition) and tries them with
dry_run_pipeline. Then it deploys them in this order:
- Create the DataFlow and Pipeline entities in the tenant (
import_runtime_model; the runtime model file goes through the same upload as in step 2). - Deploy each pipeline definition to the adapter (
deploy_pipeline, with the runtime ID of the Pipeline entity from step 1).
In the other order deploy_pipeline fails with Pipeline '<id>' not found,
because the Pipeline entity does not exist yet.
HTTP endpoints use the FromHttpRequest@2 trigger with requiredRoles and
allowAnonymous: false, so every call needs a token of the tenant with the right
role. The agent builds no anonymous endpoints. From outside, an HTTP route is
reachable only through the ingress of the tenant's adapter: the URL is
https://<adapter-hostname>/<tenant>/<path>. The agent reads the adapter's
ingressEnabled and hostname with query_entities; if the ingress is not
enabled, ask your OctoMesh administrator to enable it. The route stays
authenticated either way.
You check: Does each response return only the fields it needs? Does the endpoint reject a call without a token? See tutorial 5 and tutorial 8.
Step 4: User interface
You say: "Create the app from the template and build the appointment planner as in the mock-up."
The agent clones the template and initialises it without prompts, with your tenant id:
./init.sh --app-name <AppName> --tenant-id <your-tenant> --yes
--tenant-id puts your tenant into the app's configuration, the Helm values and
the template's scripts; without it the tenant id is the app name in kebab case.
./init.sh --help lists all options. The agent then registers the app's login
client in the tenant (add_authorization_code_client, add_scope_to_client),
plans the pages (get_custom_app_template_manifest, plan_custom_app_scaffold,
apply_custom_app_scaffold, list_kendo_components) and fetches the GraphQL
schema of your tenant (export_runtime_graphql_sdl) for npm run codegen. Lint,
tests and build run locally before anything is committed.
Your model is already in the tenant (step 2), so the agent does not need the
template's script scripts/om_initialize_tenant.ps1. On a hosted tenant that
script only imports; it deletes and recreates a tenant only with -Recreate, and
only on a local stack.
export_runtime_graphql_sdl returns the schema as introspection JSON for
download (/file-transfer/download/<transferId>, same host as the upload). Save
it as src/<app>/schema.json: npm run codegen reads it from there. On a fresh
tenant codegen works right after ./init.sh, because the template's sample query
is not part of npm run codegen.
You check: the app in the browser, page by page against the mock-up, with
data you can compare (query_entities).
Step 5: Blueprint
You say: "Package the model, the pipelines and the app into a blueprint."
The agent writes the blueprint with seed data, for example the service types and two sample technicians.
You check: a second, empty test tenant is ready after the installation, without manual steps.
Step 6: Ship
- Install over MCP:
list_blueprints,install_blueprint; for a new versionpreview_blueprint_updateandupdate_blueprint. - Publish: putting your own blueprint into a catalog your tenant reads is not possible yet. This feature is coming; until then Meshmakers publishes your blueprints on request.
- Production: only after a joint release decision with your OctoMesh administrator.
Where local tools remain
| Step | Tool | Why |
|---|---|---|
| Start the app | git clone, ./init.sh, npm install | The app code lives in your own repository on your machine. |
| Build and run the app | npm run codegen, npm start, lint, tests, build | Builds run locally; the MCP server only delivers the GraphQL schema. |
| Compile your own model | octo-ckc (install) or a dotnet build of the Construction Kit project | validate_ck_model checks the source, but import_ck_model imports compiled models only. |
| Build and publish a blueprint package | octo-bpm | Publishing to a catalog of your own tenant is coming; until then Meshmakers publishes on request. |
Rules
- You decide, the agent proposes. You confirm every import, installation and deletion.
- Test tenant first, never directly in production.
- No real personal data while building. Use made-up names, as in a mock-up. Real data only in production and under a data processing agreement.
- No secrets in the repository: licence keys, client secrets and tokens belong in environment variables.
- Versions are immutable. When something changes, publish a new version of the model or the blueprint.
- Small steps: one topic, one branch, one pull request, green locally.
- The agent can be wrong. A model that passes the validation is not yet a good model. Review the data model and the permissions yourself.
Typical pitfalls
| What you see | What helps |
|---|---|
| The agent answers from general knowledge instead of the pages | Tell it: "Read the knowledge pages first (knowledge_search) and cite them." |
knowledge_search returns builderKnowledgeHint | The builder knowledge is missing: a tenant administrator installs System.Ai.Builder. |
| A pipeline response contains internal fields | The response is the whole data context. End the pipeline with Project@1 and clear: true. |
| Errors come back with HTTP 200 | That is intended: the app reads the status field of the response. |
| A new blueprint version is not visible in the tenant | Refresh the catalogs (refresh_blueprint_catalogs); for your own blueprints ask Meshmakers until tenant catalogs are available. |
npm start stops | The Telerik licence is missing in TELERIK_LICENSE. |
| The upload returns 404 | The upload goes to the MCP host without /<tenant>/mcp, as PUT with Content-Type: application/octet-stream, within about 30 minutes of prepare_file_upload. |
deploy_pipeline reports Pipeline '<id>' not found | Create the DataFlow and Pipeline entities with import_runtime_model first. |
| The endpoint cannot be reached from outside | The adapter of your tenant needs an ingress; ask your OctoMesh administrator. |
npm run codegen cannot read the schema | Save the downloaded introspection JSON as src/<app>/schema.json; for an SDL file run OCTO_GRAPHQL_SCHEMA=schema.graphql npm run codegen. |
Read more
- 4. AI via the MCP server: connect and authenticate the client
- 5. Pipeline endpoints: authenticated HTTP routes
- 6. Data model: reuse or design and 7. Data model with an AI assistant
- 8. Connecting external systems
- MCP tool reference
The tutorials from the template to the blueprint in a second tenant are being written and will be listed in the overview.