About Oh My Posh Validator
Oh My Posh Validator is an MCP server for developers working with oh-my-posh configurations. It checks full configurations and individual segment snippets in JSON, YAML, or TOML, with detailed errors and warnings.
Key features
- 01Validate full configurations
- 02Validate individual segment snippets
- 03Accept JSON, YAML, and TOML
- 04Return path-specific errors and warnings
Use cases
- 01Check a configuration before using it
- 02Test a segment before adding it to a configuration
MCP support
It exposes `validate_config` and `validate_segment` tools to MCP clients over HTTP. The server also provides endpoint information and a tool list.
Configuration
Remote servers need no local install. Pick your client, then copy the config or install in one click.
https://ohmyposh.dev/api/mcpclaude mcp add --transport http dev-ohmyposh-validator https://ohmyposh.dev/api/mcp{"mcpServers":{"dev-ohmyposh-validator":{"type":"http","url":"https://ohmyposh.dev/api/mcp"}}}Open in Cursor{"servers":{"dev-ohmyposh-validator":{"type":"http","url":"https://ohmyposh.dev/api/mcp"}}}Open in VS Code{"mcpServers":{"dev-ohmyposh-validator":{"type":"http","url":"https://ohmyposh.dev/api/mcp"}}}{"mcpServers":{"dev-ohmyposh-validator":{"serverUrl":"https://ohmyposh.dev/api/mcp"}}}Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.
Tools
2| Parameter | Type | Required | Description |
|---|---|---|---|
| format | enum | No | The format of the configuration (auto-detect if not specified)json | yaml | toml | auto |
| content | string | Yes | The configuration content as a string (JSON, YAML, or TOML) |
Details
From the project READMEtitle: MCP Validator Function description: 'Azure Function implementing the Model Context Protocol server for validating oh-my-posh configurations'
Overview
This directory contains the Azure Function that implements the Model Context Protocol (MCP) server for validating oh-my-posh configurations.
Endpoints
POST /api/mcp- MCP server endpoint that handles validation requestsGET /api/mcp- Returns server information and available tools
Supported Tools
validate_config
Validate an oh-my-posh configuration.
- Supports JSON, YAML, and TOML formats
- Returns detailed validation errors with JSON paths
validate_segment
Validate a segment snippet (individual prompt segment).
- Validates against the segment schema definition
- Useful for testing individual segments before adding them to a full configuration
- Supports JSON, YAML, and TOML formats
Usage
As an MCP Server
Configure your MCP client to connect to this server:
{
"mcpServers": {
"oh-my-posh-validator": {
"type": "http",
"url": "https://ohmyposh.dev/api/mcp"
}
}
}
Direct HTTP Requests
Get Server Info
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\",\"blocks\":[]}",
"format": "json"
}
},
"id": 1
}'
Validate a Segment Snippet
curl -X POST https://ohmyposh.dev/api/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "validate_segment",
"arguments": {
"content": "{\"type\":\"path\",\"style\":\"powerline\",\"foreground\":\"#ffffff\",\"background\":\"#61AFEF\",\"template\":\" {{ .Path }} \"}",
"format": "json"
}
},
"id": 2
}'
Response Format
The validation result includes:
valid: Boolean indicating if the configuration is validerrors: Array of validation errors (if any)warnings: Array of warnings (best practices, deprecations)detectedFormat: The detected or specified formatparsedConfig: The parsed configuration object (for debugging)
Example response:
{
"jsonrpc": "2.0",
"result": {
"content": [
{
"type": "text",
"text": "{
\"valid\": true,
\"errors\": [],
\"warnings\": [
{
\"path\": \"$schema\",
\"message\": \"Consider adding \\\"$schema\\\" property for better editor support.\",
\"type\": \"recommendation\"
}
],
\"detectedFormat\": \"json\",
\"parsedConfig\": {...}
}"
}
]
},
"id": 1
}
Development
To test locally:
cd website/api
npm install
npm start
Then send requests to http://localhost:7071/api/mcp
Publishing to MCP Registry
This server is published to the MCP Registry using GitHub Actions.
Publishing
Publishing is triggered automatically when you push a version tag (same as oh-my-posh releases):
git tag v9.0.0
git push origin v9.0.0
The workflow will:
- Extract version from the tag (e.g.,
v9.0.0→9.0.0) - Update
server.jsonversion to match - Validate the
server.jsonfile - Authenticate with the MCP Registry using GitHub OIDC
- Publish the server to the registry
Note: The MCP server version will stay in sync with oh-my-posh versions automatically.
Files
server.json- MCP Registry server configurationserver.schema.json- JSON schema for validationvalidate-server.js- Validation script.github/workflows/publish-mcp.yml- GitHub Actions workflow
Validating server.json Locally
cd website/api
npm install
cd mcp
node validate-server.js
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.