Skip to main content
Use the unified MorphClient to access all tools, or import individual clients for advanced use.

Fast Apply

Apply LLM edits to files at 10,500 tokens/s. Handles lazy edits with // ... existing code ... markers.
When to use: Agent needs to edit code files Returns: Unified diff + change stats (lines added/removed/modified) Speed: 10,500+ tokens/s (40% faster than search-and-replace)
Path security: SDK validates all file paths are within baseDir to prevent directory traversal attacks.

Two-stage semantic search: embedding similarity + GPU reranking. Returns top 10 results in ~1230ms.
When to use: Agent needs to find relevant code Returns: Ranked code chunks with scores + metadata Speed: ~1230ms (vector search + GPU reranking)
Requires git push: Code must be pushed with MorphGit first to create searchable embeddings. Embeddings are generated automatically on push (takes ~8 seconds in background).
First search after push: Wait ~10 seconds after pushing before searching to allow embedding generation to complete.

How It Works

  1. Stage 1 (30ms): Vector similarity search retrieves 50 candidates
  2. Stage 2 (150ms): GPU reranking scores candidates for precision
Result: Best-in-class accuracy at 230ms total latency

Git Operations

Remote repository storage with automatic embedding generation on push.
When to use: Agent builds apps and needs version control Returns: Standard git operations (init, clone, push, pull, etc.) Bonus: Auto-embeds code for semantic search on every push
Fast push response: Git push returns in 200ms. Embedding generation happens asynchronously in the background (~3-8 seconds).

Browser Automation

Natural language browser testing with session recording and error detection.

Basic Usage

With Video Recording

When to use: Agent needs to test web applications Returns: Test results + optional session video + console logs + error screenshots Recording format: WebM video, 7-day presigned S3 URLs, auto-deleted after 30 days
Works with e2b.dev URLs: The browser worker can access e2b.dev preview environments and other publicly accessible URLs.
Max video length: Videos are limited to 3 minutes. For longer tests, use recordVideo: false.

Standalone Clients (Advanced)

Need custom configuration per tool? Use standalone clients instead of MorphClient:
When to use: You need tool-specific configuration that differs from defaults (e.g., custom URLs, different timeouts per tool).

Next Steps

Examples

See real-world agent patterns

API Reference

Complete function signatures