Skip to content

Add custom functions to MCP-JS interpreter#23

Draft
r33drichards wants to merge 2 commits intomainfrom
claude/add-custom-functions-mcp-014zS6TmPXy1QVhusVieA6EY
Draft

Add custom functions to MCP-JS interpreter#23
r33drichards wants to merge 2 commits intomainfrom
claude/add-custom-functions-mcp-014zS6TmPXy1QVhusVieA6EY

Conversation

@r33drichards
Copy link
Owner

  • Add custom_functions module with V8 function binding support
  • Functions receive JSON arguments and return JSON values
  • Support both stateless and stateful execution with custom functions
  • Add lib.rs to expose public API for external use
  • Add comprehensive integration test (27 tests covering basic functions, array/object handling, error handling, composition, and stateful execution)
  • Add example demonstrating custom function usage with 8 example functions

- Add custom_functions module with V8 function binding support
- Functions receive JSON arguments and return JSON values
- Support both stateless and stateful execution with custom functions
- Add lib.rs to expose public API for external use
- Add comprehensive integration test (27 tests covering basic functions,
  array/object handling, error handling, composition, and stateful execution)
- Add example demonstrating custom function usage with 8 example functions
…nces

V8 snapshots require native function callbacks to be registered as
external references. Added EXTERNAL_REFS static that registers the
custom_function_callback, and pass it when creating/restoring snapshots.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants