tools.import_mcp_tool module

Import an MCP tool from GitHub and convert it to a native Stargazer tool.

Clones the target repository, scans for MCP tool definitions, sends the source to Cursor for conversion and then a second pass for security auditing, and finally installs the result into the bot’s tool registry with embeddings and documentation.

Requires the UNSANDBOXED_EXEC privilege.

async tools.import_mcp_tool.run(github_url, tool_name='', model='', ctx=None)[source]

Import and convert an MCP tool from GitHub into a native Stargazer tool.

Clones github_url, scans for MCP tool definitions, runs a Cursor conversion pass followed by a Cursor security-audit pass, then validates and installs the generated tools/<tool_name>.py (registry reload, classifier embeddings, and docs). Requires the UNSANDBOXED_EXEC privilege.

Parameters:
  • github_url (str) – GitHub URL of the MCP tool repository to import.

  • tool_name (str) – Optional override for the generated tool file name (without .py). Auto-derived from the repo name if empty.

  • model (str) – Optional Cursor model to use; defaults to DEFAULT_MODEL.

  • ctx (ToolContext | None) – Tool execution context.

Returns:

JSON describing success/failure, the installed tool names, and the security-audit summary.

Return type:

str