From Zero to MCP Publisher in 15 Minutes
Never published an MCP tool? This guide gets you from zero to live on mcpm in 15 minutes flat.
Step 1: Install mcpm CLI (1 min)
npm i -g mcpm-dev
mcpm-dev login
Follow the browser prompt to authenticate with GitHub.
Step 2: Scaffold Your Tool (2 min)
<span class="hljs-built_in">mkdir</span> my-first-mcp && <span class="hljs-built_in">cd</span> my-first-mcp
npm init -y
npm install @modelcontextprotocol/sdk
Step 3: Write the Tool (5 min)
Create index.js:
<span class="hljs-keyword">import</span> { <span class="hljs-title class_">Server</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">"@modelcontextprotocol/sdk/server/index.js"</span>;
<span class="hljs-keyword">import</span> { <span class="hljs-title class_">StdioServerTransport</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">"@modelcontextprotocol/sdk/server/stdio.js"</span>;
<span class="hljs-keyword">const</span> server = <span class="hljs-keyword">new</span> <span class="hljs-title class_">Server</span>({
<span class="hljs-attr">name</span>: <span class="hljs-string">"my-first-mcp"</span>,
<span class="hljs-attr">version</span>: <span class="hljs-string">"1.0.0"</span>,
}, {
<span class="hljs-attr">capabilities</span>: { <span class="hljs-attr">tools</span>: {} }
});
server.<span class="hljs-title function_">setRequestHandler</span>(<span class="hljs-string">"tools/list"</span>, <span class="hljs-title function_">async</span> () => ({
<span class="hljs-attr">tools</span>: [{
<span class="hljs-attr">name</span>: <span class="hljs-string">"hello_world"</span>,
<span class="hljs-attr">description</span>: <span class="hljs-string">"Returns a friendly greeting"</span>,
<span class="hljs-attr">inputSchema</span>: {
<span class="hljs-attr">type</span>: <span class="hljs-string">"object"</span>,
<span class="hljs-attr">properties</span>: {
<span class="hljs-attr">name</span>: { <span class="hljs-attr">type</span>: <span class="hljs-string">"string"</span>, <span class="hljs-attr">description</span>: <span class="hljs-string">"Who to greet"</span> }
},
<span class="hljs-attr">required</span>: [<span class="hljs-string">"name"</span>]
}
}]
}));
server.<span class="hljs-title function_">setRequestHandler</span>(<span class="hljs-string">"tools/call"</span>, <span class="hljs-title function_">async</span> (request) => {
<span class="hljs-keyword">if</span> (request.<span class="hljs-property">params</span>.<span class="hljs-property">name</span> === <span class="hljs-string">"hello_world"</span>) {
<span class="hljs-keyword">const</span> name = request.<span class="hljs-property">params</span>.<span class="hljs-property">arguments</span>.<span class="hljs-property">name</span>;
<span class="hljs-keyword">return</span> {
<span class="hljs-attr">content</span>: [{ <span class="hljs-attr">type</span>: <span class="hljs-string">"text"</span>, <span class="hljs-attr">text</span>: <span class="hljs-string">`Hello, <span class="hljs-subst">${name}</span>! ๐`</span> }]
};
}
<span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">Error</span>(<span class="hljs-string">`Unknown tool: <span class="hljs-subst">${request.params.name}</span>`</span>);
});
<span class="hljs-keyword">const</span> transport = <span class="hljs-keyword">new</span> <span class="hljs-title class_">StdioServerTransport</span>();
<span class="hljs-keyword">await</span> server.<span class="hljs-title function_">connect</span>(transport);
Step 4: Test Locally (2 min)
node index.js
In another terminal, configure your MCP client (Claude Desktop, Cursor, etc.) to point to this server.
Step 5: Write a README (2 min)
Create README.md. This becomes your mcpm listing page. Include:
- What the tool does
- How to install and use it
- Available tools and their parameters
Step 6: Publish to mcpm (1 min)
mcpm-dev publish
That's it! Your tool is now live at https://www.mcpm.dev/packages/my-first-mcp.
What's Next?
- Add more tools to your server
- Set up automated testing
- Apply for the verified badge after 100 weekly downloads
What's the first MCP tool you want to build? Share your idea below!
#MCP #Tutorial #Beginner #DevTools #mcpm
From Zero to MCP Publisher in 15 Minutes
Never published an MCP tool? This guide gets you from zero to live on mcpm in 15 minutes flat.
Step 1: Install mcpm CLI (1 min)
Follow the browser prompt to authenticate with GitHub.
Step 2: Scaffold Your Tool (2 min)
<span class="hljs-built_in">mkdir</span> my-first-mcp && <span class="hljs-built_in">cd</span> my-first-mcp npm init -y npm install @modelcontextprotocol/sdkStep 3: Write the Tool (5 min)
Create
index.js:<span class="hljs-keyword">import</span> { <span class="hljs-title class_">Server</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">"@modelcontextprotocol/sdk/server/index.js"</span>; <span class="hljs-keyword">import</span> { <span class="hljs-title class_">StdioServerTransport</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">"@modelcontextprotocol/sdk/server/stdio.js"</span>; <span class="hljs-keyword">const</span> server = <span class="hljs-keyword">new</span> <span class="hljs-title class_">Server</span>({ <span class="hljs-attr">name</span>: <span class="hljs-string">"my-first-mcp"</span>, <span class="hljs-attr">version</span>: <span class="hljs-string">"1.0.0"</span>, }, { <span class="hljs-attr">capabilities</span>: { <span class="hljs-attr">tools</span>: {} } }); server.<span class="hljs-title function_">setRequestHandler</span>(<span class="hljs-string">"tools/list"</span>, <span class="hljs-title function_">async</span> () => ({ <span class="hljs-attr">tools</span>: [{ <span class="hljs-attr">name</span>: <span class="hljs-string">"hello_world"</span>, <span class="hljs-attr">description</span>: <span class="hljs-string">"Returns a friendly greeting"</span>, <span class="hljs-attr">inputSchema</span>: { <span class="hljs-attr">type</span>: <span class="hljs-string">"object"</span>, <span class="hljs-attr">properties</span>: { <span class="hljs-attr">name</span>: { <span class="hljs-attr">type</span>: <span class="hljs-string">"string"</span>, <span class="hljs-attr">description</span>: <span class="hljs-string">"Who to greet"</span> } }, <span class="hljs-attr">required</span>: [<span class="hljs-string">"name"</span>] } }] })); server.<span class="hljs-title function_">setRequestHandler</span>(<span class="hljs-string">"tools/call"</span>, <span class="hljs-title function_">async</span> (request) => { <span class="hljs-keyword">if</span> (request.<span class="hljs-property">params</span>.<span class="hljs-property">name</span> === <span class="hljs-string">"hello_world"</span>) { <span class="hljs-keyword">const</span> name = request.<span class="hljs-property">params</span>.<span class="hljs-property">arguments</span>.<span class="hljs-property">name</span>; <span class="hljs-keyword">return</span> { <span class="hljs-attr">content</span>: [{ <span class="hljs-attr">type</span>: <span class="hljs-string">"text"</span>, <span class="hljs-attr">text</span>: <span class="hljs-string">`Hello, <span class="hljs-subst">${name}</span>! ๐`</span> }] }; } <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">Error</span>(<span class="hljs-string">`Unknown tool: <span class="hljs-subst">${request.params.name}</span>`</span>); }); <span class="hljs-keyword">const</span> transport = <span class="hljs-keyword">new</span> <span class="hljs-title class_">StdioServerTransport</span>(); <span class="hljs-keyword">await</span> server.<span class="hljs-title function_">connect</span>(transport);Step 4: Test Locally (2 min)
In another terminal, configure your MCP client (Claude Desktop, Cursor, etc.) to point to this server.
Step 5: Write a README (2 min)
Create
README.md. This becomes your mcpm listing page. Include:Step 6: Publish to mcpm (1 min)
That's it! Your tool is now live at
https://www.mcpm.dev/packages/my-first-mcp.What's Next?
What's the first MCP tool you want to build? Share your idea below!
#MCP #Tutorial #Beginner #DevTools #mcpm