mastra

A guide for connecting Mastra, a TypeScript framework for building AI agents, to CEL, a perception and action server, through MCP or directly registered tools.

In plain words
What is it for?
Integrating CEL with a Mastra agent, exposing its tools, and choosing between Mastra’s MCP client and direct tool registration.
Why use it?
It clarifies which parts Mastra owns—such as the model and planning loop—and which actions CEL provides.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/dimpagk92/cellar/mastra
Clone the repo
git clone --depth 1 https://github.com/dimpagk92/cellar
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,598 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01598
Opus 5 $0.00000 $0.00799
Sonnet 5 $0.00000 $0.00320
Haiku 4.5 $0.00000 $0.00160

Measured 2d ago against content hash 79ed1df5056f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mastra scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/agents/mastra.md · 149 lines

How it starts

The opening of the file, as written. The whole thing — 149 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Driving CEL from Mastra

This page shows how to drive CEL from a Mastra agent.

Read docs/adapters-cel-agents.md first if you haven't.

Purpose

Mastra is a TypeScript agent framework. Same ecosystem language as Cellar, easy mental model: a Mastra Agent has tools, an instructions prompt, and a model. To drive CEL, you expose cel_see and cel_act as two Mastra tools and let the agent loop.

In this setup:

  • Mastra owns the model, tool loop, and stop condition.
  • CEL provides perception, action execution, and adapter truth.
  • You don't need cel_think — the Mastra agent is the planner.

Two integration paths:

  1. Via Mastra's MCP client. Mastra supports MCP tools natively in recent versions; the agent speaks MCP to CEL as a subprocess and imports tools automatically.
  2. Direct tool-registration. Wrap CEL calls as plain Mastra tools backed by the Node SDK (@cellar/agent) or raw child-process MCP calls.

Path 2 is shown below because it makes the ownership clearest. Path 1 is more convenient once Mastra's MCP client surface is stable for your version.

TODO: verify with the latest Mastra release notes at https://mastra.ai/docs — the exact MCP-client API has moved between minor versions.

Setup

1. Build CEL and install Mastra in your project

# In your Mastra app
pnpm add @mastra/core @cellar/agent
# or: pnpm add @modelcontextprotocol/sdk  # if using raw MCP path

2. Set your LLM credentials

Mastra needs its own model provider credentials (separate from CEL_LLM_*, which only matters if you use cel_think):

export OPENAI_API_KEY=sk-...
# or ANTHROPIC_API_KEY, etc., per Mastra's provider docs

3. Pick the integration path

  • MCP client path: register the CEL MCP server in Mastra's MCP config and let Mastra import tools. Consult the current Mastra docs for the exact createMCPClient / MCPClient constructor signature.
  • Direct tool-registration path: call into @cellar/agent from a Mastra createTool factory. Shown below.

Read the full file on GitHub · 149 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 149 lines · 0 tokens per session scan A 79ed1df5056f

Subscribe to this mod's changes

mastra is an agent published in the GitHub repository dimpagk92/cellar (4 stars, last pushed 23d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,598 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.