Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 08:49:50 +08:00
commit adc4b2be25
147 changed files with 24716 additions and 0 deletions

View File

@@ -0,0 +1,171 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MXCP Common Type Definitions",
"description": "Common type definitions shared across MXCP tool, resource, and prompt schemas",
"definitions": {
"typeDefinition": {
"type": "object",
"required": ["type"],
"properties": {
"type": {
"type": "string",
"enum": ["string", "number", "integer", "boolean", "array", "object"],
"description": "The data type of the value."
},
"format": {
"type": "string",
"enum": ["email", "uri", "date", "time", "date-time", "duration", "timestamp"],
"description": "Expected format for string values."
},
"sensitive": {
"type": "boolean",
"description": "Whether this field contains sensitive data that should be redacted in logs and filtered by policies.",
"default": false
},
"minLength": {
"type": "integer",
"minimum": 0,
"description": "Minimum string length."
},
"maxLength": {
"type": "integer",
"minimum": 0,
"description": "Maximum string length."
},
"minimum": {
"type": "number",
"description": "Minimum value for numbers or integers."
},
"maximum": {
"type": "number",
"description": "Maximum value for numbers or integers."
},
"exclusiveMinimum": {
"type": "number",
"description": "Exclusive minimum value for numbers or integers."
},
"exclusiveMaximum": {
"type": "number",
"description": "Exclusive maximum value for numbers or integers."
},
"multipleOf": {
"type": "number",
"description": "Value must be a multiple of this for numbers or integers."
},
"minItems": {
"type": "integer",
"minimum": 0,
"description": "Minimum number of array items."
},
"maxItems": {
"type": "integer",
"minimum": 0,
"description": "Maximum number of array items."
},
"uniqueItems": {
"type": "boolean",
"description": "Whether array items must be unique."
},
"items": {
"$ref": "#/definitions/typeDefinition",
"description": "Schema for items if type is array."
},
"properties": {
"type": "object",
"description": "Schema for object properties if type is object.",
"additionalProperties": {
"$ref": "#/definitions/typeDefinition"
}
},
"required": {
"type": "array",
"description": "List of required fields if type is object.",
"items": { "type": "string" }
},
"additionalProperties": {
"type": "boolean",
"description": "Whether to allow additional properties not defined in the schema. Defaults to true if not specified."
}
}
},
"paramDefinition": {
"type": "object",
"required": ["name", "type", "description"],
"properties": {
"name": {
"type": "string",
"description": "Parameter name.",
"pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$",
"minLength": 1
},
"description": {
"type": "string",
"description": "What this parameter represents."
},
"default": {
"description": "Optional default value if none is provided."
},
"examples": {
"type": "array",
"description": "Example values for this parameter.",
"items": {}
},
"enum": {
"type": "array",
"description": "List of allowed values.",
"items": {}
}
},
"allOf": [
{ "$ref": "#/definitions/typeDefinition" }
]
},
"policySet": {
"type": "object",
"description": "Policy definitions for endpoint access control and data filtering.",
"properties": {
"input": {
"type": "array",
"description": "Input policies evaluated before endpoint execution.",
"items": { "$ref": "#/definitions/policyDefinition" }
},
"output": {
"type": "array",
"description": "Output policies evaluated after endpoint execution.",
"items": { "$ref": "#/definitions/policyDefinition" }
}
},
"additionalProperties": false
},
"policyDefinition": {
"type": "object",
"required": ["condition", "action"],
"description": "A single policy rule definition.",
"properties": {
"condition": {
"type": "string",
"description": "CEL expression that determines when this policy applies."
},
"action": {
"type": "string",
"enum": ["deny", "filter_fields", "mask_fields", "filter_sensitive_fields"],
"description": "Action to take when the condition is true."
},
"reason": {
"type": "string",
"description": "Human-readable explanation for the policy action."
},
"fields": {
"type": "array",
"items": { "type": "string" },
"description": "List of field names for filter_fields and mask_fields actions."
}
},
"additionalProperties": false
}
}
}

View File

@@ -0,0 +1,145 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MXCP Drift Report",
"type": "object",
"required": ["version", "generated_at", "baseline_snapshot_path", "current_snapshot_generated_at", "baseline_snapshot_generated_at", "has_drift", "summary", "table_changes", "resource_changes"],
"properties": {
"version": {
"type": "integer",
"description": "Version of the drift report format. Must be 1.",
"enum": [1],
"default": 1
},
"generated_at": {
"type": "string",
"format": "date-time",
"description": "ISO 8601 timestamp when the report was generated"
},
"baseline_snapshot_path": {
"type": "string",
"description": "Path to the baseline snapshot file"
},
"current_snapshot_generated_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp when the current snapshot was generated"
},
"baseline_snapshot_generated_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp when the baseline snapshot was generated"
},
"has_drift": {
"type": "boolean",
"description": "Whether any drift was detected"
},
"summary": {
"type": "object",
"description": "Summary counts of changes by type",
"properties": {
"tables_added": { "type": "integer" },
"tables_removed": { "type": "integer" },
"tables_modified": { "type": "integer" },
"resources_added": { "type": "integer" },
"resources_removed": { "type": "integer" },
"resources_modified": { "type": "integer" }
},
"additionalProperties": false
},
"table_changes": {
"type": "array",
"description": "List of table changes detected",
"items": {
"type": "object",
"required": ["name", "change_type"],
"properties": {
"name": {
"type": "string",
"description": "Name of the table"
},
"change_type": {
"type": "string",
"enum": ["added", "removed", "modified"],
"description": "Type of change"
},
"columns_added": {
"type": "array",
"description": "Columns that were added",
"items": {
"type": "object",
"required": ["name", "type"],
"properties": {
"name": { "type": "string" },
"type": { "type": "string" }
}
}
},
"columns_removed": {
"type": "array",
"description": "Columns that were removed",
"items": {
"type": "object",
"required": ["name", "type"],
"properties": {
"name": { "type": "string" },
"type": { "type": "string" }
}
}
},
"columns_modified": {
"type": "array",
"description": "Columns that were modified",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"old_type": { "type": "string" },
"new_type": { "type": "string" }
}
}
}
}
}
},
"resource_changes": {
"type": "array",
"description": "List of resource changes detected",
"items": {
"type": "object",
"required": ["path", "change_type"],
"properties": {
"path": {
"type": "string",
"description": "Path to the resource file"
},
"endpoint": {
"type": "string",
"description": "Endpoint identifier (e.g., 'tool/name')"
},
"change_type": {
"type": "string",
"enum": ["added", "removed", "modified"],
"description": "Type of change"
},
"validation_changed": {
"type": "boolean",
"description": "Whether validation results changed"
},
"test_results_changed": {
"type": "boolean",
"description": "Whether test results changed"
},
"definition_changed": {
"type": "boolean",
"description": "Whether endpoint definition changed"
},
"details": {
"type": "object",
"description": "Specific details about what changed",
"additionalProperties": true
}
}
}
}
}
}

View File

@@ -0,0 +1,145 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MXCP Drift Snapshot",
"type": "object",
"required": ["version", "generated_at", "tables", "resources"],
"properties": {
"version": {
"type": "integer",
"description": "Version of the drift snapshot format. Must be 1.",
"enum": [1],
"default": 1
},
"generated_at": {
"type": "string",
"format": "date-time",
"description": "ISO 8601 timestamp when the snapshot was generated"
},
"tables": {
"type": "array",
"description": "List of tables in the DuckDB catalog",
"items": {
"type": "object",
"required": ["name", "columns"],
"properties": {
"name": {
"type": "string",
"description": "Name of the table"
},
"columns": {
"type": "array",
"description": "List of columns in the table",
"items": {
"type": "object",
"required": ["name", "type"],
"properties": {
"name": {
"type": "string",
"description": "Name of the column"
},
"type": {
"type": "string",
"description": "DuckDB data type of the column"
}
}
}
}
}
}
},
"resources": {
"type": "array",
"description": "List of resources with validation results, test results, and definition",
"items": {
"type": "object",
"required": ["validation_results"],
"properties": {
"validation_results": {
"type": "object",
"required": ["status", "path"],
"properties": {
"status": {
"type": "string",
"enum": ["ok", "error"],
"description": "Validation status"
},
"path": {
"type": "string",
"description": "Path to the endpoint file (relative to repository root)"
},
"message": {
"type": "string",
"description": "Error message if validation failed"
}
},
"description": "Results of validation for the resource"
},
"test_results": {
"type": "object",
"required": ["status", "tests_run"],
"properties": {
"status": {
"type": "string",
"enum": ["ok", "error", "failed"],
"description": "Test execution status"
},
"tests_run": {
"type": "integer",
"description": "Number of tests run"
},
"tests": {
"type": "array",
"description": "List of per-test results",
"items": {
"type": "object",
"required": ["name", "status", "time"],
"properties": {
"name": {
"type": "string",
"description": "Name of the test"
},
"description": {
"type": "string",
"description": "Description of the test"
},
"status": {
"type": "string",
"enum": ["passed", "failed", "error"],
"description": "Test status"
},
"error": {
"type": "string",
"description": "Error message if test failed"
},
"time": {
"type": "number",
"description": "Time taken to run the test in seconds"
}
}
}
}
},
"description": "Results of tests for the resource"
},
"definition": {
"oneOf": [
{ "$ref": "../../endpoints/endpoint_schemas/tool-schema-1.json#/definitions/toolDefinition" },
{ "$ref": "../../endpoints/endpoint_schemas/resource-schema-1.json#/definitions/resourceDefinition" },
{ "$ref": "../../endpoints/endpoint_schemas/prompt-schema-1.json#/definitions/promptDefinition" }
],
"description": "Endpoint definition"
},
"metadata": {
"type": "object",
"properties": {
"title": { "type": "string", "description": "Short display title" },
"description": { "type": "string", "description": "Longer description" }
},
"description": "Optional metadata for documentation purposes"
}
}
}
}
}
}

View File

