@goke/mcp weekly downloads statistics
By goke · npm · MCP servers
Dynamically generate CLI commands from MCP server tools
@goke/mcp has 12,376 recorded weekly downloads on npm, an increase of 23.5% over the past 30 days, ranking #1201 of 3,247 tracked listings.
About @goke/mcp
@goke/mcp
Turn any MCP server into a CLI. Connects to the server, discovers tools, and generates CLI commands with typed arguments — automatically.
Install
npm install @goke/mcp goke
goke is a peer dependency (the CLI framework that commands are registered on).
How it works
MCP server Your CLI
┌──────────────────┐ ┌──────────────────────────┐
│ tools/list │──discover──▸ │ mycli notion-search │
│ - notion-search │ │ mycli notion-get-page │
│ - notion-get-… │ │ mycli notion-create-… │
│ (JSON Schema) │──coerce───▸ │ --query <string> │
│ │ │ --pageId <string> │
└──────────────────┘ └──────────────────────────┘
- Discover — calls
tools/liston the MCP server to get every tool + its JSON Schema - Register — creates a CLI command per tool with
--optionsderived from the schema - Cache — tool schemas are cached for 1 hour (no network on subsequent runs). Expired cache is still used when a live fetch is impossible (no token, 401 on
--help) - Execute — on invocation, connects to the server and calls the tool with coerced arguments
- OAuth — if the server returns 401, automatically opens the browser for OAuth, then retries.
--help,--version,completions, and no-args never start OAuth
Quick start
import { goke } from 'goke'
import { addMcpCommands } from '@goke/mcp'
import type { McpOAuthState, CachedMcpTools } from '@goke/mcp'
const cli = goke('notion-mcp-cli')
await addMcpCommands({
cli,
getMcpUrl: () => 'https://mcp.notion.com/mcp',
oauth: {
clientName: 'Notion CLI',
load: () => loadConfig().oauthState,
save: (state) => saveConfig({ oauthState: state }),
},
loadCache: () => loadConfig().cache,
saveCache: (cache) => saveConfig({ cache }),
})
cli.help()
cli.completions()
cli.parse()
If the MCP server is HTTP, pass getMcpUrl even when the user has no token. --help and no-args must still run so the CLI can show config / login instructions. Use getMcpTransport when you need stdio or a custom transport.
For an HTTP Bearer token, pass getHeaders:
await addMcpCommands({
cli,
getMcpUrl: () => 'https://api.example.com/mcp',
getHeaders: () => {
const token = process.env.EXAMPLE_TOKEN || loadConfig().token
if (!token) return
return { Authorization: `Bearer ${token}` }
},
loadCache: () => loadConfig().cache,
saveCache: (cache) => saveConfig({ cache }),
})
That's it. Every tool the MCP server exposes becomes a CLI command:
notion-mcp-cli notion-search --query "meeting notes"
notion-mcp-cli notion-retrieve-page --page_id "abc123"
notion-mcp-cli notion-list-users
Expose a CLI as an MCP server
createMcpAction() turns your entire CLI into a stdio MCP server with one line. Every CLI command becomes an MCP tool automatically. The command you attach it to is excluded from the tool list.
import { goke } from "goke"
import { z } from "zod"
import { createMcpAction } from "@goke/mcp"
const cli = goke("my-cli")
cli
.command("search", "Search pages")
.option("--query <query>", z.string().describe("Search query"))
.required()
.option("--limit [limit]", z.number().default(10).describe("Max results"))
.action((options) => {
return { results: findPages(options.query, options.limit) }
})
cli
.command("deploy <env>", "Deploy to environment")
.option("--dry-run", z.boolean().default(false).describe("Simulate"))
.action((env, options) => {
return options.dryRun ? `would deploy to ${env}` : deploy(env)
})
// Add MCP support — runs a stdio MCP server when the user invokes `my-cli mcp`
cli.command("mcp", "Start MCP server over stdio")
.action(createMcpAction({ cli }))
cli.help()
cli.completions()
cli.parse()
Now users can use your CLI directly or connect it as an MCP server:
# Use as a normal CLI
my-cli search --query "meeting notes"
my-cli deploy staging --dry-run
# Use as an MCP server (e.g. from Claude Desktop, Cursor, etc.)
my-cli mcp
When running as MCP, the server exposes search and deploy as tools. The mcp command itself is excluded. Options with Zod schemas (or any Standard Schema) become typed inputSchema properties in the MCP tool definition.
inputSchema.required is not the CLI <value> syntax. --query <query> means the flag needs a value if it is present. The flag itself is still optional unless you chain .required(). Required positionals like <env> always go in required. .required() flags go in required too.
Global options are tool arguments too. A cli.option('--account [account]', ...) shows up in every tool's inputSchema and reaches options.account, like on the command line. --help and --version are skipped. Middleware from cli.use() does not run for tool calls.
Arguments are coerced like argv. "false" becomes false for a boolean flag and "3" becomes 3 for a number schema. A value that does not fit ("maybe" for a boolean, 1 for a plain flag) fails the call with InvalidParams before the action runs.
ctx.isMcpToolCall is true when the action runs as a tool. Use it to refuse things that need a terminal, like reading process.stdin, which is the JSON-RPC channel of a stdio server:
cli
.command("send", "Send a message")
.option("--body-file <path>", z.string().describe("Read body from file (- for stdin)"))
.action(async (options, ctx) => {
if (options.bodyFile === "-" && ctx.isMcpToolCall) {
ctx.console.error("Pass the body inline. stdin is not available in MCP")
ctx.process.exit(1)
}
// ...
})
Installing the MCP server in clients…
Description from the npm listing.
- mcp
- cli
- goke
- model-context-protocol
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 (592)Similar npm MCP servers plugins
All 20 @goke/mcp 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/@goke/mcp. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.