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, WindsurfFeature Comparison
| Capability | LangChain Tools | TPMJS |
|---|---|---|
| Runtime dependency | LangChain core + tool-specific packages | Standalone npm package (tool only) |
| Schema format | LangChain StructuredTool class + Zod | Vercel AI SDK tool() + Zod (framework-independent) |
| MCP support | Requires @langchain/mcp adapter | Native — collections served as MCP endpoints |
| Works with Cursor / Windsurf | No (no MCP without adapter) | Yes — native MCP with HTTP + SSE transports |
| Package size (per tool) | Framework + transitive deps | Tool code + ai + zod |
| Publishing a tool | PR to langchain repo or @langchain/* scope | npm publish with tpmjs keyword |
| Versioning | Tied to @langchain/* release cadence | Independent semver per tool package |
| Discovery | Documentation / GitHub search | BM25-scored search API + web UI + CLI |
| Quality metrics | None (no scoring system) | Quality score: tier + log(downloads) + log(stars) + metadata |
| Framework migration | Rewrite tool integrations | Tools 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 runtimeWhen 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.