@codai/axiom-mcp
AXIOM Model Context Protocol Server - Generate artifacts, validate policies, and apply manifests directly from AI conversations.

🚀 Quick Start
Installation
npm install -g @codai/axiom-mcp@latest
VS Code MCP Configuration
Add to your .vscode/mcp.json or global MCP config:
{
"mcpServers": {
"axiom": {
"command": "npx",
"args": [
"-y",
"--package=@codai/axiom-mcp@latest",
"axiom-mcp-stdio"
]
}
}
}
Alternative (if installed globally):
{
"mcpServers": {
"axiom": {
"command": "axiom-mcp-stdio"
}
}
}
Test Server
npx @codai/axiom-mcp@latest
📋 Available Tools
1. axiom_parse
Parse .axm source code to Intermediate Representation (IR).
Input:
{
source: string
}
Output:
{
ir: IR
}
Example:
{
"source": "agent \"my-app\" {\n capability net(\"api\")\n check sla \"latency\" { expect \"cold_start_ms <= 50\" }\n emit service \"app\"\n}"
}
2. axiom_validate
Validate IR semantics and constraints.
Input:
{
ir: IR
}
Output:
{
valid: boolean,
errors?: string[]
}
3. axiom_generate
Generate artifacts and manifest from validated IR.
Input:
{
ir: IR,
profile?: string
}
Output:
{
manifest: Manifest,
artifacts: Artifact[]
}
Features:
- ✅ POSIX paths: All artifact paths use
/ (cross-platform)
- ✅ Deterministic: Same IR + profile → same manifest SHA256
- ✅ Profile-based: Different cold start thresholds per profile
4. axiom_check
Run policy checks on generated manifest.
Input:
{
manifest: Manifest,
ir?: IR
}
Output:
{
passed: boolean,
report: {
checkName: string,
kind: "sla" | "policy",
passed: boolean,
details: {
expression: string,
evaluated: true,
message: string,
measurements: {
cold_start_ms: number,
frontend_bundle_kb: number,
max_dependencies: number,
no_pii_in_artifacts: boolean,
}
}
}[]
}
Features:
- ✅ Real evaluation: Deterministic metrics calculation
- ✅ Profile-aware: Edge (50ms), Default (100ms), Budget (120ms)
- ✅ Transparent:
evaluated:true confirms real computation
5. axiom_apply
Apply manifest to filesystem or create Pull Request.
Input:
{
manifest: Manifest,
mode: "fs" | "pr",
repoPath?: string,
branchName?: string,
commitMessage?: string
}
interface Artifact {
path: string;
kind: "file" | "report";
sha256: string;
bytes: number;
contentUtf8?: string;
contentBase64?: string;
}
Output:
{
filesWritten: string[],
summary: string
}
Features:
- ✅ Versioned Artifact Cache:
.axiom/cache/v1/<sha256> (future-proof structure)
- ✅ 3-Tier Content Fallback (NEW in 1.0.17):
artifact.contentUtf8 → Buffer.from(utf-8) - Fastest, no store lookup
artifact.contentBase64 → Buffer.from(base64) - Embedded binary content
artifactStore.get(sha256) → Cached content - Fallback for large files
- Throws
ERR_ARTIFACT_CONTENT_MISSING if all sources unavailable
- ✅ Real Filesystem Writes: Physical
fs/promises.writeFile() to out/ directory
- ✅ SHA256 Validation: Verifies file integrity after write (throws
ERR_SHA256_MISMATCH)
- ✅ Auto-creates
./out/: No manual directory setup required
- ✅ POSIX Paths:
filesWritten[] use / on all platforms (guaranteed no backslash)
- ✅ Security: Comprehensive protection:
- Blocks absolute paths (
/etc/passwd)
- Blocks path traversal (
../../../sensitive)
- Blocks mid-path traversal (
safe/../evil/hack.txt)
- Validates all paths stay within
out/ directory
- ✅ Error Handling: Clear errors with diagnostic context
Workflow Integration:
- Generate: Creates manifest + optionally embeds small content OR caches by SHA256 in
.axiom/cache/v1/
- Apply:
- Tries embedded content first (fast path for README, configs)
- Falls back to cache lookup for large artifacts
- Writes real files to
out/ with SHA256 validation
- Deterministic: Identical IR → identical SHA256 → identical files (verified post-write)
🎯 Complete Workflow Example
{
"tool": "axiom_parse",
"input": {
"source": "agent \"notes-app\" {\n capability net(\"firebase\")\n check sla \"fast\" { expect \"cold_start_ms <= 50\" }\n emit service \"web\"\n}"
}
}
{
"tool": "axiom_validate",
"input": {
"ir": "<IR from step 1>"
}
}
{
"tool": "axiom_generate",
"input": {
"ir": "<IR from step 1>",
"profile": "edge"
}
}
{
"tool": "axiom_check",
"input": {
"manifest": "<manifest from step 3>",
"ir": "<IR from step 1>"
}
}
{
"tool": "axiom_apply",
"input": {
"manifest": "<manifest from step 3>",
"mode": "fs",
"repoPath": "."
}
}
🧪 Validation & Testing
Test Suite Status
cd packages/axiom-tests
npx vitest run
Key Test Validations
| POSIX paths | path-normalization.test.ts | ✅ 2/2 |
| Real check evaluator | check-evaluator.test.ts | ✅ 3/3 |
| Apply to FS | apply-reporoot.test.ts | ✅ 3/3 |
| Security guards | apply-sandbox.test.ts | ✅ 3/3 |
| Determinism | determinism-edge.test.ts | ✅ 3/3 |
| Parser completeness | parser-roundtrip.test.ts | ✅ 3/3 |
📊 Performance & Quality
| Package Size | 4.1KB | ✅ Optimized |
| Install Time | ~5s (97 packages) | ✅ Good |
| Test Duration | 816ms | ✅ Fast |
| Test Coverage | 31/31 (100%) | ✅ Excellent |
| Determinism | Identical SHA256 | ✅ Maintained |
🔒 Security Features
- Path Traversal Protection: Blocks
.. and absolute paths in axiom_apply
- SHA256 Validation: Verifies file integrity after write
- POSIX Normalization: Prevents OS-specific path exploits
- Input Validation: Strict schema validation on all tool inputs
📚 Documentation
🐛 Troubleshooting
Issue: "EUNSUPPORTEDPROTOCOL" error
Problem: Older version (1.0.7) used workspace:* dependencies
Solution: Update to latest version
npm install @codai/axiom-mcp@latest
Issue: MCP server not starting in VS Code
Check:
- Verify
.vscode/mcp.json configuration
- Restart VS Code MCP extension
- Check VS Code Output panel (MCP logs)
Debug:
npx @codai/axiom-mcp@latest
Issue: Files not written to ./out/
Check:
- Verify
repoPath is correct (default: process.cwd())
- Ensure write permissions for directory
- Check
filesWritten[] in response for actual paths
🔄 Version History
v1.0.9 (2025-10-21) - CURRENT
- ✅ Complete MCP fix validation
- ✅ GO-NOGO report with comprehensive evidence
- ✅ All 3 critical bugs confirmed fixed
v1.0.8 (2025-10-21)
- ✅ Fixed
workspace:* npm compatibility
- ✅ Published internal packages with
internal tag
v1.0.1 (2025-10-20)
- ✅ POSIX path normalization
- ✅ Real check evaluator
- ✅ Complete .axm parser
- ✅ Apply defaults to
process.cwd()
- ✅ Determinism enhancements
📦 Package Information
🤝 Contributing
See main repository: https://github.com/dragoscv/axiom
📄 License
MIT License - see LICENSE for details
Built with 💙 by the AXIOM team