commits
Refactor all SDK examples to use the standardized Mcp.make_*_content
functions instead of direct constructors for better consistency.
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit moves the RPC message types from Mcp to a separate Mcp_message
module with a consistent structure:
1. Each message type (ResourcesList, ResourcesRead, etc.) has its own module
2. Each module contains Request, Response, and other relevant submodules
3. Each submodule has a single `type t` with JSON conversion functions
4. Each submodule includes the Json.Jsonable.S interface
This restructuring provides better type safety and a more consistent API
for handling JSON-RPC messages in the OCaml MCP implementation.
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit adds detailed OCamldoc annotations to the Mcp.mli interface file, based on the Model Context Protocol specifications. The annotations provide:
- Detailed module overview explaining the MCP architecture and components
- Thorough documentation for all types, modules, and functions
- Explanations of core protocol concepts
- JSON format examples using OCamldoc verbatim blocks
- Parameter documentation with @param tags
The annotations will improve code understandability and support OCamldoc generation.
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Created a new MCP server for directly evaluating OCaml code
- Uses compiler-libs.toplevel for direct code evaluation in process
- Provides rich error messages with detailed diagnostics
- Maintains toplevel state between evaluations
- Initializes with common libraries and modules
- Returns formatted results with syntax highlighting
- Captures stdout/stderr output during evaluation
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Implemented a simple GIF image generator with 8-color palette
- Created a basic red and blue checkerboard pattern
- Added proper GIF header, descriptor, and image data blocks
- Updated all image MIME types to image/gif
- GIF format is more widely compatible than SVG
- This makes the multimodal example more self-contained without dependencies
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed WAV header generation to properly encode binary data
- Implemented proper little-endian integer serialization
- Replaced PPM image format with SVG vector graphics
- Added various random SVG shapes (circles, rectangles, lines, polygons)
- Updated protocol version to 2025-03-26 to match spec
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit adds a new multimodal_sdk.ml example that demonstrates:
- Generating and returning image content (PPM format)
- Generating and returning audio content (WAV format)
- Combining multiple content types in a single tool response
- Using the new error handling and tool result infrastructure
- Implementing resource templates with multimodal responses
The example includes:
- A Base64 encoder for binary data
- A PPM (simple RGB format) image generator with checkerboard pattern
- A WAV audio generator for sine wave tones
- Multiple tools using different content types
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add proper AudioContent module to Mcp
- Add Audio content type to content type
- Update content serialization/deserialization functions
- Support JSON-RPC error code standardization
- Improve tool result handling with structured content
- Add helper functions for creating rich tool results with multiple content types
- Ensure content types match MCP specification
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit refactors the Mcp_sdk module to use a direct approach instead of
OCaml functors for creating servers. The changes include:
- Remove the MakeServer functor and Server module
- Create direct functions for working with servers
- Expose register_* and add_* functions for tools, resources, and prompts
- Update the capitalize_sdk.ml example to use the new API
- Simplify the server creation and configuration process
The non-functor API provides a more straightforward approach for creating
MCP servers in OCaml.
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit adds an MCP SDK module that provides a higher-level interface for
creating MCP servers. The SDK simplifies the creation of tools, resources, and
prompts with a more accessible API, avoiding the use of functors.
Key improvements:
- Created a modular Mcp_sdk library for easy server creation
- Fixed build issues and interface constraints
- Added a capitalize_sdk.ml example server using the new SDK
- Improved logging for server operations
- Restructured dune files to handle multiple libraries
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implements a simple MCP server that exposes a 'capitalize' tool which converts text to uppercase.
Includes comprehensive debugging and fixes protocol compatibility issues for Claude Desktop.
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit moves the RPC message types from Mcp to a separate Mcp_message
module with a consistent structure:
1. Each message type (ResourcesList, ResourcesRead, etc.) has its own module
2. Each module contains Request, Response, and other relevant submodules
3. Each submodule has a single `type t` with JSON conversion functions
4. Each submodule includes the Json.Jsonable.S interface
This restructuring provides better type safety and a more consistent API
for handling JSON-RPC messages in the OCaml MCP implementation.
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit adds detailed OCamldoc annotations to the Mcp.mli interface file, based on the Model Context Protocol specifications. The annotations provide:
- Detailed module overview explaining the MCP architecture and components
- Thorough documentation for all types, modules, and functions
- Explanations of core protocol concepts
- JSON format examples using OCamldoc verbatim blocks
- Parameter documentation with @param tags
The annotations will improve code understandability and support OCamldoc generation.
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Created a new MCP server for directly evaluating OCaml code
- Uses compiler-libs.toplevel for direct code evaluation in process
- Provides rich error messages with detailed diagnostics
- Maintains toplevel state between evaluations
- Initializes with common libraries and modules
- Returns formatted results with syntax highlighting
- Captures stdout/stderr output during evaluation
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Implemented a simple GIF image generator with 8-color palette
- Created a basic red and blue checkerboard pattern
- Added proper GIF header, descriptor, and image data blocks
- Updated all image MIME types to image/gif
- GIF format is more widely compatible than SVG
- This makes the multimodal example more self-contained without dependencies
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed WAV header generation to properly encode binary data
- Implemented proper little-endian integer serialization
- Replaced PPM image format with SVG vector graphics
- Added various random SVG shapes (circles, rectangles, lines, polygons)
- Updated protocol version to 2025-03-26 to match spec
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit adds a new multimodal_sdk.ml example that demonstrates:
- Generating and returning image content (PPM format)
- Generating and returning audio content (WAV format)
- Combining multiple content types in a single tool response
- Using the new error handling and tool result infrastructure
- Implementing resource templates with multimodal responses
The example includes:
- A Base64 encoder for binary data
- A PPM (simple RGB format) image generator with checkerboard pattern
- A WAV audio generator for sine wave tones
- Multiple tools using different content types
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add proper AudioContent module to Mcp
- Add Audio content type to content type
- Update content serialization/deserialization functions
- Support JSON-RPC error code standardization
- Improve tool result handling with structured content
- Add helper functions for creating rich tool results with multiple content types
- Ensure content types match MCP specification
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit refactors the Mcp_sdk module to use a direct approach instead of
OCaml functors for creating servers. The changes include:
- Remove the MakeServer functor and Server module
- Create direct functions for working with servers
- Expose register_* and add_* functions for tools, resources, and prompts
- Update the capitalize_sdk.ml example to use the new API
- Simplify the server creation and configuration process
The non-functor API provides a more straightforward approach for creating
MCP servers in OCaml.
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit adds an MCP SDK module that provides a higher-level interface for
creating MCP servers. The SDK simplifies the creation of tools, resources, and
prompts with a more accessible API, avoiding the use of functors.
Key improvements:
- Created a modular Mcp_sdk library for easy server creation
- Fixed build issues and interface constraints
- Added a capitalize_sdk.ml example server using the new SDK
- Improved logging for server operations
- Restructured dune files to handle multiple libraries
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>