Skip to content

feat: implement code mode#1

Merged
mKeRix merged 7 commits into
mainfrom
implement-code-mode
Nov 23, 2025
Merged

feat: implement code mode#1
mKeRix merged 7 commits into
mainfrom
implement-code-mode

Conversation

@mKeRix

@mKeRix mKeRix commented Nov 23, 2025

Copy link
Copy Markdown
Owner

This implements the base architecture of toolscript - the basic commands and scaffolding needed to use MCP tools as "toolscript" (aka code mode).

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @mKeRix, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request establishes the core framework for 'toolscript', a powerful new system designed to bridge TypeScript code with Model Context Protocol (MCP) tools. It provides a robust CLI for managing a central gateway, which aggregates MCP servers and dynamically generates type-safe client code. The execution environment is securely sandboxed using Deno, and seamless integration with Claude Code is achieved through dedicated plugin hooks and skills. This foundational work lays the groundwork for highly interactive and secure programmatic interaction with MCP services.

Highlights

  • Core Architecture Implementation: This pull request introduces the foundational architecture for 'toolscript', a Deno-native CLI tool and Claude Code plugin. It enables the execution of TypeScript code to interact with Model Context Protocol (MCP) tools, focusing on type safety and sandboxed execution.
  • Comprehensive CLI Tooling: A full-featured Command Line Interface (CLI) has been implemented, providing commands for gateway management (start, status), tool discovery (list-servers, list-tools, get-types), and toolscript execution (exec inline code or from file).
  • Type-Safe MCP Access: The system now automatically generates TypeScript types from MCP tool schemas using json-schema-to-typescript. These types are served via an HTTP endpoint, allowing toolscripts to import and use MCP tools with full compile-time type safety.
  • Secure Sandboxed Execution: Toolscripts are executed within a restricted Deno sandbox, limiting network access exclusively to the toolscript gateway and denying file system access, enhancing security and isolation.
  • Claude Code Plugin Integration: Initial integration as a Claude Code plugin is complete, including SessionStart/SessionEnd hooks to manage the gateway lifecycle and a dedicated 'toolscript' skill for LLMs to interact with MCP tools effectively.
  • Detailed Documentation: Extensive documentation has been added, covering the project's architecture, security model, quick start guides, configuration, and examples, ensuring clarity for users and developers.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request lays a very solid foundation for toolscript. The architecture is well-thought-out, with clear separation of concerns between the CLI, gateway, execution sandbox, and type generation. The use of Deno's features like the permission model for sandboxing and native tooling is excellent. The code is generally of high quality, with good practices like strict TypeScript, custom error types, and a robust configuration loader. The testing strategy is particularly impressive, with a comprehensive suite of unit, integration, and end-to-end tests.

My review includes a few suggestions for improvement, mainly around robustness and efficiency. For instance, I've suggested removing a Python dependency from a shell script in favor of a Deno-native solution, improving resource cleanup in the sandbox, and making a CLI command more efficient by adding server-side filtering.

One minor point on project maintenance: the deno.lock file appears to contain some outdated entries. It might be beneficial to run deno cache --reload and commit the updated lock file to ensure it only contains currently used dependencies.

Overall, this is an excellent start for the project.

Comment thread plugins/toolscript/scripts/session-start.sh Outdated
Comment thread src/cli/commands/list.ts Outdated
Comment thread src/execution/sandbox.ts Outdated
Comment thread src/gateway/mcp-client.ts Outdated
Comment thread src/gateway/server.ts
@mKeRix mKeRix force-pushed the implement-code-mode branch from af8a1c6 to d5bcfa9 Compare November 23, 2025 19:22
@codecov-commenter

codecov-commenter commented Nov 23, 2025

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@mKeRix mKeRix force-pushed the implement-code-mode branch from 08858ac to 2d440b1 Compare November 23, 2025 19:43
@mKeRix mKeRix merged commit b3c4646 into main Nov 23, 2025
1 check passed
@mKeRix mKeRix deleted the implement-code-mode branch November 23, 2025 19:54
github-actions Bot pushed a commit that referenced this pull request Dec 1, 2025
# 1.0.0 (2025-12-01)

### Features

* add config merging ([#5](#5)) ([4d58cb7](4d58cb7))
* add semantic tool search ([#2](#2)) ([cac523b](cac523b))
* allow filtering exposed tools ([#4](#4)) ([bd1d64c](bd1d64c))
* implement code mode ([#1](#1)) ([b3c4646](b3c4646))
* initial commit ([5477138](5477138))
* support oauth2 protected mcp servers ([#3](#3)) ([f5408d1](f5408d1))
github-actions Bot pushed a commit that referenced this pull request Dec 1, 2025
# 1.0.0 (2025-12-01)

### Features

* add config merging ([#5](#5)) ([4d58cb7](4d58cb7))
* add semantic tool search ([#2](#2)) ([cac523b](cac523b))
* allow filtering exposed tools ([#4](#4)) ([bd1d64c](bd1d64c))
* implement code mode ([#1](#1)) ([b3c4646](b3c4646))
* initial commit ([5477138](5477138))
* support oauth2 protected mcp servers ([#3](#3)) ([f5408d1](f5408d1))
@github-actions

github-actions Bot commented Dec 1, 2025

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants