toolport weekly downloads statistics
By assistant-ui (6 listings) · npm · AI SDKs
Define a toolkit once, expose it as a CLI, MCP server, WebMCP, AI SDK tools, and a typed API.
toolport has 3,381 recorded weekly downloads on npm, ranking #1690 of 3,247 tracked listings.
About toolport
toolport
Define a toolkit once. Serve it as a CLI, an MCP server, WebMCP, AI SDK tools, or a typed JavaScript or Python API.
import { defineToolkit, tool } from "toolport";
export const weather = defineToolkit({
name: "weather",
description: "Weather lookups.",
tools: {
getWeather: tool({
description: "Get the current weather for a location.",
parameters: {
type: "object",
properties: {
location: { type: "string", description: "City name." },
unit: { type: "string", enum: ["celsius", "fahrenheit"] },
},
required: ["location"],
},
execute: async ({ location, unit }) =>
fetchWeather(location, unit ?? "celsius"),
}),
},
});
The key is the tool's name: 1-128 letters, digits, _, - or ., as MCP requires (defineToolkit throws on anything else). Parameters are plain JSON Schema: tool types execute's arguments from the literal, and a tool without arguments omits parameters. Any schema library that emits JSON Schema works (z.toJSONSchema(schema) for zod, or toJsonSchema(schema) from toolport for any Standard JSON Schema library).
Results
execute returns any JSON value. The MCP server sends a string as text, an object as text plus structuredContent, and anything else as JSON text. To send a result of your own, such as text beside JSON, warnings, or an error with data, return toolResult():
import { tool, toolResult } from "toolport";
const show = tool({
description: "Show a task.",
parameters: {
type: "object",
properties: { key: { type: "string" } },
required: ["key"],
},
execute: async ({ key }) => {
const task = await loadTask(key);
return toolResult({
content: [{ type: "text", text: `${task.key}: ${task.title}` }],
structuredContent: task,
_meta: { "toolport/warnings": ["2 steps are overdue"] },
});
},
});
- MCP clients get the result as given.
- The CLI prints
content(orstructuredContentwith--json) and eachtoolport/warningsentry on stderr. WithisError: trueit printsstructuredContenton stdout, the text on stderr, and exits with thetoolport/errorcode (1 by default). callTool,toApi,toAiSdkToolsand WebMCP resolve tostructuredContent, else the text of a single text block, else the blocks. WithisError: truethey throw aToolErrorwith the text and itstoolport/errorcode when that is aToolErrorCodeother thanunknown_tool, elseexecution_failed.contentis an array of MCP content blocks;structuredContentis an object.toolResultthrows on anything else.- JSON that isn't an object, such as a list beside its text, goes in
_meta["toolport/json"]; the CLI's--json,callTooland the other adapters resolve to it.
CLI
Install toolport in your project (Node.js 20.19+):
npm install toolport
Run a toolkit file directly, without writing an entry-point script:
npx toolport ./weather.ts # commands
npx toolport ./weather.ts --help --json # tools as JSON
npx toolport ./weather.ts getWeather --help
npx toolport ./weather.ts getWeather --location Berlin --unit fahrenheit
npx toolport ./weather.ts getWeather --input '{"location":"Berlin"}'
The executable loads TypeScript and JavaScript files with tsx, including local imports and top-level await in ESM modules. Export a toolkit object as the default export, or as a single named export (like weather above). If there are multiple toolkit exports, the default wins; use --export to select another:
npx toolport --export weather ./toolkits.ts --help
Runner options go before the tool name; everything after it is passed to the tool. Toolkit files run with your process's permissions and environment, so only load files you trust. Console logs are sent to stderr to keep stdout reserved for results and MCP messages. An optional toolkit close() method is awaited after a CLI call, on stdio EOF, or on HTTP shutdown.
You can still build a dedicated executable with the programmatic adapter:
#!/usr/bin/env node
import { serveCli } from "toolport/cli";
import { weather } from "./weather";
serveCli(weather);
weather # commands
weather getWeather --help # flags derived from the schema
weather getWeather --location Berlin --unit fahrenheit
One CLI over several MCP servers
serveCli also takes MCP servers (Streamable HTTP, through the official MCP client, 2026-07-28 or the 2025 handshake) and local toolkits, each under its own command word:
serveCli({
name: "mycli",
servers: { ttt: "https://ttt.example.com/mcp", board: { url, headers } },
local: [weather],
});
mycli # servers and toolkits
mycli board # board's commands
mycli board step done AUI-1 2 --result ok # calls the tool "step.done"
mycli board task show AUI-1 --json --fields title,steps
mycli weather getWeather --location Berlin
root: true on one server (board: { url, root: true }) puts its tools at the top level, beside the other commands: mycli task show AUI-1, and mycli login signs in to it. context: () => ({ agent, cwd }) adds fields to every call's toolport/context.
Before any call, the CLI checks required arguments, top-level types and enums, and exits 2 naming the flag. JSON prints indented on a terminal and as one compact line otherwise.
The commands come from standard MCP tool fields:…
Description from the npm listing.
- tools
- toolkit
- cli
- mcp
- webmcp
- agents
- ai-sdk
- langchain
- openapi
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (1)Similar npm AI SDKs plugins
All 20 toolport alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/toolport. First seen Dec 6, 2026; last successful collection Dec 6, 2026. See the methodology.