package mcp-kit

All checked builds pass
  1. Overview
  2. Docs
OCaml library for building MCP servers

Install

dune-project
 Dependency

Authors

Maintainers

Sources

ocaml-mcp-v0.2.0.tar.gz
sha256=43c8319a13be91e323ae952a71ab673533fb3295886029eed9d81e5828de5ef7

doc/src/mcp-kit.jsonschema-core/regex.ml.html

Source file regex.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
(** Regex engine - ECMAScript backend.

    JSON Schema patterns use ECMAScript regular-expression syntax and are not
    implicitly anchored. Keep the backend behind this module boundary so
    validation keywords do not depend on engine-specific APIs. *)

type t = Ecma_regex.t

let json_schema_flags = Ecma_regex.flags ~unicode:true ()

let compile pattern =
  match Ecma_regex.compile ~flags:json_schema_flags pattern with
  | Ok re -> Ok re
  | Error msg -> Error ("invalid regex: " ^ pattern ^ ": " ^ msg)

let matches re s = Ecma_regex.search re s