
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A tool to generate TypeScript MCP servers from source code.
npm install -g mcptool
npx mcptool src/input.ts -o src/server.ts
This tool will process a typescript entrypoint and generate a fully functional MCP server implementation based on the provided code.
For example, take the following code as input:
/**
* Adds two numbers
* @mcpTool
*/
export function add(a: number, b: number): number {
return a + b;
}
If we run npx mcptool src/input.ts, this will generate an MCP server that exposes the add function as an MCP tool.
The generated file will be TypeScript, and should be committed to your repository. This is not "build output", in that you can choose to modify it manually from now on or can use it as a pre-commit step to always regenerate it.
Key points to note:
@mcpTool JSDoc comments will be exposed as MCP tools.CallToolResult (e.g. from tmcp), the generated server will use it as-is rather than wrapping it again.--outFile, -o <path> - Output file path--cwd, -c <path> - Current working directory (default: .)--transport, -t <type> - Transport method: stdio or http (default: stdio)--name, -n <name> - Project name (defaults to package.json name)--version, -v <version> - Project version (defaults to package.json version)--flavor, -f <flavor> - MCP flavor: tmcp or mcp (default: tmcp)--interactive, -i - Run in interactive mode (default: false)--silent, -s - Suppress output messages (default: false)--install - Automatically install missing dependencies (default: false)mcptool src/input.ts -o src/server.ts -t http -f mcp --install
The generated code is automatically formatted using the formatter installed locally in your project if it is supported. Supported formatters are:
If none of these are installed, the code will be unformatted and may not adhere to your project's coding style.
MIT License
FAQs
A compiler for producing MCP servers
We found that mcptool demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.