TPMJS vs LangChain Tools

LangChain bundles tools inside a framework runtime. TPMJS tools are standalone npm packages — same Zod schemas, no framework coupling, native MCP serving.

The Architectural Difference

LangChain tools are classes that extend StructuredTool or DynamicTool. They require the LangChain runtime to instantiate and call. TPMJS tools use the Vercel AI SDK tool() function — a thin wrapper around a Zod schema and an execute function with no framework runtime.

LangChain tool

import { StructuredTool } from '@langchain/core/tools';
import { z } from 'zod';

class SearchTool extends StructuredTool {
  name = 'search';
  description = 'Search the web';
  schema = z.object({
    query: z.string(),
  });

  async _call({ query }) {
    // implementation
  }
}

// Requires LangChain agent to invoke:
import { AgentExecutor } from 'langchain/agents';
const tools = [new SearchTool()];
const agent = AgentExecutor.fromAgentAndTools({
  agent, tools
});

TPMJS tool

import { tool } from 'ai';
import { z } from 'zod';

export const search = tool({
  description: 'Search the web',
  parameters: z.object({
    query: z.string(),
  }),
  execute: async ({ query }) => {
    // implementation
  },
});

// Works with any framework:
// - Vercel AI SDK: generateText({ tools: { search } })
// - Direct MCP: tpmjs.com/api/mcp/user/col/sse
// - CLI: tpmjs tool execute @my/pkg
// - Any MCP client: Claude, Cursor, Windsurf

Feature Comparison

CapabilityLangChain ToolsTPMJS
Runtime dependencyLangChain core + tool-specific packagesStandalone npm package (tool only)
Schema formatLangChain StructuredTool class + ZodVercel AI SDK tool() + Zod (framework-independent)
MCP supportRequires @langchain/mcp adapterNative — collections served as MCP endpoints
Works with Cursor / WindsurfNo (no MCP without adapter)Yes — native MCP with HTTP + SSE transports
Package size (per tool)Framework + transitive depsTool code + ai + zod
Publishing a toolPR to langchain repo or @langchain/* scopenpm publish with tpmjs keyword
VersioningTied to @langchain/* release cadenceIndependent semver per tool package
DiscoveryDocumentation / GitHub searchBM25-scored search API + web UI + CLI
Quality metricsNone (no scoring system)Quality score: tier + log(downloads) + log(stars) + metadata
Framework migrationRewrite tool integrationsTools are unchanged — swap orchestration layer only

MCP and Framework Portability

LangChain tools are coupled to the LangChain agent runtime. Using them with MCP requires the @langchain/mcp adapter — which still runs LangChain under the hood. TPMJS tools are exposed as native MCP endpoints:

// claude_desktop_config.json — no adapter needed
{
  "mcpServers": {
    "my-tools": {
      "command": "npx",
      "args": ["-y", "@anthropic/mcp-remote",
        "https://tpmjs.com/api/mcp/username/my-collection/sse"]
    }
  }
}

// Works in Claude Desktop, Cursor, Windsurf, or any MCP client
// No LangChain, no adapter, no additional runtime

When LangChain tools fit

  • Your entire stack is LangChain (LangSmith, LangServe, LangGraph)
  • You need LangChain-specific integrations (callbacks, tracing)
  • You're prototyping and want batteries-included

When TPMJS fits better

  • You want tools that work across frameworks (AI SDK, LangChain, custom)
  • You need native MCP support for Claude, Cursor, or Windsurf
  • You want independent versioning and minimal dependency footprint
  • You want to publish tools for the community via npm
  • You want quality scoring and searchable discovery

Tools should be portable, not framework-locked.

Publish a tool once, use it everywhere — MCP, CLI, AI SDK, or HTTP.