MCP tools

mastercss_inspect_directives

Inspect CSS-first directives from a stylesheet entry or in-memory CSS content and report manifest/CSS effects.

Contract

Inspect directive structure and compilation effects from an entry stylesheet or a CSS buffer. Provide entryPath or content; an empty arguments object cannot be compiled.

Input

context
stringOptional

Semantic context. Defaults to project; entry discovery or compilation failures are reported without falling back. Select preset explicitly for standalone preset queries. Values: project, preset.

content
stringOptional

CSS buffer to inspect when entryPath is absent.

filePath
stringOptional

Virtual path for the CSS buffer. Defaults to master.css.

entryPath
stringOptional

Existing stylesheet path inside the workspace. Takes precedence over content.

preserveNativeCSS
booleanOptional

Forward the native-CSS preservation option to compilation.

Complete input schema
JSON
{  "$schema": "http://json-schema.org/draft-07/schema#",  "type": "object",  "properties": {    "context": {      "type": "string",      "enum": [        "project",        "preset"      ]    },    "content": {      "type": "string"    },    "filePath": {      "type": "string"    },    "entryPath": {      "type": "string"    },    "preserveNativeCSS": {      "type": "boolean"    }  }}

Example

Call mastercss_inspect_directives from a connected MCP client with these arguments:

Arguments
{  "content": "@theme { --color-brand: blue; }",  "filePath": "app.css"}

Inspect an isolated token definition without changing the project entry.

Output

Read status and diagnostics, then directiveEntries, manifest and directive summaries, CSS sizes, dependencies, and warnings. Compilation failures return the error branch of the MCP envelope with diagnostics and isError.

Every tool returns an object with version: 3, metadata, diagnostics and result. Success payload fields described above live in result.data; failure has result.status: "error" and a required { code, message } error. JSON text equals structuredContent. Tool errors set isError. Metadata records actual context, package/language/binding versions, manifest fingerprint, entries and dependencies; unavailable information is null or an empty array.

