Skip to main content
One client. Build better, faster, cheaper prod-ready AI coding agents.

Install

npm install @morphllm/morphsdk
Edge environments? Use @morphllm/morphsdk/edge for Cloudflare Workers, Vercel Edge, or Deno. See Fast Apply and Model Router for examples.

Quick Start

import { MorphClient } from '@morphllm/morphsdk';

const morph = new MorphClient({ apiKey: "YOUR_API_KEY" });

// 1. Edit code (10,500 tokens/s)
await morph.fastApply.execute({
  target_filepath: 'src/auth.ts',
  instructions: 'Add null check',
  code_edit: '// ... existing code ...\nif (!user) throw new Error("Invalid");\n// ... existing code ...'
});

// 2. Search code (~1230ms)
const results = await morph.codebaseSearch.search({
  query: 'Where is JWT validation?',
  repoId: 'my-project'
});

// 3. Test in browser, return a video and logs
await morph.browser.execute({
  task: 'Test login flow',
  url: 'https://myapp.e2b.dev',
  model: 'gemini-flash-latest' // morph-computer-use-v0 in beta
});

// 4. Version control (triggers embedding)
await morph.git.push({ dir: './my-project' });
Get your API key: morphllm.com/dashboard/api-keys

Use with AI Agents

Give Morph tools to Claude, GPT, or any AI framework:
import Anthropic from '@anthropic-ai/sdk';
import { MorphClient } from '@morphllm/morphsdk';
import { createEditFileTool } from '@morphllm/morphsdk/tools/fastapply/anthropic';
import { createCodebaseSearchTool } from '@morphllm/morphsdk/tools/codebase-search/anthropic';

const morph = new MorphClient({ apiKey: "YOUR_API_KEY" });
const anthropic = new Anthropic();

const response = await anthropic.messages.create({
  model: "claude-sonnet-4-5-20250929",
  max_tokens: 12000,
  tools: [
    createCodebaseSearchTool({ repoId: 'my-project' }),
    createEditFileTool()
  ],
  messages: [{ 
    role: "user", 
    content: "Find the auth code and add error handling" 
  }]
});

// Agent searches codebase, then edits files autonomously

Tools

Fast Apply

10,500 tokens/s merging

Semantic Search

2-stage retrieval, ~1230ms

Git Storage

Auto-embedding on push

Next Steps

Fast Apply

Learn the lazy edit format

Examples

Real agent patterns