Skip to main content

MCP Server

What is the Oh My Posh MCP Server?โ€‹

The Oh My Posh MCP (Model Context Protocol) Server is a validation service that allows you to validate your oh-my-posh theme configurations against the official JSON schema. It supports JSON, YAML, and TOML formats and provides detailed error reporting to help you create valid configurations.

Featuresโ€‹

  • Multi-format Support: Validates JSON, YAML, and TOML configurations
  • Detailed Error Reporting: Get precise validation errors with JSON paths
  • Format Auto-detection: Automatically detects the format of your configuration
  • Warnings & Recommendations: Receive best practice suggestions and deprecation warnings
  • Standards-based: Uses the official oh-my-posh JSON schema
  • Remote Access: No installation required - access via HTTPS

Usageโ€‹

With MCP Clientsโ€‹

Configure your MCP-compatible client (like Claude Desktop, Cline, or other AI assistants) to use the validator:

{
"mcpServers": {
"oh-my-posh-validator": {
"url": "https://ohmyposh.dev/api/mcp",
"transport": "http"
}
}
}

Then ask your AI assistant to validate your oh-my-posh configuration.

Direct HTTP APIโ€‹

You can also use the validator directly via HTTP requests.

Get Server Informationโ€‹

curl https://ohmyposh.dev/api/mcp

List Available Toolsโ€‹

curl -X POST https://ohmyposh.dev/api/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "tools/list",
"id": 1
}'

Validate a Configurationโ€‹

curl -X POST https://ohmyposh.dev/api/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "validate_config",
"arguments": {
"content": "{\"$schema\":\"https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json\",\"version\":4,\"blocks\":[]}",
"format": "json"
}
},
"id": 1
}'

Tool Parametersโ€‹

validate_configโ€‹

Parameters:

ParameterTypeRequiredDescription
contentstringYesThe configuration content as a string (JSON, YAML, or TOML)
formatstringNoThe format: json, yaml, toml, or auto (default: auto)

Returns:

{
"valid": true,
"errors": [],
"warnings": [
{
"path": "$schema",
"message": "Consider adding \"$schema\" property for better editor support.",
"type": "recommendation"
}
],
"detectedFormat": "json",
"parsedConfig": { ... }
}

Response Fieldsโ€‹

FieldTypeDescription
validbooleanWhether the configuration is valid
errorsarrayList of validation errors (empty if valid)
warningsarrayList of warnings and recommendations
detectedFormatstringThe detected or specified format
parsedConfigobjectThe parsed configuration object

Error Formatโ€‹

Each error in the errors array contains:

FieldTypeDescription
pathstringJSON path to the problematic property
messagestringHuman-readable error message
keywordstringThe validation keyword that failed
paramsobjectAdditional parameters about the error
dataanyThe actual data that failed validation

Examplesโ€‹

Valid Configurationโ€‹

{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"version": 4,
"blocks": [
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"type": "path",
"style": "powerline",
"background": "blue",
"foreground": "white"
}
]
}
]
}

Invalid Configuration Exampleโ€‹

{
"blocks": [
{
"type": "invalid-type"
}
]
}

Validation Result:

{
"valid": false,
"errors": [
{
"path": "/blocks/0/type",
"message": "Value must be one of: prompt, rprompt, line",
"keyword": "enum"
}
]
}

Integration Examplesโ€‹

Claude Desktopโ€‹

Add to your Claude Desktop configuration (~/Library/Application Support/Claude/config.json on macOS):

{
"mcpServers": {
"oh-my-posh-validator": {
"url": "https://ohmyposh.dev/api/mcp",
"transport": "http"
}
}
}

Then ask Claude: "Can you validate this oh-my-posh configuration for me?" and paste your config.

Cline (VS Code Extension)โ€‹

Configure Cline to use the MCP server, and it will automatically validate configurations when you're working on oh-my-posh themes.

Supported Formatsโ€‹

JSONโ€‹

{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"version": 4,
"blocks": []
}

YAMLโ€‹

$schema: https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json
version: 4
blocks: []

TOMLโ€‹

version = 4
blocks = []

Privacy & Securityโ€‹

  • Your configuration content is not stored or logged
  • All validation is done in-memory and discarded after processing
  • The server only reads the official schema from the repository
  • No authentication required - fully anonymous

Source Codeโ€‹

The MCP server is open source and part of the oh-my-posh repository:

Troubleshootingโ€‹

Format Not Detected Correctlyโ€‹

If auto-detection fails, explicitly specify the format:

{
"arguments": {
"content": "...",
"format": "yaml"
}
}

Parse Errorsโ€‹

If you get parse errors, check that your configuration is valid JSON/YAML/TOML syntax before validating the schema.

Schema Errorsโ€‹

The validator uses the latest schema from the main branch. If you're using an older oh-my-posh version, some newer properties might not be recognized.

Contributingโ€‹

Found a bug or have a suggestion? Please open an issue on GitHub.