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.
Returns the occupancy schedule for a zone based on weekday and setpoint mode. Commonly used as a gate in runtime and rollup pipelines.
Computes hour-by-hour runtime for a piece of equipment across a date range. Respects occupancy gating and manual override points.
Rolls up zone temperature history into daily averages, typed to °F or °C based on site tag conventions.
Computes a weather-normalized energy baseline for a site from historical meter data and degree-day inputs.
Writes a new setpoint to a point record with priority handling and audit-trail history markers.
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.
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.
{ "pattern": "daily energy rollup", "projectContext": "building-a" }
| 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.
Tech Stack
Architecture
Capabilities
- ~20 MCP tools -- across search, code generation, AST parsing, call-graph analysis, and live execution
- FlexSearch index -- 4,187+ HTML documentation files with sub-50ms query latency, 24-hour cache TTL, 50-100 MB footprint
- Tree-sitter AST --
web-tree-sitter0.26.5 for Axon parsing with operator-specific tokenization - Bidirectional call graphs -- stored in SQLite via Prisma; callers and callees in both directions
- Typed code generation -- with pre-validation before returning to the client
- OAuth 2.1 multi-instance -- SkySpark authentication for live Axon execution
- Next.js dashboard -- and packaged VSCode extension (
.vsix) for developer workflow - Transports -- stdio (local) and HTTP (remote / multi-client)
Categories Indexed
HVAC, Energy, Meter, Reporting, Admin, Spark Analysis, Sensor, Control, Data Analysis, Utilities
Requirements
- Node.js 18+
- Axon code and documentation paths (configured via
axon-config.json) - SkySpark 3.0+ for live execution tools
- 8 GB RAM recommended (
--max-old-space-size=8192)
Interested in this project?
Explore the source code, contribute, or get in touch.