Skip to content

Add native CrewAI tools for RustChain ecosystem#242

Open
GautamKumarOffical wants to merge 1 commit into
Scottcjn:mainfrom
GautamKumarOffical:add-crewai-tools
Open

Add native CrewAI tools for RustChain ecosystem#242
GautamKumarOffical wants to merge 1 commit into
Scottcjn:mainfrom
GautamKumarOffical:add-crewai-tools

Conversation

@GautamKumarOffical

Copy link
Copy Markdown

Summary

Adds native CrewAI tools for the RustChain ecosystem, fulfilling Bounty #13952 (25 RTC per framework).

Changes

  • New module with 10 CrewAI tools:

      • Check RTC token balance for a wallet
      • List available bounties for earning RTC
      • Check RustChain node health status
      • Get current epoch information
      • List active miners with hardware types
      • Search BoTTube AI video platform
      • Get BoTTube platform statistics
      • Discover AI agents on Beacon network
      • Get Beacon network statistics
      • Chat with native Beacon agents
  • for standalone installation

  • with comprehensive unit tests

  • with usage examples

Features

  • Follows the same pattern as the merged LangChain tool
  • Uses real RustChain endpoints ()
  • Graceful error handling with structured error messages
  • Pydantic input schemas for type-safe tool arguments
  • Compatible with CrewAI's interface

Usage

Installation

Or install from source:

Signed-off-by: Gautam Kumar <gautamkumarofficial@users.noreply.github.com>
@Scottcjn

Copy link
Copy Markdown
Owner

Elyan Labs review. CrewAI tools are a welcome addition — the wiring looks right. One blocking security issue before merge:

Blockingrustchain_crewai/__init__.py:27,34,42 TLS verification is disabled by default (TLS_VERIFY defaults to "0"). For a published agent-tool package that carries balance/chat/search traffic, that exposes users to MITM unless they happen to opt in. Flip the default to verify-on ("1"); let users opt out explicitly for self-signed/local nodes, with a clear warning. (This matches what we just did across the core MCP tools.) Fix the default and this lands. — Elyan Labs

@FakerHideInBush FakerHideInBush 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.

Good structure for a CrewAI integration — the tool class layout, input schemas, and test coverage are solid. Two bugs that must be fixed before merging:

1. TLS certificate verification is disabled by default — silent MITM risk

# Self-signed cert on dev nodes
_TLS_VERIFY = os.environ.get("TLS_VERIFY", "0") != "0"

With the default TLS_VERIFY=0, this evaluates to "0" != "0" = False, so every HTTP call (_get, _post) uses verify=False. Certificate verification is silently skipped for all calls to the node, BoTTube, and Beacon endpoints — not just the dev-node endpoint. Any user who installs this package and calls RustChainCheckBalance() or RustChainBeaconChat() against a production URL will have their requests silently sent without TLS verification, opening them to MITM attacks.

The correct default is verify=True (the requests library default). If the dev node uses a self-signed cert, the opt-out should be explicit: TLS_VERIFY=0 to disable, not TLS_VERIFY=1 to enable. Fix:

_TLS_VERIFY = os.environ.get("TLS_VERIFY", "1") != "0"  # default: verify certs

Or better: document that dev-node users should set REQUESTS_CA_BUNDLE to the self-signed cert path rather than disabling verification globally.

2. pyproject-crewai.toml is a non-standard filename — the package cannot be installed, and the README installation section is missing the install step

Python tooling (pip, hatch, build, uv) look for pyproject.toml at the project root — not pyproject-crewai.toml. Running pip install . from the repo root will use the existing pyproject.toml (or fail if there is none), not the file added by this PR. The rustchain_crewai package will never be installed via the standard workflow.

Additionally, the README installation section only lists:

pip install crewai requests

This installs crewai and requests but not rustchain_crewai itself. After following the README exactly, from rustchain_crewai import RustChainCheckBalance raises ModuleNotFoundError.

Options to fix:

  • Rename pyproject-crewai.tomlpyproject.toml (if this is a standalone package directory)
  • Or add the package as an optional extra in the existing pyproject.toml: pip install "rustchain-mcp[crewai]" with rustchain_crewai included in the wheel
  • And update the README to include the actual install command for rustchain_crewai

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.

3 participants