Complete output schema
JSON
{  "$schema": "http://json-schema.org/draft-07/schema#",  "type": "object",  "properties": {    "version": {      "type": "number",      "const": 3    },    "metadata": {      "type": "object",      "properties": {        "versions": {          "anyOf": [            {              "type": "object",              "properties": {                "languageVersion": {                  "type": "number"                },                "bindingAbiVersion": {                  "type": "number"                },                "packageVersion": {                  "type": "string"                }              },              "required": [                "languageVersion",                "bindingAbiVersion",                "packageVersion"              ],              "additionalProperties": {}            },            {              "type": "null"            }          ]        },        "context": {          "anyOf": [            {              "type": "string",              "enum": [                "project",                "preset"              ]            },            {              "type": "null"            }          ]        },        "manifestFingerprint": {          "type": [            "string",            "null"          ]        },        "entries": {          "type": "array",          "items": {            "type": "string"          }        },        "dependencies": {          "type": "array",          "items": {            "type": "string"          }        }      },      "required": [        "versions",        "context",        "manifestFingerprint",        "entries",        "dependencies"      ],      "additionalProperties": false    },    "diagnostics": {      "type": "array",      "items": {        "type": "object",        "properties": {          "code": {            "type": "string"          },          "phase": {            "type": "string"          },          "severity": {            "type": [              "string",              "number"            ]          },          "message": {            "type": "string"          },          "notes": {            "type": "array",            "items": {              "type": "string"            }          },          "alternatives": {            "type": "array",            "items": {              "type": "string"            }          },          "source": {            "type": "string"          },          "range": {            "anyOf": [              {                "type": "object",                "properties": {                  "start": {                    "type": "number"                  },                  "end": {                    "type": "number"                  }                },                "required": [                  "start",                  "end"                ],                "additionalProperties": false              },              {                "type": "object",                "properties": {                  "start": {                    "type": "object",                    "properties": {                      "line": {                        "type": "number"                      },                      "character": {                        "type": "number"                      }                    },                    "required": [                      "line",                      "character"                    ],                    "additionalProperties": false                  },                  "end": {                    "type": "object",                    "properties": {                      "line": {                        "type": "number"                      },                      "character": {                        "type": "number"                      }                    },                    "required": [                      "line",                      "character"                    ],                    "additionalProperties": false                  }                },                "required": [                  "start",                  "end"                ],                "additionalProperties": false              }            ]          }        },        "required": [          "message"        ],        "additionalProperties": {}      }    },    "result": {      "oneOf": [        {          "type": "object",          "properties": {            "status": {              "type": "string",              "const": "success"            },            "data": {              "type": "object",              "properties": {                "compositions": {                  "type": "array",                  "items": {                    "type": "object",                    "properties": {                      "order": {                        "type": "integer",                        "minimum": 0,                        "maximum": 9007199254740991                      },                      "classes": {                        "type": "array",                        "items": {                          "type": "string"                        }                      },                      "source": {                        "type": "object",                        "properties": {                          "file": {                            "type": "string"                          },                          "range": {                            "type": "object",                            "properties": {                              "start": {                                "type": "number"                              },                              "end": {                                "type": "number"                              }                            },                            "required": [                              "start",                              "end"                            ],                            "additionalProperties": false                          },                          "loc": {                            "type": "object",                            "properties": {                              "start": {                                "type": "object",                                "properties": {                                  "line": {                                    "type": "integer",                                    "minimum": 0,                                    "maximum": 9007199254740991                                  },                                  "column": {                                    "type": "integer",                                    "minimum": 0,                                    "maximum": 9007199254740991                                  }                                },                                "required": [                                  "line",                                  "column"                                ],                                "additionalProperties": false                              },                              "end": {                                "type": "object",                                "properties": {                                  "line": {                                    "type": "integer",                                    "minimum": 0,                                    "maximum": 9007199254740991                                  },                                  "column": {                                    "type": "integer",                                    "minimum": 0,                                    "maximum": 9007199254740991                                  }                                },                                "required": [                                  "line",                                  "column"                                ],                                "additionalProperties": false                              }                            },                            "required": [                              "start",                              "end"                            ],                            "additionalProperties": false                          }                        },                        "required": [                          "range"                        ],                        "additionalProperties": false                      },                      "definitionSources": {                        "type": "array",                        "items": {                          "type": "object",                          "properties": {                            "file": {                              "type": "string"                            },                            "range": {                              "type": "object",                              "properties": {                                "start": {                                  "type": "number"                                },                                "end": {                                  "type": "number"                                }                              },                              "required": [                                "start",                                "end"                              ],                              "additionalProperties": false                            },                            "loc": {                              "type": "object",                              "properties": {                                "start": {                                  "type": "object",                                  "properties": {                                    "line": {                                      "type": "integer",                                      "minimum": 0,                                      "maximum": 9007199254740991                                    },                                    "column": {                                      "type": "integer",                                      "minimum": 0,                                      "maximum": 9007199254740991                                    }                                  },                                  "required": [                                    "line",                                    "column"                                  ],                                  "additionalProperties": false                                },                                "end": {                                  "type": "object",                                  "properties": {                                    "line": {                                      "type": "integer",                                      "minimum": 0,                                      "maximum": 9007199254740991                                    },                                    "column": {                                      "type": "integer",                                      "minimum": 0,                                      "maximum": 9007199254740991                                    }                                  },                                  "required": [                                    "line",                                    "column"                                  ],                                  "additionalProperties": false                                }                              },                              "required": [                                "start",                                "end"                              ],                              "additionalProperties": false                            }                          },                          "required": [                            "range"                          ],                          "additionalProperties": false                        }                      },                      "css": {                        "type": "string"                      },                      "variableNames": {                        "type": "array",                        "items": {                          "type": "string"                        }                      },                      "animationNames": {                        "type": "array",                        "items": {                          "type": "string"                        }                      }                    },                    "required": [                      "order",                      "classes",                      "definitionSources",                      "css",                      "variableNames",                      "animationNames"                    ],                    "additionalProperties": false                  }                },                "context": {                  "type": "object",                  "properties": {                    "context": {                      "type": "string",                      "enum": [                        "project",                        "preset"                      ]                    },                    "status": {                      "type": "string",                      "enum": [                        "loaded",                        "error"                      ]                    },                    "fingerprint": {                      "type": [                        "string",                        "null"                      ]                    },                    "entries": {                      "type": "array",                      "items": {                        "type": "string"                      }                    },                    "dependencies": {                      "type": "array",                      "items": {                        "type": "string"                      }                    },                    "versions": {                      "type": "object",                      "properties": {                        "languageVersion": {                          "type": "number"                        },                        "bindingAbiVersion": {                          "type": "number"                        },                        "packageVersion": {                          "type": "string"                        }                      },                      "required": [                        "languageVersion",                        "bindingAbiVersion",                        "packageVersion"                      ],                      "additionalProperties": {}                    }                  },                  "required": [                    "context",                    "status",                    "fingerprint",                    "entries",                    "dependencies"                  ],                  "additionalProperties": {}                },                "manifest": {                  "type": "object",                  "propertyNames": {                    "type": "string"                  },                  "additionalProperties": {                    "$ref": "#/definitions/__schema0"                  }                },                "directiveEntries": {                  "type": "array",                  "items": {                    "type": "object",                    "properties": {                      "name": {                        "type": "string"                      },                      "range": {                        "type": "object",                        "properties": {                          "start": {                            "type": "number"                          },                          "end": {                            "type": "number"                          }                        },                        "required": [                          "start",                          "end"                        ],                        "additionalProperties": false                      },                      "prelude": {                        "type": "string"                      },                      "hasBlock": {                        "type": "boolean"                      },                      "quotedStrings": {                        "type": "number"                      }                    },                    "required": [                      "name",                      "range",                      "prelude",                      "hasBlock",                      "quotedStrings"                    ],                    "additionalProperties": {}                  }                },                "dependencies": {                  "type": "array",                  "items": {                    "type": "string"                  }                },                "css": {                  "type": "object",                  "properties": {                    "bytes": {                      "type": "number"                    },                    "text": {                      "type": "string"                    }                  },                  "required": [                    "bytes"                  ],                  "additionalProperties": {}                },                "summary": {                  "type": "object",                  "propertyNames": {                    "type": "string"                  },                  "additionalProperties": {                    "$ref": "#/definitions/__schema0"                  }                }              },              "required": [                "compositions",                "context",                "manifest",                "directiveEntries",                "dependencies",                "css",                "summary"              ],              "additionalProperties": {}            }          },          "required": [            "status",            "data"          ],          "additionalProperties": false        },        {          "type": "object",          "properties": {            "status": {              "type": "string",              "const": "error"            },            "error": {              "type": "object",              "properties": {                "code": {                  "type": "string"                },                "message": {                  "type": "string"                }              },              "required": [                "code",                "message"              ],              "additionalProperties": false            }          },          "required": [            "status",            "error"          ],          "additionalProperties": false        }      ]    }  },  "required": [    "version",    "metadata",    "diagnostics",    "result"  ],  "additionalProperties": false,  "definitions": {    "__schema0": {      "anyOf": [        {          "type": "string"        },        {          "type": "number"        },        {          "type": "boolean"        },        {          "type": "null"        },        {          "type": "array",          "items": {            "$ref": "#/definitions/__schema0"          }        },        {          "type": "object",          "propertyNames": {            "type": "string"          },          "additionalProperties": {            "$ref": "#/definitions/__schema0"          }        }      ]    }  }}

Project context and lifecycle

This operation does not write workspace files.

The local stdio server uses the workspace passed to --root. Confirm the root and intended CSS entries with mastercss_workspace_info before relying on project-dependent values.

See the MCP workflow guide for client setup and the preview/apply workflow.


© 2026 Aoyue Design LLC.MIT License
Trademark Policy