Axon MCP Server

An AI-Queryable Library of Axon Knowledge

Give AI assistants expert-level access to your Axon codebase.

Axon MCP Server indexes thousands of Axon functions, operator usages, and SkySpark documentation pages into a searchable library, then exposes it through the Model Context Protocol. Any MCP-compatible assistant -- Claude Desktop, Cursor, custom tools -- can query your Axon knowledge the way a senior engineer would: search by operator, pull usage examples, trace call graphs, generate typed code, and validate before execution.

Index 4,000+ HTML docs in 30 to 60 seconds. Query them in under 50 milliseconds. Keep the cache for 24 hours so subsequent boots are instant.

Why It Exists

Axon is a domain-specific language -- a small, strange, beautiful one -- and most LLMs have never seen it. Without context, an assistant either refuses to help or confidently hallucinates a function that does not exist. Axon MCP Server closes that gap with a grounded knowledge layer: every suggestion comes from real indexed code, every generated function is pre-validated, and every call graph is bidirectional.

Who It's For

  • SkySpark developers writing HVAC, energy, and sparks logic who want a real AI pair programmer
  • Building automation integrators consolidating knowledge across dozens of Axon projects
  • Consultants onboarding to a new client's Axon codebase and needing fast navigation

Search the Library

Every Axon example, one query

4,187 docs. Sub-50ms search. Indexed categories, operators, and patterns, all queryable through one MCP interface.

Axon MCP Search
localhost:3000/search
search axon examples... zone temp rollup
category:hvac kit:control since:30d Search
Categories
HVAC 412
Energy 287
Meter 198
Reporting 156
Admin 104
Spark Analysis 89
Sensor 76
Control 64
Data Analysis 58
Utilities 44
occSchedule hvac
0.94

Returns the occupancy schedule for a zone based on weekday and setpoint mode. Commonly used as a gate in runtime and rollup pipelines.

schedule occupancy zone
hvacRuntime hvac
0.88

Computes hour-by-hour runtime for a piece of equipment across a date range. Respects occupancy gating and manual override points.

runtime equip rollup
zoneTempRollup hvac
0.82

Rolls up zone temperature history into daily averages, typed to °F or °C based on site tag conventions.

hisRead rollup daily
energyBaseline energy
0.76

Computes a weather-normalized energy baseline for a site from historical meter data and degree-day inputs.

meter baseline weather
setpointWrite control
0.71

Writes a new setpoint to a point record with priority handling and audit-trail history markers.

point write setpoint
Showing 5 of 1,488 matches -- indexed 30s ago FlexSearch · 47ms

MCP Tool Surface

A compact interface, 20 specialized tools

Every tool the assistant needs is a JSON call away. The server exposes four groups: search, function analysis, code generation, and live SkySpark access. Each is a first-class MCP tool, discoverable via tools/list.

Tools degrade gracefully. If the SkySpark connection is down, the search and analysis tools keep working offline against the local index.

MCP Tools (~20) tools/list
Search
FlexSearch queries across docs, operators, and patterns.
searchAxonExamples searchAxonDocs searchAxonOperatorExamples searchAxonRegex listAxonCategories getAxonExample getAxonPattern listAxonPatterns
Functions
Usage lookups and bidirectional call-graph analysis.
findFunctionUsage getFunctionExamples getFunctionCallGraph getFunctionUsageStats
Generation
Typed code synthesis with AST walk and pre-validation.
generateAxonCode validateAxonCode parseAxonAst listAxonTemplates
SkySpark
Live Haystack queries and Axon execution via OAuth 2.1.
queryHaystack executeAxonCode listSkySparkProjects switchSkySparkProject
Function Call Graph occSchedule() -- depth 2
Callers
hvacRuntime
called 12x
energyReport
called 3x
sparkOccAnomaly
called 7x
occSchedule()
function
Callees
dayOfWeek
calls 4x
now
calls 1x
3
Total callers
2
Total callees
4
Max depth

Function Analysis

Bidirectional by design

findFunctionUsage finds every call site. getFunctionCallGraph builds the dependency tree -- who calls this function, and what it calls -- in a single pass. getFunctionUsageStats aggregates the whole codebase.

Indexing runs incrementally. Save a file, the graph updates. Every function in your Axon codebase becomes queryable with its full context intact.

  • Caller resolution across kits
  • Callee resolution with depth limit
  • Unused-function detection
  • Most-called-function stats

Code Generation

Generate, parse, validate -- every time

generateAxonCode synthesizes typed Axon from a natural-language intent. parseAxonAst walks the result. validateAxonCode checks semantics, operators, and types against the indexed standard library. Only validated output reaches the assistant.

The loop runs in one tool call. If validation fails, the server surfaces the specific rule violation so the assistant can repair and retry.

Code Generation Run VALIDATED
Request
{
  "pattern": "daily energy rollup",
  "projectContext": "building-a"
}
Generated
// Daily rollup by site
(siteRef, startDate, endDate) =>
site: read(^siteRef),
meter: readAll(siteRef==site->id and elec and meter),
hist: meter.hisRead(startDate..endDate),
daily: hist.hisRollup(avg, 1day),
out: daily.addColumns({
site: site->dis,
unit: "kWh"
})
Validation
✓ AST PARSED ✓ TYPES CHECKED ✓ 4 OPERATORS RESOLVED ✓ GROUNDED IN 3 EXAMPLES
SkySpark Instances 3 authenticated
hq-prod
skyspark.example.com
campus-main
auth: 12m ago
campus-staging
staging.example.com
central-plant
auth: 48m ago
lab-dev
reconnecting
lab.internal
sandbox
auth: 2h ago
Execution Result
read(site and campus).hisRead(today)
site equip val
campus-main ahu-1 72.3°F
campus-main ahu-2 74.1°F
campus-main zone-core 71.8°F

Multi-Instance Auth

From knowledge to action

OAuth 2.1 tokens for every SkySpark instance. listSkySparkProjects discovers them. switchSkySparkProject binds the active one. executeAxonCode runs against it.

Tokens live in SQLite via Prisma. Refresh happens automatically. Backup and restore are built in so moving between laptops does not mean re-authorizing ten buildings.

3
Instances
14
Projects
2,841
Functions synced

Interested in this project?

Explore the source code, contribute, or get in touch.