โ† Back to Blog
tutorialbeginnerpublishing

From Zero to MCP Publisher in 15 Minutes

A complete walkthrough: create an MCP tool from scratch, test it locally, and publish it on mcpm.

ยท2 min readยทxapable

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 &amp;&amp; <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">&quot;@modelcontextprotocol/sdk/server/index.js&quot;</span>;
<span class="hljs-keyword">import</span> { <span class="hljs-title class_">StdioServerTransport</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;@modelcontextprotocol/sdk/server/stdio.js&quot;</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">&quot;my-first-mcp&quot;</span>,
  <span class="hljs-attr">version</span>: <span class="hljs-string">&quot;1.0.0&quot;</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">&quot;tools/list&quot;</span>, <span class="hljs-title function_">async</span> () =&gt; ({
  <span class="hljs-attr">tools</span>: [{
    <span class="hljs-attr">name</span>: <span class="hljs-string">&quot;hello_world&quot;</span>,
    <span class="hljs-attr">description</span>: <span class="hljs-string">&quot;Returns a friendly greeting&quot;</span>,
    <span class="hljs-attr">inputSchema</span>: {
      <span class="hljs-attr">type</span>: <span class="hljs-string">&quot;object&quot;</span>,
      <span class="hljs-attr">properties</span>: {
        <span class="hljs-attr">name</span>: { <span class="hljs-attr">type</span>: <span class="hljs-string">&quot;string&quot;</span>, <span class="hljs-attr">description</span>: <span class="hljs-string">&quot;Who to greet&quot;</span> }
      },
      <span class="hljs-attr">required</span>: [<span class="hljs-string">&quot;name&quot;</span>]
    }
  }]
}));

server.<span class="hljs-title function_">setRequestHandler</span>(<span class="hljs-string">&quot;tools/call&quot;</span>, <span class="hljs-title function_">async</span> (request) =&gt; {
  <span class="hljs-keyword">if</span> (request.<span class="hljs-property">params</span>.<span class="hljs-property">name</span> === <span class="hljs-string">&quot;hello_world&quot;</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">&quot;text&quot;</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