@@ -0,0 +1,111 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MXCP Eval Suite",
"type": "object",
"required": ["mxcp", "suite", "tests"],
"properties": {
"mxcp": {
"type": "integer",
"description": "Schema version. Must be 1.",
"enum": [1],
"default": 1
},
"suite": {
"type": "string",
"description": "Name of the eval suite (e.g., 'churn_checks')",
"pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$"
},
"description": {
"type": "string",
"description": "Description of what this eval suite tests"
},
"model": {
"type": "string",
"description": "Optional model to use for this suite (e.g., 'claude-4-opus')",
"enum": [
"claude-4-opus",
"claude-4-sonnet",
"gpt-4o",
"gpt-4.1"
]
},
"tests": {
"type": "array",
"description": "List of eval tests to run",
"items": {
"type": "object",
"required": ["name", "prompt", "assertions"],
"properties": {
"name": {
"type": "string",
"description": "Name of the test",
"pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$"
},
"description": {
"type": "string",
"description": "What this test is checking"
},
"prompt": {
"type": "string",
"description": "The prompt to send to the LLM"
},
"user_context": {
"type": "object",
"description": "Optional user context for this test (e.g., role, permissions)",
"additionalProperties": true
},
"assertions": {
"type": "object",
"description": "Assertions to validate the LLM's response",
"properties": {
"must_call": {
"type": "array",
"description": "Tools that must be called with specific arguments",
"items": {
"type": "object",
"required": ["tool", "args"],
"properties": {
"tool": {
"type": "string",
"description": "Name of the tool that must be called"
},
"args": {
"type": "object",
"description": "Expected arguments for the tool call",
"additionalProperties": true
}
},
"additionalProperties": false
}
},
"must_not_call": {
"type": "array",
"description": "List of tool names that should NOT be called",
"items": {
"type": "string"
}
},
"answer_contains": {
"type": "array",
"description": "Strings that must appear in the LLM's answer",
"items": {
"type": "string"
}
},
"answer_not_contains": {
"type": "array",
"description": "Strings that must NOT appear in the LLM's answer",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}

View File

@@ -0,0 +1,585 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MXCP Config",
"type": "object",
"required": ["mxcp", "projects"],
"properties": {
"mxcp": {
"type": "integer",
"description": "Schema version. Must be 1.",
"enum": [1],
"default": 1
},
"vault": {
"type": "object",
"description": "Configuration for Vault integration.",
"required": ["enabled"],
"properties": {
"enabled": { "type": "boolean" },
"address": {
"type": "string",
"format": "uri"
},
"token_env": {
"type": "string",
"description": "The environment variable name containing the Vault token."
}
},
"additionalProperties": false
},
"onepassword": {
"type": "object",
"description": "Configuration for 1Password integration using service account.",
"required": ["enabled"],
"properties": {
"enabled": { "type": "boolean" },
"token_env": {
"type": "string",
"description": "The environment variable name containing the 1Password service account token.",
"default": "OP_SERVICE_ACCOUNT_TOKEN"
}
},
"additionalProperties": false
},
"transport": {
"type": "object",
"description": "Default transport configuration for serving endpoints.",
"properties": {
"provider": {
"type": "string",
"enum": ["streamable-http", "sse", "stdio"],
"default": "streamable-http",
"description": "Default transport protocol to use."
},
"http": {
"type": "object",
"description": "HTTP transport specific configuration.",
"properties": {
"port": {
"type": "integer",
"minimum": 1,
"maximum": 65535,
"default": 8000,
"description": "Default port number for HTTP transport."
},
"host": {
"type": "string",
"default": "localhost",
"description": "Default host to bind the HTTP server to."
},
"scheme": {
"type": "string",
"enum": ["http", "https"],
"default": "http",
"description": "URL scheme to use for generating callback URLs and OAuth endpoints. Use 'https' when behind SSL-terminating reverse proxy."
},
"base_url": {
"type": "string",
"format": "uri",
"description": "Complete base URL for the server (e.g., 'https://api.example.com'). When provided, overrides scheme, host, and port for URL generation."
},
"trust_proxy": {
"type": "boolean",
"default": false,
"description": "Whether to trust X-Forwarded-* headers from reverse proxies for scheme detection."
},
"stateless": {
"type": "boolean",
"default": false,
"description": "Enable stateless HTTP mode for serverless deployments. In stateless mode, no session state is maintained between requests."
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"models": {
"type": "object",
"description": "Configuration for LLM models used in evals.",
"properties": {
"default": {
"type": "string",
"description": "Default model to use when not specified in eval suite.",
"enum": ["claude-4-sonnet", "claude-4-opus", "gpt-4o", "gpt-4.1"]
},
"models": {
"type": "object",
"description": "Model-specific configurations.",
"patternProperties": {
"^(claude-4-sonnet|claude-4-opus|gpt-4o|gpt-4\\.1)$": {
"type": "object",
"required": ["type"],
"properties": {
"type": {
"type": "string",
"enum": ["claude", "openai"],
"description": "Provider type for this model."
},
"api_key": {
"type": "string",
"description": "API key for this model."
},
"base_url": {
"type": "string",
"format": "uri",
"description": "Custom API endpoint URL."
},
"timeout": {
"type": "integer",
"minimum": 1,
"default": 30,
"description": "Request timeout in seconds."
},
"max_retries": {
"type": "integer",
"minimum": 0,
"default": 3,
"description": "Maximum number of retries for failed requests."
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"projects": {
"type": "object",
"description": "All configured RAW projects.",
"patternProperties": {
"^[a-zA-Z0-9_-]+$": {
"type": "object",
"required": ["profiles"],
"properties": {
"profiles": {
"type": "object",
"description": "Profiles under this project.",
"patternProperties": {
"^[a-zA-Z0-9_-]+$": {
"type": "object",
"properties": {
"secrets": {
"type": "array",
"items": {
"type": "object",
"required": ["name", "type", "parameters"],
"properties": {
"name": { "type": "string", "description": "The secret name." },
"type": { "type": "string", "description": "The secret type." },
"parameters": {
"type": "object",
"description": "The secret definition.",
"additionalProperties": {
"oneOf": [
{ "type": "string" },
{
"type": "object",
"additionalProperties": { "type": "string" }
}
]
}
}
},
"additionalProperties": false
}
},
"telemetry": {
"type": "object",
"description": "Unified telemetry configuration for traces, metrics, and logs.",
"properties": {
"enabled": {
"type": "boolean",
"description": "Global telemetry enable/disable.",
"default": false
},
"endpoint": {
"type": "string",
"description": "OTLP endpoint URL (e.g., http://localhost:4318).",
"format": "uri"
},
"headers": {
"type": "object",
"description": "Additional headers for the OTLP exporter.",
"additionalProperties": {
"type": "string"
}
},
"service_name": {
"type": "string",
"description": "Override the default service name (mxcp)."
},
"service_version": {
"type": "string",
"description": "Service version string."
},
"environment": {
"type": "string",
"description": "Deployment environment (e.g., production, staging)."
},
"resource_attributes": {
"type": "object",
"description": "Additional resource attributes for all telemetry.",
"additionalProperties": {
"type": "string"
}
},
"tracing": {
"type": "object",
"description": "Distributed tracing configuration.",
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether tracing is enabled.",
"default": true
},
"console_export": {
"type": "boolean",
"description": "Export spans to console for debugging.",
"default": false
}
},
"additionalProperties": false
},
"metrics": {
"type": "object",
"description": "Metrics collection configuration.",
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether metrics collection is enabled.",
"default": true
},
"export_interval": {
"type": "integer",
"description": "Export interval in seconds.",
"default": 60,
"minimum": 1
},
"prometheus_port": {
"type": "integer",
"description": "Optional port for Prometheus scraping endpoint.",
"minimum": 1024,
"maximum": 65535
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"plugin": {
"type": "object",
"description": "Plugin configuration for this profile.",
"properties": {
"config": {
"type": "object",
"description": "Plugin-specific configurations.",
"patternProperties": {
"^[a-zA-Z0-9_-]+$": {
"type": "object",
"description": "Configuration for a specific plugin.",
"additionalProperties": {
"type": "string"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"auth": {
"type": "object",
"description": "Authentication configuration for this profile",
"properties": {
"provider": {
"type": "string",
"enum": ["none", "github", "atlassian", "salesforce", "keycloak", "google"],
"default": "none",
"description": "OAuth provider to use for authentication"
},
"authorization": {
"type": "object",
"description": "Authorization settings for controlling access to MCP functionality",
"properties": {
"required_scopes": {
"type": "array",
"items": {"type": "string"},
"default": [],
"description": "List of scopes required to access any MCP endpoint. Empty list means no scopes required (authentication only)."
}
}
},
"clients": {
"type": "array",
"description": "Pre-registered OAuth clients for development and testing.",
"items": {
"type": "object",
"required": ["client_id", "name"],
"properties": {
"client_id": {
"type": "string",
"description": "OAuth client ID."
},
"client_secret": {
"type": "string",
"description": "OAuth client secret (optional for public clients)."
},
"name": {
"type": "string",
"description": "Human-readable name for this client."
},
"redirect_uris": {
"type": "array",
"items": {
"type": "string",
"format": "uri"
},
"description": "Allowed redirect URIs for this client.",
"default": ["http://127.0.0.1:49153/oauth/callback"]
},
"grant_types": {
"type": "array",
"items": {
"type": "string",
"enum": ["authorization_code", "refresh_token"]
},
"description": "Allowed OAuth grant types.",
"default": ["authorization_code"]
},
"scopes": {
"type": "array",
"items": {
"type": "string"
},
"description": "Allowed OAuth scopes.",
"default": ["mxcp:access"]
}
},
"additionalProperties": false
}
},
"github": {
"type": "object",
"description": "GitHub OAuth configuration (required when provider is 'github').",
"required": ["client_id", "client_secret", "callback_path", "auth_url", "token_url"],
"properties": {
"client_id": {
"type": "string",
"description": "GitHub OAuth client ID."
},
"client_secret": {
"type": "string",
"description": "GitHub OAuth client secret."
},
"scope": {
"type": "string",
"description": "OAuth scope to request (optional).",
"default": "user:email"
},
"callback_path": {
"type": "string",
"description": "Callback path for OAuth flow.",
"default": "/github/callback"
},
"auth_url": {
"type": "string",
"format": "uri",
"description": "GitHub authorization URL."
},
"token_url": {
"type": "string",
"format": "uri",
"description": "GitHub token exchange URL."
}
},
"additionalProperties": false
},
"atlassian": {
"type": "object",
"description": "Atlassian OAuth configuration (required when provider is 'atlassian').",
"required": ["client_id", "client_secret", "callback_path", "auth_url", "token_url"],
"properties": {
"client_id": {
"type": "string",
"description": "Atlassian OAuth client ID."
},
"client_secret": {
"type": "string",
"description": "Atlassian OAuth client secret."
},
"scope": {
"type": "string",
"description": "OAuth scopes to request (space-separated).",
"default": "read:jira-work read:jira-user read:confluence-content.all read:confluence-user offline_access"
},
"callback_path": {
"type": "string",
"description": "Callback path for OAuth flow.",
"default": "/atlassian/callback"
},
"auth_url": {
"type": "string",
"format": "uri",
"description": "Atlassian authorization URL.",
"default": "https://auth.atlassian.com/authorize"
},
"token_url": {
"type": "string",
"format": "uri",
"description": "Atlassian token exchange URL.",
"default": "https://auth.atlassian.com/oauth/token"
}
},
"additionalProperties": false
},
"salesforce": {
"type": "object",
"description": "Salesforce OAuth configuration (required when provider is 'salesforce').",
"required": ["client_id", "client_secret", "callback_path", "auth_url", "token_url"],
"properties": {
"client_id": {
"type": "string",
"description": "Salesforce OAuth client ID."
},
"client_secret": {
"type": "string",
"description": "Salesforce OAuth client secret."
},
"scope": {
"type": "string",
"description": "OAuth scopes to request (space-separated).",
"default": "api refresh_token openid profile email"
},
"callback_path": {
"type": "string",
"description": "Callback path for OAuth flow.",
"default": "/salesforce/callback"
},
"auth_url": {
"type": "string",
"format": "uri",
"description": "Salesforce authorization URL.",
"default": "https://login.salesforce.com/services/oauth2/authorize"
},
"token_url": {
"type": "string",
"format": "uri",
"description": "Salesforce token exchange URL.",
"default": "https://login.salesforce.com/services/oauth2/token"
}
},
"additionalProperties": false
},
"keycloak": {
"type": "object",
"description": "Keycloak OAuth configuration (required when provider is 'keycloak').",
"required": ["client_id", "client_secret", "realm", "server_url"],
"properties": {
"client_id": {
"type": "string",
"description": "Keycloak OAuth client ID."
},
"client_secret": {
"type": "string",
"description": "Keycloak OAuth client secret."
},
"realm": {
"type": "string",
"description": "Keycloak realm name."
},
"server_url": {
"type": "string",
"format": "uri",
"description": "Keycloak server base URL (e.g., 'http://localhost:8080')."
},
"scope": {
"type": "string",
"description": "OAuth scopes to request (space-separated).",
"default": "openid profile email"
},
"callback_path": {
"type": "string",
"description": "Callback path for OAuth flow.",
"default": "/keycloak/callback"
}
},
"additionalProperties": false
},
"google": {
"type": "object",
"description": "Google OAuth configuration (required when provider is 'google').",
"required": ["client_id", "client_secret", "callback_path", "auth_url", "token_url"],
"properties": {
"client_id": {
"type": "string",
"description": "Google OAuth client ID."
},
"client_secret": {
"type": "string",
"description": "Google OAuth client secret."
},
"scope": {
"type": "string",
"description": "OAuth scopes to request (space-separated).",
"default": "https://www.googleapis.com/auth/calendar.readonly openid profile email"
},
"callback_path": {
"type": "string",
"description": "Callback path for OAuth flow.",
"default": "/google/callback"
},
"auth_url": {
"type": "string",
"format": "uri",
"description": "Google authorization URL.",
"default": "https://accounts.google.com/o/oauth2/v2/auth"
},
"token_url": {
"type": "string",
"format": "uri",
"description": "Google token exchange URL.",
"default": "https://oauth2.googleapis.com/token"
}
},
"additionalProperties": false
},
"persistence": {
"type": "object",
"description": "OAuth state persistence configuration for maintaining authentication state across server restarts.",
"properties": {
"type": {
"type": "string",
"enum": ["sqlite"],
"default": "sqlite",
"description": "Type of persistence backend to use."
},
"path": {
"type": "string",
"description": "Path to the SQLite database file for storing OAuth state.",
"default": "~/.mxcp/oauth.db"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}

View File

@@ -0,0 +1,270 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MXCP Site Config (mxcp-site.yml)",
"type": "object",
"required": ["mxcp", "project", "profile"],
"properties": {
"mxcp": {
"type": "integer",
"description": "Version of the mxcp-site.yml format. Must be 1.",
"enum": [1],
"default": 1
},
"project": {
"type": "string",
"description": "Project name (must match one in ~/.mxcp/config.yml)."
},
"profile": {
"type": "string",
"description": "Profile name under the given project."
},
"secrets": {
"type": "array",
"description": "List of secret names used by this repo (resolved from ~/.mxcp/config.yml).",
"items": {
"type": "string"
}
},
"plugin": {
"type": "array",
"description": "List of plugin modules to load and their configurations.",
"items": {
"type": "object",
"required": ["name", "module"],
"properties": {
"name": {
"type": "string",
"description": "The name of the plugin instance."
},
"module": {
"type": "string",
"description": "The Python module containing the MXCP plugin."
},
"config": {
"type": "string",
"description": "Optional name of the configuration to use from the user config (resolved from ~/.mxcp/config.yml)."
}
},
"additionalProperties": false
}
},
"extensions": {
"type": "array",
"description": "List of DuckDB extensions to load. Can be simple strings for core extensions or objects with name/repo for community/nightly extensions.",
"items": {
"oneOf": [
{
"type": "string",
"description": "Name of a core DuckDB extension"
},
{
"type": "object",
"required": ["name"],
"properties": {
"name": {
"type": "string",
"description": "Name of the extension"
},
"repo": {
"type": "string",
"description": "Repository to load the extension from (e.g., 'community', 'core_nightly')",
"enum": ["community", "core_nightly"]
}
},
"additionalProperties": false
}
]
}
},
"dbt": {
"type": "object",
"description": "Controls dbt integration and file paths.",
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether to use dbt in this repo (defaults to true)."
},
"model_paths": {
"type": "array",
"description": "Paths to dbt model directories (defaults to ['models']).",
"items": {
"type": "string"
}
},
"analysis_paths": {
"type": "array",
"description": "Paths to dbt analysis directories (defaults to ['analyses']).",
"items": {
"type": "string"
}
},
"test_paths": {
"type": "array",
"description": "Paths to dbt test directories (defaults to ['tests']).",
"items": {
"type": "string"
}
},
"seed_paths": {
"type": "array",
"description": "Paths to dbt seed directories (defaults to ['seeds']).",
"items": {
"type": "string"
}
},
"macro_paths": {
"type": "array",
"description": "Paths to dbt macro directories (defaults to ['macros']).",
"items": {
"type": "string"
}
},
"snapshot_paths": {
"type": "array",
"description": "Paths to dbt snapshot directories (defaults to ['snapshots']).",
"items": {
"type": "string"
}
},
"target_path": {
"type": "string",
"description": "Path to dbt target directory (defaults to 'target')."
},
"clean_targets": {
"type": "array",
"description": "Paths to clean when running dbt clean (defaults to ['target', 'dbt_packages']).",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"profiles": {
"type": "object",
"description": "Profile-specific configuration settings.",
"patternProperties": {
"^[a-zA-Z0-9_-]+$": {
"type": "object",
"properties": {
"duckdb": {
"type": "object",
"description": "Profile-specific DuckDB configuration.",
"properties": {
"path": {
"type": "string",
"description": "Path to the DuckDB file for this profile."
},
"readonly": {
"type": "boolean",
"description": "Whether to open the DuckDB connection in read-only mode (defaults to false).",
"default": false
}
},
"additionalProperties": false
},
"drift": {
"type": "object",
"description": "Profile-specific MXCP schema drift detection manifest configuration.",
"properties": {
"path": {
"type": "string",
"description": "Path to the MXCP drift manifest file (JSON) for this profile."
}
},
"additionalProperties": false
},
"audit": {
"type": "object",
"description": "Profile-specific audit logging configuration.",
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether to enable audit logging for this profile (defaults to false).",
"default": false
},
"path": {
"type": "string",
"description": "Path to the audit log JSONL file for this profile."
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"sql_tools": {
"type": "object",
"description": "Configuration for built-in SQL querying and schema exploration tools.",
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether to enable built-in SQL querying and schema exploration tools (defaults to false).",
"default": false
}
},
"additionalProperties": false
},
"paths": {
"type": "object",
"description": "Directory paths for different types of MXCP components.",
"properties": {
"tools": {
"type": "string",
"description": "Directory path for tool definitions (defaults to 'tools').",
"default": "tools"
},
"resources": {
"type": "string",
"description": "Directory path for resource definitions (defaults to 'resources').",
"default": "resources"
},
"prompts": {
"type": "string",
"description": "Directory path for prompt definitions (defaults to 'prompts').",
"default": "prompts"
},
"evals": {
"type": "string",
"description": "Directory path for evaluation definitions (defaults to 'evals').",
"default": "evals"
},
"python": {
"type": "string",
"description": "Directory path for Python extensions and shared code (defaults to 'python').",
"default": "python"
},
"plugins": {
"type": "string",
"description": "Directory path for MXCP plugins (defaults to 'plugins').",
"default": "plugins"
},
"sql": {
"type": "string",
"description": "Directory path for SQL files (defaults to 'sql').",
"default": "sql"
},
"drift": {
"type": "string",
"description": "Directory path for drift snapshots (defaults to 'drift').",
"default": "drift"
},
"audit": {
"type": "string",
"description": "Directory path for audit logs (defaults to 'audit').",
"default": "audit"
},
"data": {
"type": "string",
"description": "Directory path for data files including DuckDB databases (defaults to 'data').",
"default": "data"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}

View File

@@ -0,0 +1,76 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MXCP Prompt Definition Schema",
"type": "object",
"required": ["mxcp", "prompt"],
"properties": {
"mxcp": {
"type": "integer",
"description": "Schema version. Must be 1.",
"enum": [1],
"default": 1
},
"prompt": {
"$ref": "#/definitions/promptDefinition",
"description": "Defines an MCP prompt endpoint."
},
"metadata": {
"type": "object",
"properties": {
"title": { "type": "string", "description": "Short display title." },
"description": { "type": "string", "description": "Longer description." }
},
"description": "Optional metadata for documentation purposes."
}
},
"definitions": {
"promptDefinition": {
"type": "object",
"required": ["name"],
"properties": {
"name": {
"type": "string",
"description": "Logical name identifying this prompt.",
"minLength": 1
},
"description": { "type": "string", "description": "Description of this prompt." },
"tags": {
"type": "array",
"items": { "type": "string" },
"description": "Tags to classify the prompt."
},
"parameters": {
"type": "array",
"description": "Input parameters used to populate the prompt.",
"items": { "$ref": "common-types-schema-1.json#/definitions/paramDefinition" }
},
"messages": {
"type": "array",
"description": "List of structured prompt messages forming the full prompt sequence.",
"items": {
"type": "object",
"required": ["prompt"],
"properties": {
"role": {
"type": "string",
"description": "The role of the speaker of the message (e.g. 'user', 'assistant', 'system')."
},
"type": {
"type": "string",
"description": "The content type of the message (e.g. 'text')."
},
"prompt": {
"type": "string",
"description": "The templated prompt text (supports Jinja syntax)."
}
},
"additionalProperties": false
}
}
}
}
}
}

View File

@@ -0,0 +1,149 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MXCP Resource Definition Schema",
"type": "object",
"required": ["mxcp", "resource"],
"properties": {
"mxcp": {
"type": "integer",
"description": "Schema version. Must be 1.",
"enum": [1],
"default": 1
},
"resource": {
"$ref": "#/definitions/resourceDefinition",
"description": "Defines an MCP resource endpoint."
},
"metadata": {
"type": "object",
"properties": {
"title": { "type": "string", "description": "Short display title." },
"description": { "type": "string", "description": "Longer description." }
},
"description": "Optional metadata for documentation purposes."
}
},
"definitions": {
"resourceDefinition": {
"type": "object",
"required": ["uri", "source"],
"properties": {
"uri": {
"type": "string",
"description": "Logical URI identifying this resource.",
"pattern": "^[A-Za-z][A-Za-z0-9+.-]*://(?:[A-Za-z0-9._-]+|\\{[A-Za-z_][A-Za-z0-9_]*\\})(?:/(?:[A-Za-z0-9._-]+|\\{[A-Za-z_][A-Za-z0-9_]*\\}))*$",
"minLength": 1,
"maxLength": 255
},
"name": {
"type": "string",
"description": "Name of this resource.",
"minLength": 1
},
"description": { "type": "string", "description": "Description of this resource." },
"tags": {
"type": "array",
"items": { "type": "string" },
"description": "Tags to classify this resource."
},
"mime_type": { "type": "string", "description": "MIME type of this resource." },
"parameters": {
"type": "array",
"description": "Input parameters for this endpoint.",
"items": { "$ref": "common-types-schema-1.json#/definitions/paramDefinition" }
},
"return": {
"$ref": "common-types-schema-1.json#/definitions/typeDefinition",
"description": "Description of the output schema."
},
"language": {
"type": "string",
"default": "sql",
"enum": ["sql", "python"],
"description": "The language used to define the logic of this endpoint. 'sql' or 'python'."
},
"source": {
"type": "object",
"description": "Source for the endpoint logic, either inline or a file reference.",
"oneOf": [
{ "required": ["code"], "not": { "required": ["file"] } },
{ "required": ["file"], "not": { "required": ["code"] } }
],
"properties": {
"code": {
"type": "string",
"description": "The inline code snippet to execute."
},
"file": {
"type": "string",
"description": "A relative path to a file containing the code."
}
},
"additionalProperties": false
},
"enabled": { "type": "boolean", "default": true, "description": "Whether this endpoint is active." },
"tests": {
"type": "array",
"description": "Tests to validate this endpoint.",
"items": {
"type": "object",
"required": ["name", "arguments"],
"properties": {
"name": { "type": "string", "description": "Name of the test." },
"description": { "type": "string", "description": "What the test checks." },
"arguments": {
"type": "array",
"items": {
"type": "object",
"required": ["key", "value"],
"properties": {
"key": { "type": "string", "description": "Input parameter to pass to test." },
"value": { "description": "Value of the input parameter to test." }
},
"additionalProperties": false
}
},
"result": { "description": "Expected result." },
"user_context": {
"type": "object",
"description": "User context for policy testing. Can include role, permissions, user_id, etc."
},
"result_contains": {
"description": "Partial match - result must contain these fields/values. For arrays, checks if array contains this item."
},
"result_not_contains": {
"type": "array",
"items": { "type": "string" },
"description": "List of field names that should NOT be present in the result."
},
"result_contains_item": {
"description": "For array results - at least one array item must match this object/value."
},
"result_contains_all": {
"type": "array",
"description": "For array results - all these items must be present (any order)."
},
"result_length": {
"type": "integer",
"minimum": 0,
"description": "For array results - array must have exactly this many items."
},
"result_contains_text": {
"type": "string",
"description": "For string results - result must contain this substring."
}
},
"additionalProperties": false
}
},
"policies": {
"$ref": "common-types-schema-1.json#/definitions/policySet",
"description": "Policy definitions for access control and data filtering."
}
}
}
}
}

View File

@@ -0,0 +1,168 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MXCP Tool Definition Schema",
"type": "object",
"required": ["mxcp", "tool"],
"properties": {
"mxcp": {
"type": "integer",
"description": "Schema version. Must be 1.",
"enum": [1],
"default": 1
},
"tool": {
"$ref": "#/definitions/toolDefinition",
"description": "Defines an MCP tool endpoint."
},
"metadata": {
"type": "object",
"properties": {
"title": { "type": "string", "description": "Short display title." },
"description": { "type": "string", "description": "Longer description." }
},
"description": "Optional metadata for documentation purposes."
}
},
"definitions": {
"toolDefinition": {
"type": "object",
"required": ["name", "source"],
"properties": {
"name": {
"type": "string",
"description": "Name of this tool.",
"minLength": 1
},
"description": { "type": "string", "description": "Description of this tool." },
"tags": {
"type": "array",
"items": { "type": "string" },
"description": "Tags to classify this tool."
},
"annotations": {
"type": "object",
"description": "Optional behavioral hints for this tool.",
"properties": {
"title": {
"type": "string",
"description": "Human-readable display title for the tool."
},
"readOnlyHint": {
"type": "boolean",
"description": "Hint: tool does not modify its environment (side-effect-free)."
},
"destructiveHint": {
"type": "boolean",
"description": "Hint: tool may perform destructive updates (e.g. delete, overwrite)."
},
"idempotentHint": {
"type": "boolean",
"description": "Hint: repeated calls with same arguments yield the same result."
},
"openWorldHint": {
"type": "boolean",
"description": "Hint: tool interacts with external systems or entities (non-closed-world)."
}
},
"additionalProperties": false
},
"parameters": {
"type": "array",
"description": "Input parameters for this endpoint.",
"items": { "$ref": "common-types-schema-1.json#/definitions/paramDefinition" }
},
"return": {
"$ref": "common-types-schema-1.json#/definitions/typeDefinition",
"description": "Description of the output schema."
},
"language": {
"type": "string",
"default": "sql",
"enum": ["sql", "python"],
"description": "The language used to define the logic of this endpoint. 'sql' or 'python'."
},
"source": {
"type": "object",
"description": "Source for the endpoint logic, either inline or a file reference.",
"oneOf": [
{ "required": ["code"], "not": { "required": ["file"] } },
{ "required": ["file"], "not": { "required": ["code"] } }
],
"properties": {
"code": {
"type": "string",
"description": "The inline code snippet to execute."
},
"file": {
"type": "string",
"description": "A relative path to a file containing the code."
}
},
"additionalProperties": false
},
"enabled": { "type": "boolean", "default": true, "description": "Whether this endpoint is active." },
"tests": {
"type": "array",
"description": "Tests to validate this endpoint.",
"items": {
"type": "object",
"required": ["name", "arguments"],
"properties": {
"name": { "type": "string", "description": "Name of the test." },
"description": { "type": "string", "description": "What the test checks." },
"arguments": {
"type": "array",
"items": {
"type": "object",
"required": ["key", "value"],
"properties": {
"key": { "type": "string", "description": "Input parameter to pass to test." },
"value": { "description": "Value of the input parameter to test." }
},
"additionalProperties": false
}
},
"result": { "description": "Expected result." },
"user_context": {
"type": "object",
"description": "User context for policy testing. Can include role, permissions, user_id, etc."
},
"result_contains": {
"description": "Partial match - result must contain these fields/values. For arrays, checks if array contains this item."
},
"result_not_contains": {
"type": "array",
"items": { "type": "string" },
"description": "List of field names that should NOT be present in the result."
},
"result_contains_item": {
"description": "For array results - at least one array item must match this object/value."
},
"result_contains_all": {
"type": "array",
"description": "For array results - all these items must be present (any order)."
},
"result_length": {
"type": "integer",
"minimum": 0,
"description": "For array results - array must have exactly this many items."
},
"result_contains_text": {
"type": "string",
"description": "For string results - result must contain this substring."
}
},
"additionalProperties": false
}
},
"policies": {
"$ref": "common-types-schema-1.json#/definitions/policySet",
"description": "Policy definitions for access control and data filtering."
}
}
}
}
}